How to install .deb packages in Ubuntu?

Debian (.deb) packages are the packages that are used in Ubuntu. You need to have administrative privileges to install a .deb file.

.deb files can generally be installed from your file manager (Nautilus – default file manager in Ubuntu) by simply double clicking them and selecting Install Package, since file associations with the default installer is already set in Ubuntu.

To install .deb files from shell/command prompt you can use the dpkg command. dpkg is a package manager for Debian based systems. It can install, remove, and build packages, but unlike other package management system’s it can not automatically download and install packages and their dependencies.

To install the local .deb file downloaded on your system, cd to the directory where the file is present and run the following command:


$ sudo dpkg -i package-name.deb

or


$ sudo dpkg --install package_name_version.deb

If you have many .deb files downloaded in a directory say /tmp/downloaded-packages/, then you can run the following command to install all the .deb files present in the directory and its sub directories:


$ sudo dpkg -i -R /tmp/downloaded-packages/

or


$ sudo dpkg -i --recursive /tmp/downloaded-packages/

To reconfigure/repair an installed .deb package, run the following command:


$  sudo dpkg-reconfigure package_name

dpkg command can be used to view the list of packages installed in the system, all the files installed by package etc; you can read the Ubuntu guide for details.

You can also use GDebi to install packages. GDebi lets you install local deb packages resolving and installing its dependencies. apt does the same, but only for remote (http, ftp) located packages.

You may first need to install GDebi. Open a Terminal and type:


$ sudo apt-get install gdebi

Now just right click on the .deb file and choose to install it with GDebi.

Leave a Comment

Back to top