If you are new to Ubuntu, you might be having a difficult time adjusting to the Gnome environment. If you are confused about what a package is, compare it to a real-life example. In real life, a package can be a box containing different items. You can access the items in the box by unpacking the said package. Similarly, a package in Ubuntu is a compressed file archive containing a list of files and scripts required to run a particular application. For Ubuntu to access those files, it needs to unpack or in computer terminology install/update the said package.![Packages Packages](https://linuxconfig.org/images/10-update-ubuntu-packages-18.04-bionic.png?5df1c2d7)
![Remote_user=username... Remote_user=username...](https://www.tecmint.com/wp-content/uploads/2016/04/Install-Ubuntu-Update-Manager.jpg)
Updating packages in Ubuntu is, to be honest, quite a simple task that can be done with just two mouse clicks, or by typing two commands if you are updating via terminal. There are two major ways that you can go about completing this task. You can update your packages via command line, or if you like to perform tasks using GUI, you can update your packages graphically using Package Updater. The choice is yours to make.
Method 1:Via Terminal
![Packages Packages](https://linuxconfig.org/images/10-update-ubuntu-packages-18.04-bionic.png?5df1c2d7)
On the Ubuntu desktop, go to the terminal by clicking the terminal icon in the shell or simple press Ctrl+Alt+T.
Ubuntu Updates Download
In the terminal type, the following command
- Canonical has released today new Ubuntu kernel updates to address a regression introduced by the previous kernel updates in the software RAID10 driver, which could lead to data corruption. I received an email from Brian Kemp the other day informing me about the fact that Canonical has pulled back the Linux kernel updates released on December.
- The latest LTS version of Ubuntu is Ubuntu 20.04 LTS “Focal Fossa,” which was released on April 23, 2020. Canonical releases new stable versions of Ubuntu every six months, and new Long Term Support versions every two years.
After typing the above command, you will be asked for your password. Type the password in the terminal. No characters will be shown on the terminal when you are writing your password. After typing the password, hit enter.
Now contrary to popular belief, this command doesn’t update your system. Instead, it updates your Ubuntu repositories. So your system checks against the repositories. It checks if there are newer versions available of the program installed. It won’t update your existing packages right away; instead, it will update the information about the existing packages and their versions available. This is the reason that when this command finishes execution, Ubuntu shows you the number of packages that can be updated.
Intalling Security Updates on Ubuntu. If your system has the update-notifier-common package installed, Ubuntu will alert you about pending updates via the message of the day (motd) upon console or remote login. Once you have logged into your Ubuntu system, you can check for new updates using the following apt command. $ sudo apt update.
In the picture above, you can see that when this command finishes execution, Ubuntu shows you the list of packages that can be updated. In order to view these packages type the following command
You can update a particular package, or you can update all of the updatable packages on your Ubuntu. To update all your packages, just type the following command in the terminal.
After typing the above command again, Ubuntu will ask you for your password. Like before, type in the password and hit enter.
After 2 or 3 seconds Ubuntu will show you the amount needed to update these packages and will further ask for your confirmation. To continue, type y in the terminal and press enter. Once you do this, Ubuntu will start downloading and updating your packages.
This command will download and update all of the packages that need updating. A little pro tip here to make this updating task easy. You can also type the following command instead of typing in these two commands.
As the two commands require to run in succession, we can combine them into a single command. The && between the two commands combines them. So now the first command before the && sign runs. When the first command has completed execution, the rest of the command after the && is executed. The -y at the end will save you one keystroke where Ubuntu asks you whether you want to install the upgrades or not. You should run this command from time to time to keep your system up to date.
Method 2: Update using Package Updater:
Go to the menu and in the search bar type “Software Updater.”. Now run it.
It will check if there are any packages on your system that can be updated.
Ubuntu Latest Release
If there are any such packages, it will give you the option to install the updates
Click on Install Now. It will ask for your password. Type your password and hit Authenticate.
After authenticating, Ubuntu will start downloading and installing the updates.
In some cases, you might be asked to restart your system after the updates. This is so that the installed, updated packages can take full effect and function properly.
In most of the cases after updating, there are some packages the are of no further use to the user. You can delete them, which will free up your system space and keep your system clean and tidy, which is always a good thing. To do so type the following command in the terminal
This tutorial is valid for all the versions of Ubuntu and other Linux distros based on Ubuntu like Linux Lite, Linux Mint, etc.
Conclusion:
I hope this tutorial will be helpful to you. One of the many things you hear about Ubuntu is that it’s a lot safer than Windows. The proof can be seen when updating. Whenever you make any changes to the system, Ubuntu asks you your password for authentication. Updating packages in Ubuntu is quite simple. Bear in mind that this tutorial is for updating packages in Ubuntu. It doesn’t update your Ubuntu version. Also note that this tutorial, including the command line method, is valid for all the versions of Ubuntu and other Linux distros based on Ubuntu like Linux Lite, Linux Mint, etc.
One of the most crucial tasks that a systems administrator needs to undertake is ensuring that systems are patched with the latest security updates. Ubuntu is considered as one of the most secure Linux distributions but it can be susceptible to vulnerabilities as well. An updated system is secure and stands a better chance against malware and attackers.
In this tutorial, we'll focus on how one can manually install security updates in Ubuntu 18.04.
List Security Updates
To display security updates only ,
Or
If you wish to display all upgradeable packages run
Sample Output
Finally, to install security updates only, run
Manually Install Security Updates
To manually configure a system for security updates,
First, install unattended-upgrade package
Sample Output
After successful installation, you can proceed and call it manually as shown
Output
The
-v
flags prints out the process in verbose on a command line.The
-d
handle debug messages in the system.Setting up Automatic security updates
To configure your system to receive automatic security updates, follow the steps below
1. Install Unattended upgrade packages
To install unattended upgrades. First, log in as root and update the system
![Remote_user=username... Remote_user=username...](https://www.tecmint.com/wp-content/uploads/2016/04/Install-Ubuntu-Update-Manager.jpg)
Next, install unattended-upgrades
2. Configure your Ubuntu system
After installation of Unattended updates, it's time now to configure your system.
Open the unattended upgrade configuration file as shown
Open the unattended upgrade configuration file as shown
Comment out all line except the one with the security attribute as shown
If you wish to exclude packages from being upgraded unattended, you can do so in the file configuration file under the
If you wish to exclude packages from being upgraded unattended, you can do so in the file configuration file under the
Unattended-Upgrade::Package-Blacklist
section.Append each package on each line as shown
In the example above, vim text editor and MariaDB-server packages have been excluded. Save and Exit the configuration file.
3. Enable auto updating
Finally, you need to open the unattended-upgrades attributes
Save and Exit.
Reboot your system for the changes to take effect.
In this brief article, we have taken you through how to automatically and manually install security updates in Ubuntu 18.04. You are welcome to try out the above commands. Keep it locked for more insightful articles!