I am a new Ubuntu Linux user. How can I install a package called package.deb? Can I use Synaptic front-end package management tool to install packages from the CD or Internet such as apt command or apt-get command. However, I would like to install a special .deb file. How do I install .deb package from the terminal using command line option in Ubuntu Linux or Debian Linux?
You need to use the dpkg command, which is a package manager from shell/command prompt for Debian and Ubuntu Linux. You can use this tool to install, build, remove and manage packages. dpkg itself is controlled entirely via command line parameters.
How Do I install .deb Packages on an Ubuntu Linux?
The syntax is as follows to install .deb file via the command line:
dpkg -i package-name-here.deb dpkg --install package-name-here.deb dpkg -i -R /path/to/dir/name/with/lots/of/dot-deb-files/ dpkg -i --recursive /path/to/dir/name/with/lots/of/dot-deb-files/
- -i or --install : Install the .deb package on Ubuntu Linux.
- -R or --recursive : Recursively installed all *.deb files found at specified directories and all of its sub-directories. /path/to/dir/name/with/lots/of/dot-deb-files/ must refer to a directory instead of package-name-here.deb file name.
How do I install .deb file on Ubuntu?
To install a single package file called /tmp/package.deb type the following commands. Open a terminal and then cd to directory where package.deb is kept. In this example, package.deb is kept in /tmp directory:
$ cd /tmp
Type the following command to install the package:
$ sudo dpkg -i package.deb
OR as root user:
# dpkg -i package.deb
How do I install a atop_2.3.0-1_amd64.deb file via the bash command line?
Say you downloaded a deb file named atop_2.3.0-1_amd64.deb:
$ ls -l *.deb
To install .deb packages named atop_2.3.0-1_amd64.deb, run:
$ sudo dpkg -i ./atop_2.3.0-1_amd64.deb
Install all packages from /nfs/pkgs/ubuntu-builds directory
Recursively handle and install all regular files matching pattern *.deb found at /nfs/pkgs/ubuntu-builds/ directory and all of its subdirectories, type:
$ sudo dpkg -i -R /nfs/pkgs/ubuntu-builds/
# dpkg -i -R /nfs/pkgs/ubuntu-builds/
A note about GUI tools
Open your file manager. Visit folder such as ~/Downloads/ or /tmp/. Choose .deb file. Double click on the .deb file and installation will start automatically. It works if you have a GUI installed on your system or server:
Next a dialog box comes on screen as follows:
Click on the Install button. You must authorized yourself to install software/.deb package file:
Once authenticated, .deb file install and you will see progress as follows:
You learned about installing deb package on an Ubuntu Linux using the dpkg command. For more info see the following pages:
- dpkg Command Cheat Sheet
- See man pages for more information – deb(5)