Install Deb Files in Ubuntu Command Line
Learn all about installing, removing and updating applications from deb files in the Ubuntu command line.
— Abhishek
Installing deb files in Ubuntu is not difficult. You just have to double-click on it and it gets opened in the Software Center.
That works in most cases if you are running it on a desktop. It may not work if you are running an Ubuntu server and there is no GUI.
If you download the deb file and want to install it using command line, you can do that easily as well.
You can use the apt command to install deb packages in the terminal like this:
sudo apt install path_to_deb_fileIf you are in the same directory as the deb file, you must add ./ before the deb file name.
sudo apt install ./deb_fileThe apt command is not the only way here. There are other ways you can use to install deb files in the command line.
Let's see it in a bit more detail. I presume that you have already downloaded the deb files here.
Using apt command to install deb files in the terminal (recommended)
This is the method I recommend. Why? Because it installs the deb files with the dependencies. You'll need an active internet connection to download and install the dependencies of course.
To install deb files with the apt command, you need to either provide the path of deb file:
sudo apt install path_to_deb_fileOr, change the directory and be in the same location as the deb file but add ./before the deb file name:
sudo apt install ./deb_fileMake sure that the deb file doesn't have space in its name or else it may create issues.
Let me share a practical example where I install the Darktable application using the deb file I downloaded from its website: