Home Debian How to Install Deb Files in Ubuntu, Mint and Debian

How to Install Deb Files in Ubuntu, Mint and Debian

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.

Install Deb Package Using dpkg Command
Install Deb Package Using dpkg Command

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
Check Installed Package in Ubuntu
Check Installed Package in Ubuntu

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
Install Deb Package Using apt Command
Install Deb Package Using apt Command

Once installed, you can confirm the installed version of the '.deb' software package using the apt command.

$ sudo apt list -a google-chrome-stable
List Installed Package Using apt Command
List Installed Package Using apt Command

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.

Install Deb File Using GUI Package Manager
Install Deb File Using GUI Package Manager

Select the ‘Open With Other Application‘ option and choose the ‘Software Install‘ option.

Choose Software Install Option
Choose 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.

Install Deb File via Software Center
Install Deb File via Software Center

Click on it and provide a Sudoer user password for the installation to proceed.

Enter Sudo User Password
Enter Sudo User Password

After a while, the software package should be installed.

Summary of Installed Deb Package
Summary of Installed Deb Package

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
Query Installed Package Name
Query Installed Package Name

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.

Ravi Saive
I am an Experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies. Founder of TecMint.com, LinuxShellTips.com, and Fossmint.com. Over 150+ million people visited my websites.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

Got something to say? Join the discussion.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.