Regular system maintenance is necessary to make the system healthy and function properly and It’s common for all the operating systems not only for Linux systems.
There is no specific schedule for Linux package update but windows has a scheduled one. Hence we need to perform the package update at least once in a month.
In the worst cases at least once in a quarter.It would be fix for some of the outstanding issues if you install the available updates on your system.
So, I would suggest you to have a schedule based on your infrastructure.
Also remember, when you plan for patching, Are you going to perform the full patch (It’s including security, bug fixes and enhancement)? or only security? or security and bug fix?
As per my knowledge and experience most of the IT companies are installing only security patches which is necessary to make the environment more stable and secure.
But some times they will patch bug fixes as well when they had an issue with the current package.
Now we are gonna see how to list available packages updates in Linux distributions. Let’s move one by one distributions. I’m going to show you all the major distributions like RHEL, CentOS, Fedora, Arch Linux, Debian, Ubuntu and openSUSE.
Package manager is playing a major role in this activity so, we should have hands on experience in the package management tool.
Below are the famous package managers for Linux.
- YUM Package Manager
- DNF Package Manager
- APT Package Manager
- APT-GET Package Manager
- Zypper Package Manager
- Pacman Package Manager
- RPM Package Manager
- DPKG Package Manager
1) How to list available package updates in CentOS/RHEL 6/7 Systems
RHEL6/7 and CentOS6/7 systems are using YUM package manager hence we can use the Yum Package Manager
to get this information.
This can be done using the below three commands.
yum check-update
yum check-update command returns a list of the packages to be updated in list format.yum list updates
yum list updates command is similar to yum check-update and returns a list of the packages to be updated in list format.yum update
yum update command will update currently installed packages to latest version if package update is available.
Method-1: Using yum check-update Command
yum check-update command returns a list of the packages to be updated in list format.
# yum check-update Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile epel/metalink | 19 kB 00:00 * epel: ewr.edge.kernel.org base | 3.7 kB 00:00 centos-sclo-sclo | 2.9 kB 00:00 epel | 3.2 kB 00:00 epel/primary | 3.2 MB 00:00 epel 12518/12518 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 1.2 MB 00:00 ... abrt.x86_64 2.0.8-44.el6.centos base abrt-addon-ccpp.x86_64 2.0.8-44.el6.centos base abrt-addon-kerneloops.x86_64 2.0.8-44.el6.centos base abrt-addon-python.x86_64 2.0.8-44.el6.centos base abrt-cli.x86_64 2.0.8-44.el6.centos base abrt-libs.x86_64 2.0.8-44.el6.centos base abrt-python.x86_64 2.0.8-44.el6.centos base abrt-tui.x86_64 2.0.8-44.el6.centos base bind-libs.x86_64 32:9.8.2-0.68.rc1.el6 base bind-utils.x86_64 32:9.8.2-0.68.rc1.el6 base binutils.x86_64 2.20.51.0.2-5.48.el6 base ca-certificates.noarch 2018.2.22-65.1.el6 base centos-release.x86_64 6-10.el6.centos.12.3 base coreutils.x86_64 8.4-47.el6 base coreutils-libs.x86_64 8.4-47.el6 base cpp.x86_64 4.4.7-23.el6 base dbus.x86_64 1:1.2.24-9.el6 base dbus-libs.x86_64 1:1.2.24-9.el6 base device-mapper-persistent-data.x86_64 0.6.2-0.2.rc7.el6 base dhclient.x86_64 12:4.1.1-61.P1.el6.centos updates dhcp-common.x86_64 12:4.1.1-61.P1.el6.centos updates
If you would like to know about number of packages to be updated, use the following format.
# yum check-update | wc -l 103
Method-2: Using yum list updates Command
yum list updates command is similar to yum check-update and returns a list of the packages to be updated in list format.
# yum list updates Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * epel: ewr.edge.kernel.org Updated Packages abrt.x86_64 2.0.8-44.el6.centos base abrt-addon-ccpp.x86_64 2.0.8-44.el6.centos base abrt-addon-kerneloops.x86_64 2.0.8-44.el6.centos base abrt-addon-python.x86_64 2.0.8-44.el6.centos base abrt-cli.x86_64 2.0.8-44.el6.centos base abrt-libs.x86_64 2.0.8-44.el6.centos base abrt-python.x86_64 2.0.8-44.el6.centos base abrt-tui.x86_64 2.0.8-44.el6.centos base bind-libs.x86_64 32:9.8.2-0.68.rc1.el6 base bind-utils.x86_64 32:9.8.2-0.68.rc1.el6 base binutils.x86_64 2.20.51.0.2-5.48.el6 base ca-certificates.noarch 2018.2.22-65.1.el6 base centos-release.x86_64 6-10.el6.centos.12.3 base coreutils.x86_64 8.4-47.el6 base coreutils-libs.x86_64 8.4-47.el6 base cpp.x86_64 4.4.7-23.el6 base dbus.x86_64 1:1.2.24-9.el6 base dbus-libs.x86_64 1:1.2.24-9.el6 base device-mapper-persistent-data.x86_64 0.6.2-0.2.rc7.el6 base dhclient.x86_64 12:4.1.1-61.P1.el6.centos updates dhcp-common.x86_64 12:4.1.1-61.P1.el6.centos updates
If you would like to know about number of packages to be updated, use the following format.
# yum list updates | wc -l 103
Method-3: Using yum update Command
yum update command will update currently installed packages to latest version if package update is available.
We generally use yum update command to update the system packages to latest version but this can be used to get the list of packages to be updated as well with more detailed information compared with above commands.
This command will show you the additional details like number of packages to be updated, to be installed, packages download size and repository information.
# yum update Loaded plugins: fastestmirror, security Setting up Update Process Loading mirror speeds from cached hostfile * epel: ewr.edge.kernel.org Resolving Dependencies --> Running transaction check ---> Package abrt.x86_64 0:2.0.8-43.el6.centos will be updated ---> Package abrt.x86_64 0:2.0.8-44.el6.centos will be an update ---> Package abrt-addon-ccpp.x86_64 0:2.0.8-43.el6.centos will be updated ---> Package abrt-addon-ccpp.x86_64 0:2.0.8-44.el6.centos will be an update ---> Package abrt-addon-kerneloops.x86_64 0:2.0.8-43.el6.centos will be updated ---> Package abrt-addon-kerneloops.x86_64 0:2.0.8-44.el6.centos will be an update . . ---> Package yum-plugin-security.noarch 0:1.1.30-42.el6_10 will be an update ---> Package yum-utils.noarch 0:1.1.30-40.el6 will be updated ---> Package yum-utils.noarch 0:1.1.30-42.el6_10 will be an update --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================================= Package Arch Version Repository Size ============================================================================================================================================================================================= Installing: kernel x86_64 2.6.32-754.3.5.el6 updates 32 M Updating: abrt x86_64 2.0.8-44.el6.centos base 229 k abrt-addon-ccpp x86_64 2.0.8-44.el6.centos base 124 k abrt-addon-kerneloops x86_64 2.0.8-44.el6.centos base 71 k abrt-addon-python x86_64 2.0.8-44.el6.centos base 68 k abrt-cli x86_64 2.0.8-44.el6.centos base 58 k abrt-libs x86_64 2.0.8-44.el6.centos base 70 k abrt-python x86_64 2.0.8-44.el6.centos base 74 k abrt-tui x86_64 2.0.8-44.el6.centos base 66 k bind-libs x86_64 32:9.8.2-0.68.rc1.el6 base 892 k bind-utils x86_64 32:9.8.2-0.68.rc1.el6 base 189 k binutils x86_64 2.20.51.0.2-5.48.el6 base 2.8 M . . sos noarch 3.2-63.el6.centos.2 updates 326 k systemtap-runtime x86_64 2.9-9.el6 base 206 k tzdata noarch 2018e-3.el6 base 495 k tzdata-java noarch 2018e-3.el6 base 185 k upstart x86_64 0.6.5-17.el6 base 177 k xorg-x11-drv-ati-firmware noarch 7.6.1-4.el6 base 1.2 M yum-plugin-fastestmirror noarch 1.1.30-42.el6_10 updates 33 k yum-plugin-security noarch 1.1.30-42.el6_10 updates 43 k yum-utils noarch 1.1.30-42.el6_10 updates 114 k Transaction Summary ============================================================================================================================================================================================= Install 1 Package(s) Upgrade 98 Package(s) Total download size: 190 M Is this ok [y/N]: n Exiting on user Command Your transaction was saved, rerun it with: yum load-transaction /tmp/yum_save_tx-2018-08-18-10-41obLDvp.yumtx
Use the below command to check whether update is available for particular package or not? Yes I could see that sos package having an update.
# yum list updates sos Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * epel: ewr.edge.kernel.org Updated Packages sos.noarch 3.2-63.el6.centos.2 updates
Since there is no update available for nano package that’s why i’m getting the below error.
# yum list updates nano Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * epel: ewr.edge.kernel.org Error: No matching Packages to list
2) How to view available package updates in CentOS 8, RHEL 8 and Fedora System
CentOS 8, RHEL 8 and Fedora system uses DNF package manager hence we can use the Dnf Package Manager
to get this information.
This can be done using the below four commands.
dnf check-update
dnf check-update command returns a list of the packages to be updated in list format.dnf list updates
yum list updates command is similar to yum check-update and returns a list of the packages to be updated in list format.dnf update
dnf update command will update currently installed packages to latest version if package update is available.dnf updateinfo
dnf updateinfo command displays just counts of advisory types.
Method-1: Using yum check-update Command
dnf check-update command returns a list of the packages to be updated in list format.
# dnf check-update Last metadata expiration check: 0:01:06 ago on Sun 19 Aug 2018 04:14:00 PM IST. GeoIP-GeoLite-data.noarch 2018.04-1.fc26 updates GraphicsMagick.x86_64 1.3.29-1.fc26 updates ImageMagick.x86_64 6.9.9.38-1.fc26 updates ImageMagick-libs.x86_64 6.9.9.38-1.fc26 updates ImageMagick-perl.x86_64 6.9.9.38-1.fc26 updates LibRaw.x86_64 0.18.11-1.fc26 updates appstream-data.noarch 26-18.fc26 updates autocorr-en.noarch 1:5.3.7.2-9.fc26 updates boost.x86_64 1.63.0-12.fc26 updates boost-atomic.x86_64 1.63.0-12.fc26 updates boost-chrono.x86_64 1.63.0-12.fc26 updates boost-container.x86_64 1.63.0-12.fc26 updates
Method-2: Using dnf list updates Command
dnf list updates command is similar to yum check-update and returns a list of the packages to be updated in list format.
# dnf list updates Last metadata expiration check: 0:01:06 ago on Sun 19 Aug 2018 04:14:00 PM IST. GeoIP-GeoLite-data.noarch 2018.04-1.fc26 updates GraphicsMagick.x86_64 1.3.29-1.fc26 updates ImageMagick.x86_64 6.9.9.38-1.fc26 updates ImageMagick-libs.x86_64 6.9.9.38-1.fc26 updates ImageMagick-perl.x86_64 6.9.9.38-1.fc26 updates LibRaw.x86_64 0.18.11-1.fc26 updates appstream-data.noarch 26-18.fc26 updates autocorr-en.noarch 1:5.3.7.2-9.fc26 updates boost.x86_64 1.63.0-12.fc26 updates boost-atomic.x86_64 1.63.0-12.fc26 updates boost-chrono.x86_64 1.63.0-12.fc26 updates boost-container.x86_64 1.63.0-12.fc26 updates
Method-3: Using dnf update Command
dnf update command will update currently installed packages to latest version if package update is available.
# dnf update Last metadata expiration check: 0:05:22 ago on Sun 19 Aug 2018 04:14:00 PM IST. Dependencies resolved. =================================================================================================================================================================================================================== Package Arch Version Repository Size =================================================================================================================================================================================================================== Installing: kernel x86_64 4.16.11-100.fc26 updates 74 k kernel-core x86_64 4.16.11-100.fc26 updates 23 M kernel-debug-devel x86_64 4.16.11-100.fc26 updates 12 M kernel-modules x86_64 4.16.11-100.fc26 updates 27 M kernel-modules-extra x86_64 4.16.11-100.fc26 updates 2.2 M Upgrading: GeoIP-GeoLite-data noarch 2018.04-1.fc26 updates 551 k GraphicsMagick x86_64 1.3.29-1.fc26 updates 1.5 M ImageMagick x86_64 6.9.9.38-1.fc26 updates 183 k ImageMagick-libs x86_64 6.9.9.38-1.fc26 updates 2.2 M ImageMagick-perl x86_64 6.9.9.38-1.fc26 updates 167 k LibRaw x86_64 0.18.11-1.fc26 updates 349 k appstream-data noarch 26-18.fc26 updates 14 M autocorr-en noarch 1:5.3.7.2-9.fc26 updates 208 k boost x86_64 1.63.0-12.fc26 updates 48 k . . webkitgtk4 x86_64 2.20.2-1.fc26 updates 13 M webkitgtk4-jsc x86_64 2.20.2-1.fc26 updates 4.6 M webkitgtk4-plugin-process-gtk2 x86_64 2.20.2-1.fc26 updates 10 M wget x86_64 1.19.5-1.fc26 updates 725 k xdg-utils noarch 1.1.3-1.fc26 updates 83 k xen-libs x86_64 4.8.3-5.fc26 updates 657 k xen-licenses x86_64 4.8.3-5.fc26 updates 118 k Removing: kernel x86_64 4.12.14-300.fc26 @updates 0 kernel-core x86_64 4.12.14-300.fc26 @updates 54 M kernel-debug-devel x86_64 4.12.14-300.fc26 @updates 43 M kernel-modules x86_64 4.12.14-300.fc26 @updates 23 M kernel-modules-extra x86_64 4.12.14-300.fc26 @updates 2.0 M Transaction Summary =================================================================================================================================================================================================================== Install 5 Packages Upgrade 280 Packages Remove 5 Packages Total download size: 687 M Is this ok [y/N]: n Operation aborted.
Method-4: Using dnf updateinfo Command
dnf updateinfo command displays just counts of advisory types. If you want to know more information on these use the appropriate options.
# dnf updateinfo Last metadata expiration check: 0:00:00 ago on Sun 19 Aug 2018 04:14:00 PM IST. Updates Information Summary: available 28 Security notice(s) 2 Critical Security notice(s) 2 Important Security notice(s) 8 Moderate Security notice(s) 5 Low Security notice(s) 47 Bugfix notice(s) 21 Enhancement notice(s)
3) How to check available package updates in Arch Linux Systems
Arch Linux based systems are using pacman package manager hence we can use the pacman Package Manager
to get this information.
pacman stands for package manager utility (pacman). pacman is a command-line utility to install, build, remove and manage Arch Linux packages. pacman uses libalpm (Arch Linux Package Management (ALPM) library) as a back-end to perform all the actions.
pacman -Qu command query and filter the packages that are out-of-date on the local system.
# pacman -Qu json-glib 1.2.8-1 -> 1.4.2-2 jsoncpp 1.8.1-1 -> 1.8.4-2 keyutils 1.5.10-1 -> 1.5.10-2 kidletime 5.37.0-1 -> 5.49.0-1 kmod 24-1 -> 25-1 krb5 1.15.1-1 -> 1.16.1-1 kwayland 5.37.0-1 -> 5.49.0-1 kwindowsystem 5.37.0-1 -> 5.49.0-1 lame 3.99.5-3 -> 3.100-2 lcms2 2.8-2 -> 2.9-1 less 487-1 -> 530-1 libaio 0.3.110-1 -> 0.3.111-1 libarchive 3.3.2-1 -> 3.3.2-2 libass 0.13.7-1 -> 0.14.0-1 libassuan 2.4.3-1 -> 2.5.1-1 libatasmart 0.19-3 -> 0.19-4 libatomic_ops 7.4.6-1 -> 7.6.6-1 libblockdev 2.10-1 -> 2.19-1 libbluray 1.0.1-1 -> 1.0.2-1
If you would like to know about number of packages to be updated, use the following format.
# pacman -Qu | wc -l 475
Alternatively this can be done using the below command format.
# pacman -Syu :: Synchronizing package databases... testing is up to date core is up to date extra is up to date community is up to date multilib is up to date archlinuxfr is up to date :: Starting full system upgrade... Packages (548) acl-2.2.53-1 adwaita-icon-theme-3.28.0-1 alsa-lib-1.1.6-1 aom-1.0.0-1 archlinux-keyring-20180808-1 argon2-20171227-3 at-spi2-atk-2.26.2-1 at-spi2-core-2.28.0-1 atk-2.28.1-1 attr-2.4.48-1 avahi-0.7+16+g1cc2b8e-2 bash-4.4.023-1 binutils-2.31.1-3 bison-3.0.5-1 btrfs-progs-4.17.1-1 bzip2-1.0.6-7 ca-certificates-mozilla-3.38-1 cairo-1.15.12-1 cantarell-fonts-1:0.101-1 cmake-3.11.4-2 colord-1.4.3-2 compositeproto-0.4.2-3 [removal] coreutils-8.30-1 cryptsetup-2.0.4-1 curl-7.61.0-2 damageproto-1.2.1-3 [removal] db-5.3.28-4 dbus-1.12.10-1 dbus-glib-0.110-1 dconf-0.28.0-1 desktop-file-utils-0.23+4+g92af410-1 device-mapper-2.02.181-1 dhcpcd-7.0.7-1 dmraid-1.0.0.rc16.3-11 dmxproto-2.3.1-3 [removal] dri2proto-2.8-2 [removal] dri3proto-1.0-1 [removal] e2fsprogs-1.44.3-1 exo-0.12.2-1 expat-2.2.5-1 fakeroot-1.23-1 ffmpeg-1:4.0.2-2 figlet-2.2.5-3 file-5.34-1 filesystem-2018.1-2 firefox-61.0.2-1 Total Download Size: 679.43 MiB Total Installed Size: 2816.48 MiB Net Upgrade Size: 394.96 MiB :: Proceed with installation? [Y/n]
4) How to find available package updates in openSUSE System
openSUSE system uses zypper package manager hence we can use the zypper Package Manager
to get this information.
Method-1: Using zypper list-updates Command
zypper list-updates command returns a list of the packages to be updated in list format.
# zypper list-updates Loading repository data... Warning: Repository 'Update Repository (Non-Oss)' appears to be outdated. Consider using a different mirror or server. Warning: Repository 'Main Update Repository' appears to be outdated. Consider using a different mirror or server. Reading installed packages... S | Repository | Name | Current Version | Available Version | Arch --+------------------------+----------------------------------+-----------------------------------+---------------------------------------+------- v | Main Update Repository | ImageMagick | 6.8.8.1-30.6.1 | 6.8.8.1-30.21.1 | x86_64 v | Main Update Repository | MozillaFirefox | 52.4.0-57.18.2 | 52.6-57.30.1 | x86_64 v | Main Update Repository | MozillaThunderbird | 52.4.0-41.18.1 | 52.5.2-41.24.1 | x86_64 v | Main Update Repository | SuSEfirewall2 | 3.6.312-5.6.1 | 3.6.312-5.12.1 | noarch v | Main Update Repository | apparmor-abstractions | 2.10.2-12.3.1 | 2.10.3-12.6.1 | noarch v | Main Update Repository | apparmor-docs | 2.10.2-12.3.1 | 2.10.3-12.6.1 | noarch v | Main Update Repository | apparmor-parser | 2.10.2-12.3.1 | 2.10.3-12.6.1 | x86_64 v | Main Update Repository | apparmor-profiles | 2.10.2-12.3.1 | 2.10.3-12.6.1 | noarch v | Main Update Repository | apparmor-utils | 2.10.2-12.3.1 | 2.10.3-12.6.1 | noarch . .
Method-2: Using zypper update Command
zypper update command will update currently installed packages to latest version if package update is available.
# zypper update Loading repository data... Warning: Repository 'Update Repository (Non-Oss)' appears to be outdated. Consider using a different mirror or server. Warning: Repository 'Main Update Repository' appears to be outdated. Consider using a different mirror or server. Reading installed packages... The following package is going to be REMOVED: gimp-help-browser The following package is going to be upgraded: gimp 1 package to upgrade, 1 to remove. Overall download size: 6.9 MiB. Already cached: 0 B. After the operation, 3.6 MiB will be freed. Continue? [y/n/...? shows all options] (y): y Retrieving package gimp-2.8.18-2.6.2.x86_64 (1/1), 6.9 MiB ( 28.1 MiB unpacked) Retrieving delta: ./x86_64/gimp-2.8.18-2.3.1_2.6.2.x86_64.drpm, 682.7 KiB Retrieving: gimp-2.8.18-2.3.1_2.6.2.x86_64.drpm ...........................................................................................................................[done (49.2 KiB/s)] Applying delta: ./gimp-2.8.18-2.3.1_2.6.2.x86_64.drpm ..................................................................................................................................[done] Checking for file conflicts: ...........................................................................................................................................................[done] (1/1) Installing: gimp-2.8.18-2.6.2.x86_64 .............................................................................................................................................[done] There are some running programs that might use files deleted by recent upgrade. You may wish to check and restart some of them. Run 'zypper ps -s' to list these programs.
5) How to list available package updates in Debian based Systems
Debian based systems are using APT/APT-GET package manager hence we can use the APT/APT-GET Package Manager
to get this information.
APT stands for Advanced Packaging Tool (APT) which is replacement for apt-get, like how DNF came to picture instead of YUM. It’s feature rich command-line tools with included all the futures in one command (APT) such as apt-cache, apt-search, dpkg, apt-cdrom, apt-config, apt-key, etc..,. and several other unique features. For example we can easily install .dpkg packages through APT but we can’t do through Apt-Get similar more features are included into APT command. APT-GET replaced by APT Due to lock of futures missing in apt-get which was not solved.
This can be done using the below five commands.
apt list --upgradable
apt list –upgradable command returns a list of the packages to be updated in list format.apt-get upgrade --dry-run
apt-get upgrade –dry-run command returns a list of the packages to be updated in list format.apt-get -s upgrade
apt-get -s upgrade command returns a list of the packages to be updated in list format.apt upgrade
apt upgrade command will update currently installed packages to latest version if package update is available.apt-get upgrade
apt-get upgrade command will update currently installed packages to latest version if package update is available.
Method-1: Using apt list –upgradable Command
apt list –upgradable command returns a list of the packages to be updated in list format.
# apt list --upgradable Listing... Done apache2/artful-updates 2.4.27-2ubuntu4.2 amd64 [upgradable from: 2.4.27-2ubuntu4.1] apache2-bin/artful-updates 2.4.27-2ubuntu4.2 amd64 [upgradable from: 2.4.27-2ubuntu4.1] apache2-data/artful-updates,artful-updates 2.4.27-2ubuntu4.2 all [upgradable from: 2.4.27-2ubuntu4.1] apache2-utils/artful-updates 2.4.27-2ubuntu4.2 amd64 [upgradable from: 2.4.27-2ubuntu4.1] apt/artful-updates 1.5.2 amd64 [upgradable from: 1.5.1] apt-transport-https/artful-updates 1.5.2 amd64 [upgradable from: 1.5.1] apt-utils/artful-updates 1.5.2 amd64 [upgradable from: 1.5.1] avahi-autoipd/artful-updates 0.6.32-1ubuntu1.1 amd64 [upgradable from: 0.6.32-1ubuntu1] avahi-daemon/artful-updates 0.6.32-1ubuntu1.1 amd64 [upgradable from: 0.6.32-1ubuntu1] avahi-utils/artful-updates 0.6.32-1ubuntu1.1 amd64 [upgradable from: 0.6.32-1ubuntu1] bsdutils/artful-updates 1:2.30.1-0ubuntu4.2 amd64 [upgradable from: 1:2.30.1-0ubuntu4.1] desktop-file-utils/artful-updates 0.23-1ubuntu3.17.10.1 amd64 [upgradable from: 0.23-1ubuntu3]
If you would like to know about number of packages to be updated, use the following format.
# apt list --upgradable | wc -l 89
Method-2: Using apt-get upgrade –dry-run Command
apt-get upgrade –dry-run command returns a list of the packages to be updated in list format.
# apt-get upgrade --dry-run Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: linux-headers-4.13.0-38 linux-headers-4.13.0-38-generic linux-headers-4.13.0-39 linux-headers-4.13.0-39-generic linux-headers-4.13.0-43 linux-headers-4.13.0-43-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-43-generic linux-image-extra-4.13.0-38-generic linux-image-extra-4.13.0-39-generic linux-image-extra-4.13.0-43-generic Use 'sudo apt autoremove' to remove them. The following packages will be upgraded: apache2 apache2-bin apache2-data apache2-utils apt apt-transport-https apt-utils avahi-autoipd avahi-daemon avahi-utils bsdutils desktop-file-utils docker-ce fdisk fonts-opensymbol google-chrome-stable hdparm ifupdown libapt-inst2.0 libapt-pkg5.0 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-core7 libavahi-glib1 libavahi-ui-gtk3-0 libblkid1 libfdisk1 libmount1 libnss-myhostname libpam-modules libpam-modules-bin libpam-runtime libpam-systemd libpam0g libplymouth4 libpython3-dev libpython3-stdlib libreoffice-avmedia-backend-gstreamer libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk3 libreoffice-help-en-us libreoffice-impress libreoffice-math libreoffice-ogltrans libreoffice-pdfimport libreoffice-style-breeze libreoffice-style-elementary libreoffice-style-galaxy libreoffice-style-papirus libreoffice-style-tango libreoffice-writer libsmartcols1 libsystemd0 libudev1 libuuid1 lshw mount notepadqq notepadqq-common nplan papirus-icon-theme plymouth plymouth-label plymouth-theme-ubuntu-logo plymouth-theme-ubuntu-text python3 python3-dev python3-minimal python3-uno python3-update-manager snapd systemd systemd-sysv udev uno-libs3 update-manager update-manager-core update-notifier update-notifier-common ure util-linux uuid-runtime 88 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Inst bsdutils [1:2.30.1-0ubuntu4.1] (1:2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Conf bsdutils (1:2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Inst libuuid1 [2.30.1-0ubuntu4.1] (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Conf libuuid1 (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Inst libblkid1 [2.30.1-0ubuntu4.1] (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Conf libblkid1 (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Inst libfdisk1 [2.30.1-0ubuntu4.1] (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Conf libfdisk1 (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Inst libmount1 [2.30.1-0ubuntu4.1] (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Conf libmount1 (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Inst libsmartcols1 [2.30.1-0ubuntu4.1] (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64])
Method-3: Using apt-get -s upgrade Command
apt-get -s upgrade command returns a list of the packages to be updated in list format.
# apt-get -s upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: linux-headers-4.13.0-38 linux-headers-4.13.0-38-generic linux-headers-4.13.0-39 linux-headers-4.13.0-39-generic linux-headers-4.13.0-43 linux-headers-4.13.0-43-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-43-generic linux-image-extra-4.13.0-38-generic linux-image-extra-4.13.0-39-generic linux-image-extra-4.13.0-43-generic Use 'sudo apt autoremove' to remove them. The following packages will be upgraded: apache2 apache2-bin apache2-data apache2-utils apt apt-transport-https apt-utils avahi-autoipd avahi-daemon avahi-utils bsdutils desktop-file-utils docker-ce fdisk fonts-opensymbol google-chrome-stable hdparm ifupdown libapt-inst2.0 libapt-pkg5.0 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-core7 libavahi-glib1 libavahi-ui-gtk3-0 libblkid1 libfdisk1 libmount1 libnss-myhostname libpam-modules libpam-modules-bin libpam-runtime libpam-systemd libpam0g libplymouth4 libpython3-dev libpython3-stdlib libreoffice-avmedia-backend-gstreamer libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk3 libreoffice-help-en-us libreoffice-impress libreoffice-math libreoffice-ogltrans libreoffice-pdfimport libreoffice-style-breeze libreoffice-style-elementary libreoffice-style-galaxy libreoffice-style-papirus libreoffice-style-tango libreoffice-writer libsmartcols1 libsystemd0 libudev1 libuuid1 lshw mount notepadqq notepadqq-common nplan papirus-icon-theme plymouth plymouth-label plymouth-theme-ubuntu-logo plymouth-theme-ubuntu-text python3 python3-dev python3-minimal python3-uno python3-update-manager snapd systemd systemd-sysv udev uno-libs3 update-manager update-manager-core update-notifier update-notifier-common ure util-linux uuid-runtime 88 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Inst bsdutils [1:2.30.1-0ubuntu4.1] (1:2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Conf bsdutils (1:2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Inst libuuid1 [2.30.1-0ubuntu4.1] (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Conf libuuid1 (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Inst libblkid1 [2.30.1-0ubuntu4.1] (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Conf libblkid1 (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Inst libfdisk1 [2.30.1-0ubuntu4.1] (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Conf libfdisk1 (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64]) Inst libmount1 [2.30.1-0ubuntu4.1] (2.30.1-0ubuntu4.2 Ubuntu:17.10/artful-updates [amd64])
Method-4: Using apt upgrade Command
apt upgrade command will update currently installed packages to latest version if package update is available.
# apt upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: linux-headers-4.13.0-38 linux-headers-4.13.0-38-generic linux-headers-4.13.0-39 linux-headers-4.13.0-39-generic linux-headers-4.13.0-43 linux-headers-4.13.0-43-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-43-generic linux-image-extra-4.13.0-38-generic linux-image-extra-4.13.0-39-generic linux-image-extra-4.13.0-43-generic Use 'sudo apt autoremove' to remove them. The following packages will be upgraded: apache2 apache2-bin apache2-data apache2-utils apt apt-transport-https apt-utils avahi-autoipd avahi-daemon avahi-utils bsdutils desktop-file-utils docker-ce fdisk fonts-opensymbol google-chrome-stable hdparm ifupdown libapt-inst2.0 libapt-pkg5.0 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-core7 libavahi-glib1 libavahi-ui-gtk3-0 libblkid1 libfdisk1 libmount1 libnss-myhostname libpam-modules libpam-modules-bin libpam-runtime libpam-systemd libpam0g libplymouth4 libpython3-dev libpython3-stdlib libreoffice-avmedia-backend-gstreamer libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk3 libreoffice-help-en-us libreoffice-impress libreoffice-math libreoffice-ogltrans libreoffice-pdfimport libreoffice-style-breeze libreoffice-style-elementary libreoffice-style-galaxy libreoffice-style-tango libreoffice-writer libsmartcols1 libsystemd0 libudev1 libuuid1 lshw mount notepadqq notepadqq-common nplan plymouth plymouth-label plymouth-theme-ubuntu-logo plymouth-theme-ubuntu-text python3 python3-dev python3-minimal python3-uno python3-update-manager snapd systemd systemd-sysv udev uno-libs3 update-manager update-manager-core update-notifier update-notifier-common ure util-linux uuid-runtime 86 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/201 MB of archives. After this operation, 26.5 MB of additional disk space will be used. Do you want to continue? [Y/n] n Abort.
Method-5: Using apt-get upgrade Command
apt-get upgrade command will update currently installed packages to latest version if package update is available.
# apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: linux-headers-4.13.0-38 linux-headers-4.13.0-38-generic linux-headers-4.13.0-39 linux-headers-4.13.0-39-generic linux-headers-4.13.0-43 linux-headers-4.13.0-43-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-43-generic linux-image-extra-4.13.0-38-generic linux-image-extra-4.13.0-39-generic linux-image-extra-4.13.0-43-generic Use 'sudo apt autoremove' to remove them. The following packages will be upgraded: apache2 apache2-bin apache2-data apache2-utils apt apt-transport-https apt-utils avahi-autoipd avahi-daemon avahi-utils bsdutils desktop-file-utils docker-ce fdisk fonts-opensymbol google-chrome-stable hdparm ifupdown libapt-inst2.0 libapt-pkg5.0 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-core7 libavahi-glib1 libavahi-ui-gtk3-0 libblkid1 libfdisk1 libmount1 libnss-myhostname libpam-modules libpam-modules-bin libpam-runtime libpam-systemd libpam0g libplymouth4 libpython3-dev libpython3-stdlib libreoffice-avmedia-backend-gstreamer libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk3 libreoffice-help-en-us libreoffice-impress libreoffice-math libreoffice-ogltrans libreoffice-pdfimport libreoffice-style-breeze libreoffice-style-elementary libreoffice-style-galaxy libreoffice-style-tango libreoffice-writer libsmartcols1 libsystemd0 libudev1 libuuid1 lshw mount notepadqq notepadqq-common nplan plymouth plymouth-label plymouth-theme-ubuntu-logo plymouth-theme-ubuntu-text python3 python3-dev python3-minimal python3-uno python3-update-manager snapd systemd systemd-sysv udev uno-libs3 update-manager update-manager-core update-notifier update-notifier-common ure util-linux uuid-runtime 86 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/201 MB of archives. After this operation, 26.5 MB of additional disk space will be used. Do you want to continue? [Y/n] n Abort.
Alternatively, use the following apt-check command to view the number of packages to be upgraded in the system.
# /usr/lib/update-notifier/apt-check 2>&1 | cut -d ';' -f 1
Some very important points you omitted:
One difference between “apt-get upgrade” and “apt upgrade” is that the latter deletes the deb files after installing them. If you don’t like this, use apt-get.
If you want to upgrade packages that involve installation or removal of other packages, use dist-upgrade.
The easy way is to use synaptic, a graphical frontend for apt-get. It works well most of the time (but not always).