Want to upgrade a single package on CentOS/Fedora systems?
Worry not, because, CentOS/Fedora or any other RHEL based distribution provides a way to upgrade a single package using the yum command.
Upgrade a Single Package on CentOS/Fedora
Usually, CentOS/Fedora or any other RHEL based distribution provides the
yum update command for updating system packages.
When you run the
yum update, all system packages with available updates are updated.
However, if you want to upgrade a single package, then you would have to pass the package name as the argument to the
yum update command.
yum update <packagename>
dnf update <packagename>
<packagename> with the name of the specific package you want to update.
Similarly, you can use the command;
yum upgrade <packagename>
dnf upgrade <packagename>
For example, let us list all available package updates using either
yum check-update or
yum list updates.
yum list updates
Either of the commands will provide a list of all packages with packages available;
See my truncated output below from
yum list updates command.
... vim-common.x86_64 2:8.0.1763-15.el8 AppStream vim-enhanced.x86_64 2:8.0.1763-15.el8 AppStream vim-filesystem.noarch 2:8.0.1763-15.el8 AppStream vim-minimal.x86_64 2:8.0.1763-15.el8 BaseOS webmin.noarch 1.970-1 Webmin wget.x86_64 1.19.5-10.el8 AppStream which.x86_64 2.21-12.el8 BaseOS xfsprogs.x86_64 5.0.0-4.el8 BaseOS xkeyboard-config.noarch 2.28-1.el8 AppStream yum.noarch 4.2.23-4.el8 BaseOS zlib.x86_64
Note that you can as well get the packages that needs to be upgraded using the
yum list --upgrades command.
Lets take for example, I want to upgrade individual package on CentOS/Fedora like, webmin, which is one of the packages that have updates available as per out above command output, then either of the commands below get the job done.
Before that, check the version of the installed package;
yum list installed webmin
Installed Packages webmin.noarch 1.940-2 @Webmin
As you can see, we have Webmin version 1.940-2 installed.
The available updated version is webmin v1.970-1.
Thus, to upgrade a single or individual specific package on CentOS/Fedora
dnf update webmin
yum update webmin
dnf upgrade webmin
yum upgrade webmin
Last metadata expiration check: 0:51:04 ago on Wed 03 Feb 2021 10:12:22 AM EST. Dependencies resolved. ============================================================================================================================================================================ Package Arch Version Repository Size ============================================================================================================================================================================ Upgrading: webmin noarch 1.970-1 Webmin 39 M Transaction Summary ============================================================================================================================================================================ Upgrade 1 Package Total download size: 39 M Is this ok [y/N]: y
And that is how simple it is to upgrade a single package on CentOS/Fedora systems.
Read more on;
Upgrade a Single package on Ubuntu
Delete Lines Matching Specific Pattern in a File using VIM