Ubuntu 20.04 Update installed security packages

I’m a developer and utilizing Ubuntu 20.04 LTS Linux server for my tasks. I have to replace put in packages for safety on Ubuntu Linux 20.04 LTS server. How do I replace my Ubuntu system utilizing apt command and validate that safety patches are utilized?

Retaining your Ubuntu server system, kernel, docker, and the put in software is a necessary system admin process. An up to date Ubuntu 20.04 LTS system means fewer safety points and elevated system stability. Ubuntu Linux is fairly user-friendly in the case of making use of safety updates and patches. This web page exhibits replace the Ubuntu system utilizing the apt command or the GUI instruments for desktop set up.


Ubuntu 20.04 replace put in packages for safety

The process to put in updates and safety patches on Ubuntu:

  1. Open the terminal software.
  2. For distant server log in utilizing the ssh command: ssh [email protected]
  3. Run the command sudo apt replace to refresh package deal database.
  4. Present details about out there replace/packages/pathces, run: sudo apt listing –upgradable
  5. Apply safety updates and patches for all put in apps, run: sudo apt improve
  6. Reboot the system if kernel was up to date by typing sudo reboot command.

Step 1 – Replace package deal info

First that you must obtain package deal info from all configured sources saved in /and so on/apt/sources.listing and /and so on/apt/sources.listing.d/ listing. Use the grep command/egrep command to listing sources:
grep -i “^deb” /and so on/apt/sources.listing

deb http://mirrors.linode.com/ubuntu/ focal most important restricted
deb http://mirrors.linode.com/ubuntu/ focal-updates most important restricted
deb http://mirrors.linode.com/ubuntu/ focal universe
deb http://mirrors.linode.com/ubuntu/ focal-updates universe
deb http://mirrors.linode.com/ubuntu/ focal multiverse
deb http://mirrors.linode.com/ubuntu/ focal-updates multiverse
deb http://mirrors.linode.com/ubuntu/ focal-backports most important restricted universe multiverse
deb http://safety.ubuntu.com/ubuntu focal-security most important restricted
deb http://safety.ubuntu.com/ubuntu focal-security universe
deb http://safety.ubuntu.com/ubuntu focal-security multiverse

Fetch package deal updates info utilizing the apt command:
sudo apt replace
Ubuntu 20.04 Update installed security packages

Step 2 – Discover out details about out there Ubuntu security-related updates

It’s a good suggestion to listing out all updates out there for the field. Therefore, we run the next command:
sudo apt listing –upgradable

Itemizing… Carried out
distro-info-data/focal-updates,focal-updates 0.43ubuntu1.1 all [upgradable from: 0.43ubuntu1]
libnetplan0/focal-updates 0.99-0ubuntu2 amd64 [upgradable from: 0.99-0ubuntu1]
netplan.io/focal-updates 0.99-0ubuntu2 amd64 [upgradable from: 0.99-0ubuntu1]
python3-requests/focal,focal 2.22.0-2ubuntu1 all [upgradable from: 2.22.0-2build1]

Wish to see an inventory of the updates one display screen at a time? Attempt the next command together with grep command/extra command:
sudo apt listing –upgradable | extra
## see if nginx replace launched or not ##
sudo apt listing –upgradable | grep -i nginx
We are able to additionally listing all doable variations that we will set up or replace utilizing the next syntax:
sudo apt listing –all-versions –upgradable
Earlier than you apply updates please observe down Linux kernel model, run:
uname -mrs
Pattern outputs:

Linux 5.4.0-26-generic x86_64

It is usually doable to create an inventory of all put in software program as observe
dpkg –get-selections > ~/packages-list-dd-mm-yyyy.txt
We are able to restore em if required later:
sudo dpkg –set-selections < ~/packages-list-dd-mm-yyyy.txt
## restore it ##
sudo apt-get dselect-upgrade
See “Linux Get Listing of Put in Software program for Reinstallation / Restore All of the Software program Applications” for more information.

Step 3 – Set up updates through apt command line for Ubuntu 20.04

Fireplace up a terminal software or log in utilizing ssh command. Run the apt command to improve all put in packages on Ubuntu Linux system:
sudo apt improve
When promoted as follows, sort “Y” and press the [Enter] key to substantiate operation of patching and making use of updates on Ubuntu:

Do you wish to proceed? [Y/n]

Ubuntu 20.04 Update installed security packages

How do I replace a single package deal on Ubuntu?

Say you solely wish to replace nginx package deal, run:
sudo apt set up package deal
sudo apt set up nginx
sudo apt set up bash
sudo yum replace python3
If nginx package deal already put in it’ll attempt to replace to the newest model. If you do not need to put in new packages; when used along side set up, only-upgrade will set up upgrades for already put in packages solely and ignore requests to put in new packages. Attempt:
sudo apt –only-upgrade set up nginx

The best way to exclude Ubuntu 20.04 LTS package deal from a replace

Use the apt-mark command as follows to held again given package deal, which is able to stop the package deal from being robotically put in, upgraded or faraway from the system:
sudo apt-mark maintain package deal
sudo apt-mark maintain bash
Wish to cancel a beforehand set maintain on a package deal to permit all actions once more? Cross the unhold possibility as follows:
sudo apt-mark unhold package deal
sudo apt-mark unhold bash
We are able to use the next easy command to print an inventory of packages on maintain in the identical manner as for the opposite present instructions:
sudo apt-mark showhold
sudo apt-mark showhold | grep nginx

Step 4 – Reboot the Linux system

Did apt put in a brand new kernel? In that case reboot the system, run:
sudo reboot
After reboot confirm your Linux kernel model and listing out there updates, enter:
uname -mrs
sudo apt replace
sudo apt listing –upgradable

Ubuntu Linux 20.04 LTS – Updating your system utilizing GUI

The GUI methodology is tremendous straightforward. Press the Tremendous key (Home windows key) and kind the next in search field:
replace supervisor
Ubuntu 20.04 Update installed security packages
Await a while as “Software program Updater” have to refresh the database. As soon as repos are refreshed you will note the next field if any software program updates out there on your Ubuntu Linux 20.04 LTS desktop:
Ubuntu 20.04 Update installed security packages
Click on on the Set up Now button.


You discovered set up software program replace and patches on Ubuntu 20.04 methods. See Ubuntu apt command assist web page for extra info.


Posted by: Vivek Gite

The writer is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a coach for the Linux working system/Unix shell scripting. Get the newest tutorials on SysAdmin, Linux/Unix and open supply matters through RSS/XML feed or weekly e-mail publication.

update ubuntu 20.04 command line,ubuntu 20.04 upgrade failed,ubuntu 20.04 commands,ubuntu 20.04 package manager,ubuntu 20.04 sources.list default,ubuntu 20.04 issues,ubuntu 20.04 utility,ubuntu 20.04 hacks