Debian

How to Update a Single Package With apt-get Command in Debian

Updating or upgrading the packages through the apt (Advance Package Manager) is a widely used activity that keeps your system updated. By default, the update/upgrade command upgrades all the currently installed packages on the system, which can take a lot of time. Thus, to cope with it, the users can update a single package as well through the upgrade command, which can benefit them if they don’t have enough time to wait for a package’s upgrade.

Follow this article’s guidelines to learn how to use the apt command to update a specific package in Debian.

Update a Single Package With apt-get Command in Debian

Updating the package on Debian is simple by running the following command on the terminal:

sudo apt upgrade

However, the above command is useful if you want to update all the packages on the system. For those who only require upgrading a single package on Debian, they can follow the below-given command:

sudo apt-get --only-upgrade install <package-name>

The above command is useful for the users to upgrade a single package on the system. It’s a must for the users to replace the “<package-name>” with the name of the package you want to upgrade on the system.

For example, let’s only upgrade the installed handbrake package on the Debian system using the below-given command:

sudo apt-get --only-upgrade install handbrake

In my case, the upgrade of the package is already installed.

You can also upgrade the single package with following syntax:

sudo apt-get upgrade <package-name>

Just add the package-name with the installed package of your choice. However, the package you are going to choose should be installed on Debian:

sudo apt-get upgrade handbrake

Conclusion

Upgrading a single package on Debian isn’t a complex job and the users can quickly perform a single package upgrade via several apt commands. These commands include ‘apt-get –only-upgrade”, “apt –only-upgrade”, “apt-get upgrade” and “apt upgrade” with the package name you want to upgrade on the Debian system.

About the author

Zainab Rehman

I'm an author by profession. My interest in the internet world motivates me to write for Linux Hint and I'm here to share my knowledge with others.