Commands.page Logo

How to Update Sudo Package in Ubuntu Linux

This article provides a concise guide on maintaining system security by updating the sudo package on Ubuntu. It covers the necessary terminal commands to refresh your package lists and upgrade sudo to the latest available version without affecting other system components.

Update Repository Lists

Before upgrading specific software, you must synchronize your package index with the repositories. Open a terminal and execute the following command to fetch the latest information:

sudo apt update

You will be prompted to enter your user password. This process ensures your system is aware of the newest versions available for installation.

Upgrade the Sudo Package

Once the repository lists are current, you can upgrade the sudo package specifically. This method avoids updating unrelated software on your system. Run the following command:

sudo apt install --only-upgrade sudo

If a newer version is available, apt will download and install it. Confirm the installation by pressing Y when prompted.

Verify the Version

After the installation completes, confirm that the update was successful by checking the version number. Use the following command:

sudo -V

The output will display the current version of sudo installed on your system. Ensure this version matches the latest security release for your Ubuntu version.