Skip to content

Install Deb files

There are many ways to install packages in debian based linux (debian/ubuntu/Mint). There are two main ways to install packages: - use the package manager such apt-get/apt to connect to package repo servers. - use the standalone .deb file

In this tutorial, we will focus on how to install packages via deb files. There are mainly four ways: - Use the GUI (available in ubuntu desktop) - Use apt (e.g. sudo apt install ./filename.deb) - Use dpkg (e.g. sudo dpkg -i ./filename.deb) - Use gdebi ()

1. Use apt

# be sure to 
cd path/to/deb

# don't miss ./, without it apt will search them in the package repo instead of local file system.
sudo apt install ./filename.deb

# list all installed 
sudo apt list --installed

# remove package name
sudo apt remove package-name

2. Use dpkg

# check the metadata of .deb file
dpkg --info package-name.deb

# install a deb file via dpkg, the -i option means install, it's case sensitive
sudo dpkg -i ./filename.deb

# if all required packages is already installed on the system, then we can stop here, if not
# we need to run the below command, it fixes all missing dependencies
sudo apt-get install -f

# To see a list of all installed packages with Dpkg, use the command 
sudo dpkg-query -l

# remove packages with Dpkg using 
dpkg -r packagename

3. Use gdebi

gdebi is a tool specially developed for installing .deb files. It has a core and GUI. Actually gdebi is just a front-end to the dpkg with added functionality that it can check for dependency packages in the repositories and can install them in one-operation, while dpkg -i requires two operations manually (later being apt-get -f install).

If the dependency packages exists in a repository which is not in the system source list, the gdebi installation will fail. You need to enable all required package repo before running the command.

# the gdebi-core allows you to install .deb file via command line
sudo apt install gdebi-core

# install a .deb via gdebi
sudo gdebi ./filename.deb

# if you want to have GUI integration, you need to install main gdebi package too
sudo apt install gdebi

# this will add more options in the filesytem GUI, when right click on a .deb file in the filesytem ui, you will get
# options to install it via gdebi

# to remove a package installed by gdebi,
sudo apt remove packagename
sudo apt autoclean