Brief: This article covers the definition of a Deb package (file), its installation on Ubuntu, Linux Mint, and Debian distributions, and also shows how to remove deb packages afterward.
What is a Deb File?
Before we look at the different approaches to installing deb files on Ubuntu or Debian-based Linux distributions, we first need to understand them.
Debian, Ubuntu, and Linux Mint distributions support the use of a package file with a '.deb'
file extension, which contains the needed metadata, scripts, and files that are crucial in the installation and management of targeted Linux-supported software packages.
The Debian Project developed the '.deb'
file format as a standard software package distribution format. By conceptualizing a ‘control file‘, the targeted software package is enriched with metadata info like name, version, dependencies, and installation scripts associated with the software package in question.
Installing Deb Package on Ubuntu, Mint, and Debian
There is more than one approach to installing '.deb'
files on Ubuntu and Debian-based Linux distributions as explained in the following steps.
1. Using the ‘dpkg’ Command
The dpkg command is used to install, manage, and remove '.deb'
software packages along with their dependencies if any as shown.
$ sudo dpkg -i <package-name>.deb
The -i
flag in the command above triggers the installation of the google-chrome .deb file.
Once installed, you can confirm the installed version of the ‘.deb’ software package using the dpkg-query command.
$ sudo dpkg-query -l google-chrome-stable
2. Using the apt Command
The apt command is effective in managing packages (install, upgrade, and remove) since it is the default package manager. This approach of installing a '.deb'
file automatically caters to the download and installation of missing dependencies. Also, '.deb'
packages installed via this approach are automatically upgraded during the next system update.
To install a '.deb'
file using ‘apt’, implement the following command:
$ sudo apt install <package-name>.deb
Once installed, you can confirm the installed version of the '.deb'
software package using the apt command.
$ sudo apt list -a google-chrome-stable
3. Using a Graphical Package Manager
A Graphical Package Manager is an ideal alternative to install Deb files on Ubuntu and Debian-based systems. Their user-friendly interface makes it easy to install, manage, and upgrade packages as shown.
To install Deb packages via the default Graphical Package Manager, consider the following installation steps:
Right-click on the targeted '.deb'
file.
Select the ‘Open With Other Application‘ option and choose the ‘Software Install‘ option.
Next, click on the ‘Select‘ button and wait for the application details to load. You should see an ‘install‘ button for installing the selected software package.
Click on it and provide a Sudoer user password for the installation to proceed.
After a while, the software package should be installed.
Remove Deb Packages in Ubuntu, Mint, and Debian
Before uninstalling a '.deb'
file, we need to be certain of its exact program name. For instance, for Google Chrome, we will run the following command:
$ dpkg -l | grep chrome
From the above output, we can use the exact program name for Google Chrome (google-chrome-stable) software to uninstall it if necessary.
Remove Deb File with Configuration Files
Fully uninstall a Deb file together with its configuration files using the dpkg or apt command.
$ sudo dpkg -P google-chrome-stable OR $ sudo apt purge google-chrome-stable
Remove Deb File without Configuration Files
To uninstall a Deb file without removing configuration files, use the dpkg or apt command.
$ sudo dpkg -r google-chrome-stable OR $ sudo apt remove google-chrome-stable
Conclusion
The '.deb'
file format plays a crucial role in Debian-based distributions such as Ubuntu and Linux Mint. For instance, its existence makes it convenient and efficient to distribute and install targeted software packages on these systems.
If you have any questions on how to install and remove Deb files on Debian-based distributions, feel free to leave a comment.