In this beginner-friendly tutorial, we’re going to show you how to install a .deb file on Ubuntu. We’ll show you different methods of installing a .deb file, so you can choose whichever one you prefer and find easier.
tl;dr version of how to install .deb files on Ubuntu
GUI: double-click the file and open it with Software Install. If it doesn’t open with Software Install, right-click the file -> Open With Other Application -> select Software Install
Terminal: sudo dpkg -i /path/to/the/file.deb
If it gives you dependency errors: first, install gdebi sudo apt-get install gdebi -y
and the GUI instructions are the same as Software Install. To use gdebi via CLI: sudo gdebi /path/to/the/file.deb
What you’ll need for this Ubuntu tutorial
- You’ll need access to an Ubuntu system. A desktop computer or a server. You’ll need root (sudo) access to the system. Although this tutorial will work for other distros like Linux Mint.
- A .deb file to install. This will most likely be some app or software that you’ve downloaded. It’s always best to install software via the Software Center, but some apps are not available there, so you’ll have to use the .deb installation file you’ve downloaded.
Install .deb files via the GUI/software center
The easiest way for beginners to install a .deb file on Ubuntu is to use the graphical user interface (GUI), more specifically, the Software Center (Software Install)
Once you download the .deb file, double click it (left clicks) and it should open up in the software center where you’ll see a “Install” button. Click on that button and the app will be installed.
If you get a dependency error when trying to install a .deb file, you can use the gdebi package manager. Instructions on how to do that are below.
If you double-clicked the file and it opened up in the Archive Manager, we have a solution for that.
How to fix .deb file opening up in Archive Manager instead of Software Install on Ubuntu
First, you need to right-click on the .deb file and select “Open With Other Application”
Then, you need to select “Software Install” from the small window that will pop up and then click on the “Select” button. And that’s it. Now the .deb file will open up with the software center where you will be able to install it.
If you want to make “Software Install” the default app for all .deb files, read below.
How to make “Software Install” the default application for all .deb files on Ubuntu
For this to not happen next time (.deb file opening up as an Archive), you need to make “Software Install” the default app for all .deb files.
First, right-click the .deb file and click on Properties:
Then, a new small window will pop up where you need to:
- Click on the “Open With” tab on the right
- Click on “Software Install” from the list of applications
- Click on “Set as default”
- And close the window.
Now all .deb files will open up with Software Install by default. You can start installing .deb files on Ubuntu like you would install .exe files on Windows.
If you prefer to install .deb files via the Terminal, read below.
Install .deb files on Ubuntu via the Terminal/CLI
To install a .deb file via the command-line interface (CLI) or the Terminal, you need to follow the instructions below.
First, open up the Terminal with CTRL + ALT + T or open it up via the graphical user interface.
Then, install the .deb file with the following command:
sudo dpkg -i /path/to/the/file.deb
And that’s it! You’ve now installed the software via a .deb file.
If the Terminal gives you a dependency error, you can try running the following command:
sudo apt-get install -f
Or use gdebi instead.
Alternatively, you can also use apt if you prefer it over dpkg. To use apt to install a .deb file, use the following command:
sudo apt-get install /path/to/the/file.deb
Or this command if you’re already in the directory where the .deb file is located:
sudo apt-get install ./file.deb
If you get a dependency error when trying to install a .deb file on Ubuntu, you can use the gdebi package manager.
How to install a .deb file on Ubuntu if you get a dependency error
When trying to install a .deb file on Ubuntu, you might get an error like this:
Selecting previously unselected package webmin. (Reading database ... 106837 files and directories currently installed.) Preparing to unpack webmin_2.010_all.deb ... Unpacking webmin (2.010) ... dpkg: dependency problems prevent configuration of webmin: webmin depends on libnet-ssleay-perl; however: Package libnet-ssleay-perl is not installed. webmin depends on libauthen-pam-perl; however: Package libauthen-pam-perl is not installed. webmin depends on libio-pty-perl; however: Package libio-pty-perl is not installed. dpkg: error processing package webmin (--install): dependency problems - leaving unconfigured Errors were encountered while processing: webmin
To fix that error, you can use gdebi. It’s a simple tool that can be used to install .deb files on Ubuntu. It resolves dependency errors and installs all needed dependencies for that deb file. It has a GUI and a CLI version.
The gdebi package is in the Universe repository in Ubuntu. You can install it via Software Center, or the Terminal.
To install it via the terminal, just run the following command:
sudo apt-get install gdebi -y
After installing gdebi, you can use it to install any .deb package. For example, running:
sudo gdebi /path/to/the/file.deb
Will install the package along with its dependencies.
If you want to use the graphical version of gdebi, the instructions are similar to the Software Install/Software Center instructions from above.
- Just right-click the .deb file
- Click on Open With Other Application
- Select gdebi
- and click on Select. Now the .deb file will be open with gdebi
You can also set up gdebi as the default for all .deb files, similar to the Software Install instructions.
- Right-click the .deb file
- Click on Properties
- Click on the “Open With” tab on the right
- Click on gdebi from the list of applications
- Click on “Set as default”
- And close the window. Now all .deb files will be opened up with gdebi by default
How to update .deb files on Ubuntu
Some .deb packages (like Chrome) add their repos to the system (apt), so if they did, you will be able to update that app via the Software Center/CLI while you’re updating all other software as you would normally do.
If it doesn’t add the repository to apt, then you’ll first need to remove the older version and then reinstall a newer version of the .deb file.
How to remove .deb files on Ubuntu
If you installed a .deb package and now need to remove it, you can do it using several methods.
The easiest method is by checking if the package is in the Ubuntu Software Center (Installed tab). If it is, you can remove it from there like you would any other app. Alternatively, you can also use the Synaptic Package Manager.
If using the Terminal, you can run:
sudo apt-get remove packageName
Alternatively, you can use dpkg:
sudo dpkg -r packageName
If you don’t know the package name, you can find it by running:
apt-cache search appKeyword
And that’s it. That’s all you need to know about installing .deb files on Ubuntu
Got any questions? Leave a comment below.