Learn how to use apt or apt-get reinstall on the Debian system through this guide.
How to Use apt or apt-get reinstall on Debian 11 Bullseye
The apt provides a high-level interface for managing the packages through the command line in Linux. Both apt and apt-get commands take the reinstall argument for the reinstallation of the packages.
How to Use apt reinstall on Debian 11 Bullseye
To use the apt reinstall command on Debian, follow the below-given syntax:
Note: In the above command, you must specify the package_name to perform the reinstallation of that package on Debian.
Here, I am reinstalling the htop package on Debian via the apt command as shown below:
How to Use apt-get reinstall on Debian 11 Bullseye
Similarly in the same way, you can use the apt-get reinstall command to perform the reinstallation of a package.
The syntax of the apt-get reinstall command is as follows:
In the above command, replace <package_name> with the name of the package you want to install using the apt-get reinstall command.
Here, I am reinstalling the rsync package and its dependencies on Debian:
Reinstalling Multiple Packages Through apt or apt-get reinstall
You can also use the apt or apt-get reinstall command to install multiple packages on a single go.
The following is the syntax to reinstall multiple packages through apt or apt-get reinstall commands:
Or:
For example, in the below given command, I am performing the reinstallation of the rsync and htop on Debian 11:
Bottom Line
The Debian users can reinstall packages on the system by using the apt or apt-get reinstall command. The syntax to use these commands is given in the above-mentioned guidelines. Further, you can also use these commands to reinstall multiple packages at the same time through a single command. It depends on the user’s choice, which command they want to prefer either apt or apt-get. Both will reinstall the package from the Debian repository.