In this article, we will guide you through the process of updating the sudo package version on Ubuntu 18.04 using the
apt-get command. The sudo package is a crucial component of the Ubuntu operating system, as it allows users to execute commands with administrative privileges. Keeping this package updated is essential for system security and stability.
To update the sudo package version on Ubuntu 18.04 using apt-get, you can run the following commands: "sudo apt update" to update the package lists, "apt-cache policy sudo" to check the current version, and "sudo apt install sudo" to upgrade the package to the latest version available in the repositories.
Understanding the Basics
Before we start, it’s important to understand what
apt-get is a powerful command-line tool used in Debian-based systems like Ubuntu for handling packages. It provides functions such as installing, upgrading, and removing software.
Step 1: Update the Package Lists
First, we need to update the package lists for upgrades and new package installations. This can be done by running the following command:
sudo apt update
update command fetches the package lists from the repositories and “updates” them to get information on the newest versions of packages and their dependencies.
Step 2: Check the Current Sudo Version
Next, we need to check the currently installed version of sudo. This can be done by running:
apt-cache policy sudo
This command will display the installed version and the candidate version available for upgrade. The installed version is the one currently in use on your system, while the candidate is the version that
apt-get would install if you were to upgrade or install the package.
Step 3: Upgrade the Sudo Package
If the candidate version is newer than the installed version and you want to update only the sudo package, run:
sudo apt install sudo
This command will upgrade the sudo package to the latest version available in the repositories. The
install command is used to install new packages or upgrade existing ones.
It’s important to ensure that the bionic-updates and bionic-security repositories are enabled in your software sources. These repositories contain the latest security updates and bug fixes. You can check this by visiting the Ubuntu Software Center and ensuring that the ‘Updates’ tab has these repositories enabled.
If the above steps do not update the sudo package to the desired version, it could be due to the fact that the Ubuntu repositories do not always offer the latest versions of packages after an OS has been released. In such cases, security fixes are backported and applied to the current version of the package in the repositories.
To address this, you can check the Ubuntu Security Notices (USN) website for information about specific security vulnerabilities and the corresponding fixes.
In summary, to update the sudo package version, run
sudo apt update followed by
sudo apt upgrade. Ensure that the bionic-updates and bionic-security repositories are enabled. If the package version does not change, it is likely that the security fixes have been backported to the current version in the repositories.
We hope you found this guide helpful. If you have any questions or run into any issues, feel free to leave a comment below.
Updating the sudo package version is crucial for system security and stability. It ensures that you have the latest security fixes and bug patches, reducing the risk of vulnerabilities in your system.
You can check the currently installed version of sudo by running the command
apt-cache policy sudo. This will display the installed version and the candidate version available for upgrade.
To upgrade the sudo package to the latest version available in the repositories, you can run the command
sudo apt install sudo. This will install the latest version of sudo on your system.
To ensure that the bionic-updates and bionic-security repositories are enabled, you can check the ‘Updates’ tab in the Ubuntu Software Center. Make sure that these repositories are enabled to receive the latest security updates and bug fixes.
If the sudo package version does not change after running
sudo apt update and
sudo apt upgrade, it is likely that the security fixes have been backported to the current version in the repositories. You can check the Ubuntu Security Notices (USN) website for information about specific security vulnerabilities and the corresponding fixes.