Linux: Updating with YUM
-
Because of the way that YUM leverages package repositories to handle finding packages and finding their dependencies, this also allows us to use it to update packages that are already installed. Since YUM can view a list of all packages under its management and check the repositories (or repos) to see if any of those packages have been updated, it allows us to update both individual packages as well as the entire set of packages. Very powerful stuff.
Using YUM's update capacity is as simple as telling it to update a package, multiple packages or tell it nothing and it will update all packages installed on the system currently. As with the install options, the -y flag will cause YUM to run automatically and leaving off this flag will cause it to stop and wait for confirmation before making any changes.
For a single package:
yum -y update httpd
For multiple packages:
yum -y update httpd wget curl htop
To update the entire system:
yum -y update
Updating your entire RPM-based operating system to the latest version of all packages, including comprehensive dependency checking is that simple.
Below will be some sample output to help understand what it is doing, we get this output by leaving off the -y flag. This helps us to decide if the changes are things that we want to accept. We can see what packages are being added, which are updated, which will be removed and if there are any errors.
Part of a series on Linux Systems Administration by Scott Alan Miller
-
========================================================================================================================= Package Arch Version Repository Size ========================================================================================================================= Installing: kernel x86_64 3.10.0-327.13.1.el7 updates 33 M python2-boto noarch 2.39.0-1.el7 epel 1.7 M replacing python-boto.noarch 2.38.0-2.el7 Updating: NetworkManager x86_64 1:1.0.6-29.el7_2 updates 2.0 M NetworkManager-adsl x86_64 1:1.0.6-29.el7_2 updates 130 k NetworkManager-bluetooth x86_64 1:1.0.6-29.el7_2 updates 153 k NetworkManager-glib x86_64 1:1.0.6-29.el7_2 updates 385 k NetworkManager-libnm x86_64 1:1.0.6-29.el7_2 updates 498 k NetworkManager-team x86_64 1:1.0.6-29.el7_2 updates 132 k NetworkManager-tui x86_64 1:1.0.6-29.el7_2 updates 212 k NetworkManager-wifi x86_64 1:1.0.6-29.el7_2 updates 160 k NetworkManager-wwan x86_64 1:1.0.6-29.el7_2 updates 152 k avahi x86_64 0.6.31-15.el7_2.1 updates 263 k avahi-autoipd x86_64 0.6.31-15.el7_2.1 updates 39 k avahi-libs x86_64 0.6.31-15.el7_2.1 updates 61 k bind-libs x86_64 32:9.9.4-29.el7_2.3 updates 1.0 M bind-libs-lite x86_64 32:9.9.4-29.el7_2.3 updates 724 k bind-license noarch 32:9.9.4-29.el7_2.3 updates 82 k bind-utils x86_64 32:9.9.4-29.el7_2.3 updates 200 k ca-certificates noarch 2015.2.6-70.1.el7_2 updates 428 k coreutils x86_64 8.22-15.el7_2.1 updates 3.2 M cronie x86_64 1.4.11-14.el7_2.1 updates 90 k cronie-anacron x86_64 1.4.11-14.el7_2.1 updates 35 k cyrus-sasl-lib x86_64 2.1.26-20.el7_2 updates 155 k device-mapper x86_64 7:1.02.107-5.el7_2.1 updates 252 k device-mapper-libs x86_64 7:1.02.107-5.el7_2.1 updates 304 k filebeat x86_64 1.2.1-1 beats 3.9 M glibc x86_64 2.17-106.el7_2.4 updates 3.6 M glibc-common x86_64 2.17-106.el7_2.4 updates 11 M htop x86_64 2.0.1-1.el7 epel 97 k initscripts x86_64 9.49.30-1.el7_2.2 updates 429 k kernel-tools x86_64 3.10.0-327.13.1.el7 updates 2.4 M kernel-tools-libs x86_64 3.10.0-327.13.1.el7 updates 2.3 M kexec-tools x86_64 2.0.7-38.el7_2.1 updates 306 k kpartx x86_64 0.4.9-85.el7_2.1 updates 59 k krb5-libs x86_64 1.13.2-12.el7_2 updates 843 k libblkid x86_64 2.23.2-26.el7_2.2 updates 166 k libgudev1 x86_64 219-19.el7_2.7 updates 65 k libmount x86_64 2.23.2-26.el7_2.2 updates 169 k libssh2 x86_64 1.4.3-10.el7_2.1 updates 134 k libteam x86_64 1.17-6.el7_2 updates 45 k libuuid x86_64 2.23.2-26.el7_2.2 updates 74 k mariadb-libs x86_64 1:5.5.47-1.el7_2 updates 755 k nss-util x86_64 3.19.1-9.el7_2 updates 71 k numactl-libs x86_64 2.0.9-6.el7_2 updates 29 k openldap x86_64 2.4.40-9.el7_2 updates 348 k openssh x86_64 6.6.1p1-25.el7_2 updates 435 k openssh-clients x86_64 6.6.1p1-25.el7_2 updates 639 k openssh-server x86_64 6.6.1p1-25.el7_2 updates 436 k openssl x86_64 1:1.0.1e-51.el7_2.4 updates 711 k openssl-libs x86_64 1:1.0.1e-51.el7_2.4 updates 951 k polkit x86_64 0.112-6.el7_2 updates 166 k procps-ng x86_64 3.3.10-5.el7_2 updates 287 k python-perf x86_64 3.10.0-327.13.1.el7 updates 2.4 M python-pyudev noarch 0.15-7.el7_2.1 updates 54 k screen x86_64 4.1.0-0.23.20120314git3c2946.el7_2 updates 552 k selinux-policy noarch 3.13.1-60.el7_2.3 updates 375 k selinux-policy-targeted noarch 3.13.1-60.el7_2.3 updates 3.9 M sudo x86_64 1.8.6p7-17.el7_2 updates 732 k systemd x86_64 219-19.el7_2.7 updates 5.1 M systemd-libs x86_64 219-19.el7_2.7 updates 357 k systemd-python x86_64 219-19.el7_2.7 updates 99 k systemd-sysv x86_64 219-19.el7_2.7 updates 53 k teamd x86_64 1.17-6.el7_2 updates 109 k topbeat x86_64 1.2.1-1 beats 3.3 M tuned noarch 2.5.1-4.el7_2.3 updates 193 k tzdata noarch 2016c-1.el7 updates 437 k util-linux x86_64 2.23.2-26.el7_2.2 updates 1.9 M Removing: kernel x86_64 3.10.0-229.7.2.el7 @updates 131 M kernel x86_64 3.10.0-229.11.1.el7 @updates 131 M Installing for dependencies: bluez-libs x86_64 5.23-4.el7 base 70 k Transaction Summary ========================================================================================================================= Install 2 Packages (+1 Dependent package) Upgrade 65 Packages Remove 2 Packages Total download size: 96 M Is this ok [y/d/N]:
This example, done on CentOS 7, with the yum update command without the -y ran through several screens of "working information" and produces this chart that lists every package that will be affected and its status. At the end we get a summary that tells us how many packages will be newly added (2), how many upgraded (65) and how many removed (2) and the total size of the download (96 MB). Then we get the chance to continue or not.
-
kernel x86_64 3.10.0-327.13.1.el7 updates 33 M
If we examine one line of this file, we can see that the first column is telling us the package name. In this example, it is kernel.
The next column is the architecture, in this example it is x86_64 which is the syntax here for the AMD64 architecture (64bit PC). Linux supports many architectures and some packages, such as those containing only scripts or text files, are not compiled to any architecture and so are noarch. In most 64 bit environments, such as x86_64 here, you can have 32 bit support as well, so i386, i586 and i686 32 bit IA32 packages are all quite possible in this example environment as well. The usefulness of this column is primarily to know if you are installing a native 64 bit or a legacy 32 bit package.
Next column shows the version of the available package, 3.10.0-327.13.1.el7 in this example.
The next column tells us the name of the source repository that is providing this package. Here it is the included CentOS 7 repo named updates.
And the final column tells us the size of the individual package. Our package here will be 33MB.
-
The "working data" that I mentioned that scrolls by quickly before our summary chart appears from this example looks like the below output. Generally we can ignore this, but it can be useful should there be an error to see where something has gone wrong.
$ yum update Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.lga7.us.voxel.net * epel: mirror.cs.princeton.edu * extras: mirror.lug.udel.edu * updates: mirror.trouble-free.net Resolving Dependencies --> Running transaction check ---> Package NetworkManager.x86_64 1:1.0.0-16.git20150121.b4ea599c.el7_1 will be updated ---> Package NetworkManager.x86_64 1:1.0.6-27.el7 will be updated ---> Package NetworkManager.x86_64 1:1.0.6-29.el7_2 will be an update ---> Package NetworkManager-adsl.x86_64 1:1.0.6-27.el7 will be updated ---> Package NetworkManager-adsl.x86_64 1:1.0.6-29.el7_2 will be an update ---> Package NetworkManager-bluetooth.x86_64 1:1.0.6-27.el7 will be updated ---> Package NetworkManager-bluetooth.x86_64 1:1.0.6-29.el7_2 will be an update --> Processing Dependency: libbluetooth.so.3()(64bit) for package: 1:NetworkManager-bluetooth-1.0.6-29.el7_2.x86_64 ---> Package NetworkManager-glib.x86_64 1:1.0.6-27.el7 will be updated ---> Package NetworkManager-glib.x86_64 1:1.0.6-29.el7_2 will be an update ---> Package NetworkManager-libnm.x86_64 1:1.0.6-27.el7 will be updated ---> Package NetworkManager-libnm.x86_64 1:1.0.6-29.el7_2 will be an update ---> Package NetworkManager-team.x86_64 1:1.0.6-27.el7 will be updated ---> Package NetworkManager-team.x86_64 1:1.0.6-29.el7_2 will be an update ---> Package NetworkManager-tui.x86_64 1:1.0.6-27.el7 will be updated ---> Package NetworkManager-tui.x86_64 1:1.0.6-29.el7_2 will be an update ---> Package NetworkManager-wifi.x86_64 1:1.0.6-27.el7 will be updated ---> Package NetworkManager-wifi.x86_64 1:1.0.6-29.el7_2 will be an update ---> Package NetworkManager-wwan.x86_64 1:1.0.6-27.el7 will be updated ---> Package NetworkManager-wwan.x86_64 1:1.0.6-29.el7_2 will be an update ---> Package avahi.x86_64 0:0.6.31-14.el7 will be updated ---> Package avahi.x86_64 0:0.6.31-15.el7 will be updated ---> Package avahi.x86_64 0:0.6.31-15.el7_2.1 will be an update ---> Package avahi-autoipd.x86_64 0:0.6.31-15.el7 will be updated ---> Package avahi-autoipd.x86_64 0:0.6.31-15.el7_2.1 will be an update ---> Package avahi-libs.x86_64 0:0.6.31-15.el7 will be updated ---> Package avahi-libs.x86_64 0:0.6.31-15.el7_2.1 will be an update ---> Package bind-libs.x86_64 32:9.9.4-29.el7_2.2 will be updated ---> Package bind-libs.x86_64 32:9.9.4-29.el7_2.3 will be an update ---> Package bind-libs-lite.x86_64 32:9.9.4-29.el7_2.2 will be updated ---> Package bind-libs-lite.x86_64 32:9.9.4-29.el7_2.3 will be an update ---> Package bind-license.noarch 32:9.9.4-29.el7_2.2 will be updated ---> Package bind-license.noarch 32:9.9.4-29.el7_2.3 will be an update ---> Package bind-utils.x86_64 32:9.9.4-29.el7_2.2 will be updated ---> Package bind-utils.x86_64 32:9.9.4-29.el7_2.3 will be an update ---> Package ca-certificates.noarch 0:2015.2.4-71.el7 will be updated ---> Package ca-certificates.noarch 0:2015.2.6-70.1.el7_2 will be an update ---> Package coreutils.x86_64 0:8.22-12.el7_1.2 will be updated ---> Package coreutils.x86_64 0:8.22-15.el7 will be updated ---> Package coreutils.x86_64 0:8.22-15.el7_2.1 will be an update ---> Package cronie.x86_64 0:1.4.11-13.el7 will be updated ---> Package cronie.x86_64 0:1.4.11-14.el7 will be updated ---> Package cronie.x86_64 0:1.4.11-14.el7_2.1 will be an update ---> Package cronie-anacron.x86_64 0:1.4.11-14.el7 will be updated ---> Package cronie-anacron.x86_64 0:1.4.11-14.el7_2.1 will be an update ---> Package cyrus-sasl-lib.x86_64 0:2.1.26-19.2.el7 will be updated ---> Package cyrus-sasl-lib.x86_64 0:2.1.26-20.el7_2 will be an update ---> Package device-mapper.x86_64 7:1.02.107-5.el7 will be updated ---> Package device-mapper.x86_64 7:1.02.107-5.el7_2.1 will be an update ---> Package device-mapper-libs.x86_64 7:1.02.107-5.el7 will be updated ---> Package device-mapper-libs.x86_64 7:1.02.107-5.el7_2.1 will be an update ---> Package filebeat.x86_64 0:1.1.0-1 will be updated ---> Package filebeat.x86_64 0:1.2.1-1 will be an update ---> Package glibc.x86_64 0:2.17-106.el7_2.1 will be updated ---> Package glibc.x86_64 0:2.17-106.el7_2.4 will be an update ---> Package glibc-common.x86_64 0:2.17-106.el7_2.1 will be updated ---> Package glibc-common.x86_64 0:2.17-106.el7_2.4 will be an update ---> Package htop.x86_64 0:1.0.3-3.el7 will be updated ---> Package htop.x86_64 0:2.0.1-1.el7 will be an update ---> Package initscripts.x86_64 0:9.49.24-1.el7 will be updated ---> Package initscripts.x86_64 0:9.49.30-1.el7 will be updated ---> Package initscripts.x86_64 0:9.49.30-1.el7_2.2 will be an update ---> Package kernel.x86_64 0:3.10.0-327.13.1.el7 will be installed ---> Package kernel-tools.x86_64 0:3.10.0-327.4.5.el7 will be updated ---> Package kernel-tools.x86_64 0:3.10.0-327.13.1.el7 will be an update ---> Package kernel-tools-libs.x86_64 0:3.10.0-327.4.5.el7 will be updated ---> Package kernel-tools-libs.x86_64 0:3.10.0-327.13.1.el7 will be an update ---> Package kexec-tools.x86_64 0:2.0.7-19.el7_1.2 will be updated ---> Package kexec-tools.x86_64 0:2.0.7-38.el7 will be updated ---> Package kexec-tools.x86_64 0:2.0.7-38.el7_2.1 will be an update ---> Package kpartx.x86_64 0:0.4.9-85.el7 will be updated ---> Package kpartx.x86_64 0:0.4.9-85.el7_2.1 will be an update ---> Package krb5-libs.x86_64 0:1.13.2-10.el7 will be updated ---> Package krb5-libs.x86_64 0:1.13.2-12.el7_2 will be an update ---> Package libblkid.x86_64 0:2.23.2-26.el7 will be updated ---> Package libblkid.x86_64 0:2.23.2-26.el7_2.2 will be an update ---> Package libgudev1.x86_64 0:219-19.el7 will be updated ---> Package libgudev1.x86_64 0:219-19.el7_2.7 will be an update ---> Package libmount.x86_64 0:2.23.2-26.el7 will be updated ---> Package libmount.x86_64 0:2.23.2-26.el7_2.2 will be an update ---> Package libssh2.x86_64 0:1.4.3-10.el7 will be updated ---> Package libssh2.x86_64 0:1.4.3-10.el7_2.1 will be an update ---> Package libteam.x86_64 0:1.17-5.el7 will be updated ---> Package libteam.x86_64 0:1.17-6.el7_2 will be an update ---> Package libuuid.x86_64 0:2.23.2-26.el7 will be updated ---> Package libuuid.x86_64 0:2.23.2-26.el7_2.2 will be an update ---> Package mariadb-libs.x86_64 1:5.5.44-2.el7.centos will be updated ---> Package mariadb-libs.x86_64 1:5.5.47-1.el7_2 will be an update ---> Package nss-util.x86_64 0:3.19.1-4.el7_1 will be updated ---> Package nss-util.x86_64 0:3.19.1-9.el7_2 will be an update ---> Package numactl-libs.x86_64 0:2.0.9-5.el7_1 will be updated ---> Package numactl-libs.x86_64 0:2.0.9-6.el7_2 will be an update ---> Package openldap.x86_64 0:2.4.40-8.el7 will be updated ---> Package openldap.x86_64 0:2.4.40-9.el7_2 will be an update ---> Package openssh.x86_64 0:6.6.1p1-23.el7_2 will be updated ---> Package openssh.x86_64 0:6.6.1p1-25.el7_2 will be an update ---> Package openssh-clients.x86_64 0:6.6.1p1-23.el7_2 will be updated ---> Package openssh-clients.x86_64 0:6.6.1p1-25.el7_2 will be an update ---> Package openssh-server.x86_64 0:6.6.1p1-12.el7_1 will be updated ---> Package openssh-server.x86_64 0:6.6.1p1-25.el7_2 will be an update ---> Package openssl.x86_64 1:1.0.1e-51.el7_2.2 will be updated ---> Package openssl.x86_64 1:1.0.1e-51.el7_2.4 will be an update ---> Package openssl-libs.x86_64 1:1.0.1e-51.el7_2.2 will be updated ---> Package openssl-libs.x86_64 1:1.0.1e-51.el7_2.4 will be an update ---> Package polkit.x86_64 0:0.112-5.el7 will be updated ---> Package polkit.x86_64 0:0.112-6.el7_2 will be an update ---> Package procps-ng.x86_64 0:3.3.10-3.el7 will be updated ---> Package procps-ng.x86_64 0:3.3.10-5.el7_2 will be an update ---> Package python-boto.noarch 0:2.38.0-2.el7 will be obsoleted ---> Package python-perf.x86_64 0:3.10.0-327.4.5.el7 will be updated ---> Package python-perf.x86_64 0:3.10.0-327.13.1.el7 will be an update ---> Package python-pyudev.noarch 0:0.15-7.el7 will be updated ---> Package python-pyudev.noarch 0:0.15-7.el7_2.1 will be an update ---> Package python2-boto.noarch 0:2.39.0-1.el7 will be obsoleting ---> Package screen.x86_64 0:4.1.0-0.19.20120314git3c2946.el7 will be updated ---> Package screen.x86_64 0:4.1.0-0.23.20120314git3c2946.el7_2 will be an update ---> Package selinux-policy.noarch 0:3.13.1-60.el7 will be updated ---> Package selinux-policy.noarch 0:3.13.1-60.el7_2.3 will be an update ---> Package selinux-policy-targeted.noarch 0:3.13.1-23.el7_1.21 will be updated ---> Package selinux-policy-targeted.noarch 0:3.13.1-60.el7_2.3 will be an update ---> Package sudo.x86_64 0:1.8.6p7-16.el7 will be updated ---> Package sudo.x86_64 0:1.8.6p7-17.el7_2 will be an update ---> Package systemd.x86_64 0:208-20.el7_1.6 will be updated ---> Package systemd.x86_64 0:219-19.el7 will be updated ---> Package systemd.x86_64 0:219-19.el7_2.7 will be an update ---> Package systemd-libs.x86_64 0:219-19.el7 will be updated ---> Package systemd-libs.x86_64 0:219-19.el7_2.7 will be an update ---> Package systemd-python.x86_64 0:219-19.el7 will be updated ---> Package systemd-python.x86_64 0:219-19.el7_2.7 will be an update ---> Package systemd-sysv.x86_64 0:219-19.el7 will be updated ---> Package systemd-sysv.x86_64 0:219-19.el7_2.7 will be an update ---> Package teamd.x86_64 0:1.17-5.el7 will be updated ---> Package teamd.x86_64 0:1.17-6.el7_2 will be an update ---> Package topbeat.x86_64 0:1.1.0-1 will be updated ---> Package topbeat.x86_64 0:1.2.1-1 will be an update ---> Package tuned.noarch 0:2.4.1-1.el7 will be updated ---> Package tuned.noarch 0:2.5.1-4.el7_2.1 will be updated ---> Package tuned.noarch 0:2.5.1-4.el7_2.3 will be an update ---> Package tzdata.noarch 0:2015g-1.el7 will be updated ---> Package tzdata.noarch 0:2016c-1.el7 will be an update ---> Package util-linux.x86_64 0:2.23.2-26.el7 will be updated ---> Package util-linux.x86_64 0:2.23.2-26.el7_2.2 will be an update --> Running transaction check ---> Package bluez-libs.x86_64 0:5.23-4.el7 will be installed --> Finished Dependency Resolution --> Running transaction check ---> Package kernel.x86_64 0:3.10.0-229.7.2.el7 will be erased ---> Package kernel.x86_64 0:3.10.0-229.11.1.el7 will be erased --> Finished Dependency Resolution Dependencies Resolved