Introduction¶
In order to make container images and cloud images as small as possible, distribution maintainers and packagers may sometimes ship stripped down versions of popular packages. Examples of stripped-down packages bundled with container or cloud images are vim-minimal, curl-minimal, coreutils-single and so on.
Although some of the shipped packages are stripped down versions, they are often fully acceptable for most use cases.
For cases, when the stripped-down package is not enough, you can use the dnf swap command to quickly replace the minimal package with the regular package.
Objective¶
This Rocky Linux GEMstone demonstrates how to use dnf to swap the bundled vim-minimal package with the regular vim package.
Check existing vim variant¶
While logged into your container or virtual machine environment as a user with administrative privileges, first verify the variant of vim package installed. Type:
# rpm -qa | grep ^vim
vim-minimal-9.1.083-5.el10_0.1.x86_64
You have vim-minimal on our system.
Swap vim-minimal for vim¶
Use dnf to swap the installed vim-minimal package with regular vim package.
# dnf -y swap vim-minimal vim
Check new vim package variant¶
To confirm the changes, query the rpm database again for the installed vim package(s) by running:
# rpm -qa | grep ^vim
vim-enhanced-9.1.083-5.el10_0.1.x86_64
And it's a GEM !
Notes¶
DNF Swap Command
Syntax:
dnf [options] swap <package-to-be-removed> <replacement-package>
Under the hood, dnf swap uses DNF's --allowerasing option to resolve any package conflict issues. Therefore the vim-minimal example demonstrated in this GEMstone could also have been done by running:
dnf install -y --allowerasing vim
Author: wale soyinka