apt command apt-get command Debian Install Security Updates Ubuntu Unattended Upgrades

How to Manually Install Security Updates on Debian/Ubuntu?

Installing a package deal in Linux from command line is an easy process.

In a single command or combining of a number of commands might make you to complete your process simply.

The same could be carried out for security updates as properly.

In this tutorial, we’ll show you ways to examine obtainable safety update and set up them on Debian based mostly techniques comparable to Ubuntu, LinuxMint, and so forth,.

It may be completed using three methods. All these strategies are described in this article in details.

As a Linux administrator, you need to maintain your system up-to-date, that makes your system safer. It protects your system towards unwanted assault.

In case you are not in a position to patch complete system with all updates due to some software dependency. At-least, it is best to install only security patches to make your system 100% compliance.

How to Install unattended-upgrades package deal in Debian/Ubuntu?

By default unattended-upgrades package deal ought to be put in on your system. However in case if it’s not installed use the next command to set up it.

Use APT-GET Command or APT Command to set up unattended-upgrades package deal.

$ sudo apt-get set up unattended-upgrades
or
$ sudo apt install unattended-upgrades

Technique-1: How to Verify if any Security Updates are available in Debian/Ubuntu?

It’s all the time a superb follow to verify record of obtainable security updates earlier than performing the patch installation. It offers you the listing of packages which might be going to be up to date in your system.

What’s dry run? A lot of the Linux commands have a dry run choice, which stimulate the precise output however nothing will probably be downloaded or put in.

To do so, you need to add –dry-run choice with unattended-upgrades command.

$ sudo unattended-upgrade –dry-run -d

Initial blacklisted packages:
Initial whitelisted packages:
Beginning unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
Utilizing (^linux-image-[0-9]+.[0-9.]+-.*|^linux-headers-[0-9]+.[0-9.]+-.*|^linux-image-extra-[0-9]+.[0-9.]+-.*|^linux-modules-[0-9]+.[0-9.]+-.*|^linux-modules-extra-[0-9]+.[0-9.]+-.*|^linux-signed-image-[0-9]+.[0-9.]+-.*|^kfreebsd-image-[0-9]+.[0-9.]+-.*|^kfreebsd-headers-[0-9]+.[0-9.]+-.*|^gnumach-image-[0-9]+.[0-9.]+-.*|^.*-modules-[0-9]+.[0-9.]+-.*|^.*-kernel-[0-9]+.[0-9.]+-.*|^linux-backports-modules-.*-[0-9]+.[0-9.]+-.*|^linux-modules-.*-[0-9]+.[0-9.]+-.*|^linux-tools-[0-9]+.[0-9.]+-.*|^linux-cloud-tools-[0-9]+.[0-9.]+-.*) regexp to discover kernel packages
Using (^linux-image-4.15.Zero-51-generic$|^linux-headers-Four.15.0-51-generic$|^linux-image-extra-4.15.0-51-generic$|^linux-modules-Four.15.Zero-51-generic$|^linux-modules-extra-4.15.0-51-generic$|^linux-signed-image-Four.15.Zero-51-generic$|^kfreebsd-image-Four.15.0-51-generic$|^kfreebsd-headers-4.15.0-51-generic$|^gnumach-image-Four.15.0-51-generic$|^.*-modules-4.15.Zero-51-generic$|^.*-kernel-4.15.Zero-51-generic$|^linux-backports-modules-.*-4.15.Zero-51-generic$|^linux-modules-.*-4.15.0-51-generic$|^linux-tools-4.15.Zero-51-generic$|^linux-cloud-tools-4.15.Zero-51-generic$) regexp to find operating kernel packages
Checking: apt ([])
adjusting candidate model: apt=1.6.6ubuntu0.1
Checking: apt-utils ([])
adjusting candidate model: apt-utils=1.6.6ubuntu0.1
Checking: bash ([])
.
.
Checking: xxd ([, ])
pkgs that appear to be they should be upgraded: binutils
binutils-common
binutils-x86-64-linux-gnu
cpp
cpp-7
dbus
dbus-user-session
dbus-x11
firefox
firefox-locale-en
g++
g++-7
gcc
gcc-7
gcc-7-base
gcc-8-base
libasan4
libatomic1
libbinutils
libcc1-0
libcilkrts5
libdbus-1-Three
libdbus-1-dev
libgcc-7-dev
libgcc1
libgfortran4
libgomp1
libitm1
liblsan0
libmpx2
libquadmath0
libstdc++-7-dev
libstdc++6
libtsan0
libubsan0
vim-common
vim-tiny
xxd

If the above command output says “No packages found that can be upgraded unattended and no pending auto-removals” in the Terminal, this suggests your System is up-to-date.

How to Install out there Security Updates in Debian/Ubuntu?

In case your acquired any package deal updates in the above command output. Then run the following command to set up them.

$ sudo unattended-upgrade -d

Alternatively this may be completed from apt-get command. It’s bit tough. Nevertheless, i might recommend customers to go together with first choice.

Technique-2: How to Examine if any Security Updates can be found in Debian/Ubuntu Using apt-get Command?

Run the next command to verify listing of obtainable safety updates in your Debian/Ubuntu system

$ sudo apt-get -s dist-upgrade | grep “^Inst” | grep -i securi

Inst libquadmath0 [8.2.0-1ubuntu2~18.04] (Eight.3.Zero-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libitm1 [8.2.0-1ubuntu2~18.04] (Eight.Three.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst gcc-8-base [8.2.0-1ubuntu2~18.04] (8.Three.Zero-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libmpx2:amd64 libgcc1:amd64 libtsan0:amd64 liblsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ] Inst libgcc1 [1:8.2.0-1ubuntu2~18.04] (1:Eight.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libmpx2:amd64 libtsan0:amd64 liblsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ] Inst libmpx2 [8.2.0-1ubuntu2~18.04] (8.3.Zero-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libtsan0:amd64 liblsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ] Inst liblsan0 [8.2.0-1ubuntu2~18.04] (Eight.Three.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libtsan0:amd64 libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ] Inst libtsan0 [8.2.0-1ubuntu2~18.04] (Eight.Three.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libgomp1:amd64 libatomic1:amd64 libcc1-0:amd64 libstdc++6:amd64 ] Inst libcc1-0 [8.2.0-1ubuntu2~18.04] (8.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libgomp1:amd64 libatomic1:amd64 libstdc++6:amd64 ] Inst libatomic1 [8.2.0-1ubuntu2~18.04] (Eight.Three.Zero-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libgomp1:amd64 libstdc++6:amd64 ] Inst libgomp1 [8.2.0-1ubuntu2~18.04] (8.Three.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libstdc++6:amd64 ] Inst libstdc++6 [8.2.0-1ubuntu2~18.04] (Eight.3.0-6ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
Inst libdbus-1-dev [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst dbus-user-session [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst dbus-x11 [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst dbus [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libdbus-1-3 [1.12.2-1ubuntu1] (1.12.2-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
Inst xxd [2:8.0.1453-1ubuntu1] (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
Inst vim-tiny [2:8.0.1453-1ubuntu1] (2:Eight.Zero.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst vim-common [2:8.0.1453-1ubuntu1] (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [all])
Inst binutils-x86-64-linux-gnu [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [binutils:amd64 ] Inst binutils-common [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [binutils:amd64 libbinutils:amd64 ] Inst binutils [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [libbinutils:amd64 ] Inst libbinutils [2.30-21ubuntu1~18.04] (2.30-21ubuntu1~18.04.2 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
Inst libasan4 [7.3.0-27ubuntu1~18.04] (7.4.Zero-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libubsan0 [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libcilkrts5 [7.3.0-27ubuntu1~18.04] (7.Four.Zero-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst g++-7 [7.3.0-27ubuntu1~18.04] (7.4.Zero-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst gcc-7 [7.3.0-27ubuntu1~18.04] (7.4.Zero-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libstdc++-7-dev [7.3.0-27ubuntu1~18.04] (7.4.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libgcc-7-dev [7.3.0-27ubuntu1~18.04] (7.Four.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst libgfortran4 [7.3.0-27ubuntu1~18.04] (7.Four.Zero-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst cpp-7 [7.3.0-27ubuntu1~18.04] (7.4.Zero-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) [] Inst gcc-7-base [7.3.0-27ubuntu1~18.04] (7.Four.0-1ubuntu1~18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
Inst cpp [4:7.3.0-3ubuntu2.1] (Four:7.4.Zero-1ubuntu2.3 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
Inst firefox [67.0.1+build1-0ubuntu0.18.04.1] (67.0.2+build2-0ubuntu0.18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
Inst firefox-locale-en [67.0.1+build1-0ubuntu0.18.04.1] (67.0.2+build2-0ubuntu0.18.04.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
Inst gcc [4:7.3.0-3ubuntu2.1] (4:7.Four.Zero-1ubuntu2.3 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])
Inst g++ [4:7.3.0-3ubuntu2.1] (4:7.Four.0-1ubuntu2.3 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64])

How to Install out there Security Updates in Debian/Ubuntu Utilizing apt-get Command?

When you discovered any package deal updates within the above output. Finally run the following command to install them.

$ sudo apt-get -s dist-upgrade | grep “^Inst” | grep -i securi | awk -F ” ” ‘print $2’ | xargs apt-get set up

Alternatively this can be carried out from apt command. It’s bit tough. Nevertheless, i might recommend customers to go together with first choice.

Technique-Three: How to Examine if any Security Updates are available in Debian/Ubuntu Utilizing apt Command?

Run the following command to examine record of obtainable safety updates in your Debian/Ubuntu system

$ sudo apt listing –upgradable | grep -e “-security”

binutils/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04] binutils-common/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04] binutils-x86-64-linux-gnu/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04] cpp/bionic-updates,bionic-security 4:7.4.0-1ubuntu2.3 amd64 [upgradable from: 4:7.3.0-3ubuntu2.1] cpp-7/bionic-updates,bionic-security 7.4.Zero-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] dbus/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1] dbus-user-session/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1] dbus-x11/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1] firefox/bionic-updates,bionic-security 67.0.2+build2-0ubuntu0.18.04.1 amd64 [upgradable from: 67.0.1+build1-0ubuntu0.18.04.1] firefox-locale-en/bionic-updates,bionic-security 67.Zero.2+build2-0ubuntu0.18.04.1 amd64 [upgradable from: 67.0.1+build1-0ubuntu0.18.04.1] g++/bionic-updates,bionic-security Four:7.4.0-1ubuntu2.Three amd64 [upgradable from: 4:7.3.0-3ubuntu2.1] g++-7/bionic-updates,bionic-security 7.Four.Zero-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] gcc/bionic-updates,bionic-security 4:7.Four.0-1ubuntu2.Three amd64 [upgradable from: 4:7.3.0-3ubuntu2.1] gcc-7/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] gcc-7-base/bionic-updates,bionic-security 7.4.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] gcc-Eight-base/bionic-updates,bionic-security Eight.Three.Zero-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libasan4/bionic-updates,bionic-security 7.Four.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] libatomic1/bionic-updates,bionic-security Eight.Three.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libbinutils/bionic-updates,bionic-security 2.30-21ubuntu1~18.04.2 amd64 [upgradable from: 2.30-21ubuntu1~18.04] libcc1-0/bionic-updates,bionic-security Eight.Three.Zero-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libcilkrts5/bionic-updates,bionic-security 7.Four.Zero-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] libdbus-1-Three/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1] libdbus-1-dev/bionic-updates,bionic-security 1.12.2-1ubuntu1.1 amd64 [upgradable from: 1.12.2-1ubuntu1] libgcc-7-dev/bionic-updates,bionic-security 7.Four.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] libgcc1/bionic-updates,bionic-security 1:Eight.Three.Zero-6ubuntu1~18.04.1 amd64 [upgradable from: 1:8.2.0-1ubuntu2~18.04] libgfortran4/bionic-updates,bionic-security 7.Four.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] libgomp1/bionic-updates,bionic-security Eight.3.Zero-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libitm1/bionic-updates,bionic-security Eight.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] liblsan0/bionic-updates,bionic-security Eight.Three.Zero-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libmpx2/bionic-updates,bionic-security Eight.Three.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libquadmath0/bionic-updates,bionic-security Eight.3.0-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libstdc++-7-dev/bionic-updates,bionic-security 7.Four.Zero-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] libstdc++6/bionic-updates,bionic-security 8.Three.Zero-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libtsan0/bionic-updates,bionic-security 8.Three.Zero-6ubuntu1~18.04.1 amd64 [upgradable from: 8.2.0-1ubuntu2~18.04] libubsan0/bionic-updates,bionic-security 7.Four.0-1ubuntu1~18.04.1 amd64 [upgradable from: 7.3.0-27ubuntu1~18.04] vim-common/bionic-updates,bionic-updates,bionic-security,bionic-security 2:8.Zero.1453-1ubuntu1.1 all [upgradable from: 2:8.0.1453-1ubuntu1] vim-tiny/bionic-updates,bionic-security 2:Eight.Zero.1453-1ubuntu1.1 amd64 [upgradable from: 2:8.0.1453-1ubuntu1] xxd/bionic-updates,bionic-security 2:Eight.Zero.1453-1ubuntu1.1 amd64 [upgradable from: 2:8.0.1453-1ubuntu1]

How to Install out there Security Updates in Debian/Ubuntu Using apt Command?

For those who found any package deal updates within the above output. Finally run the following command to install them.

$ sudo apt listing –upgradable | grep -e “-security” | awk -F “/” ‘print $1’ | xargs apt set up

Also, the next file will provide you with the packages update rely.

$ sudo cat /var/lib/update-notifier/updates-available

190 packages could be updated.
39 updates are security updates.