In this guide, we'll dive deep and see how we can upgrade specific packages on CentOS Stream. Once in a while, you may be required to upgrade certain packages and leave others in their default versions. One reason for this is maintaining the stability of packages that are used in running crucial services such as databases and web servers. Sometimes an upgrade may result in changes in the package that may affect the normal running of services.
Using yum to upgrade specific packages
Before anything else, we may need first to check the packages with pending updates. To do this, run the following command
yum list updates
You may need to display multiple versions of a package that exists in your system. To do this, run the command below
yum --showduplicates list httpd | expand
In the above example, you'll be displaying multiple versions of httpd package.
Installed Packages
httpd.x86_64 2.4.6-67.el7_4.6 @rhui-REGION-rhel-server-releases
Available Packages
httpd.x86_64 2.4.6-17.el7 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-18.el7_0 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-19.el7_0 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-31.el7 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-31.el7_1.1 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-40.el7 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-40.el7_2.1 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-40.el7_2.4 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-45.el7 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-45.el7_3.4 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-67.el7 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-67.el7_4.2 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-67.el7_4.5 rhui-REGION-rhel-server-releases
httpd.x86_64 2.4.6-67.el7_4.6 rhui-REGION-rhel-server-releases
From the results above, we notice that the httpd package currently installed is version 2.4.6-67.el7_4.6 which is the latest. What if you wanted to install a specific version of the package, how would you go about it? The syntax for that will be as shown below
Comments