How To Linux How to Install .deb Packages Use the Command Line Tool 'dpkg' in a Debian-Based Linux Distribution Share Pin Email Print Linux Guides & Tutorials Basics Installing & Upgrading Tips & Tricks Commands Key Concepts by Juergen Haas A software developer, data scientist, and a fan of the Linux operating system. Updated October 20, 2018 41 41 people found this article helpful Every Linux distribution based on Debian uses Debian packages as a method for installing and uninstalling the software. Debian packages are identified by the file extension .deb. They can be installed and uninstalled using graphical tools and the command line. Why Install a .deb File Manually Most of the time you use a package manager such as the Ubuntu Software Center, Synaptic, or Muon to install the software in Debian-based distributions. If you prefer to use the command line, you are likely to use apt-get. Some applications aren't available in the repositories and have to be downloaded from the vendors' websites. Be careful about downloading and installing Debian packages from sources that do not exist in the distribution's repositories. Some of the biggest applications are delivered in this format, including Google's Chrome web browser. For this reason, it is important to know how to install the packages manually. Where to Get a .deb File For demonstration purposes, you need a .deb file to install. This example uses the .deb file for a QR Code Creator. A QR code is one of those funny-looking symbols you see just about everywhere. When you focus on the QR Code with your mobile device, it takes you to a web page, almost like a hyperlink. On the QR Code Creator page, there is a .deb file. Clicking on the link downloads the .deb file to your downloads folder. How to Install .deb Packages The tool used to install and uninstall Debian packages is called "dpkg." It is a command line tool. Through the use of switches, you can do many different things with it. The first thing you want to do is install the package. Type the following into the command line: sudo dpkg -i <packagename> For example to install the QR Code Creator the command is as follows: sudo dpkg -i qr-code-creator_1.0_all.deb If you prefer, you can also use --install instead of -i as follows: sudo dpkg --install qr-code-creator_1.0_all.deb What Is in a .deb File? If you have ever wondered what makes up a .deb package, you can run the following command to extract the files from a package without installing it. dpkg-deb -x qr-code-creator_1.0_all.deb ~/qrcodecreator This command extracts the contents of the qr-code-creator package into a folder called qrcodecreator located in the home folder (/home/qrcodecreator). The destination folder qrcodecreator must already exist. In the case of qr code creator, the contents are as follows: usrusr -> binusr -> bin -> qr-code-creatorusr -> shareusr -> share -> applicationsusr -> share -> applications -> qr-code-creator.desktopusr -> share -> docusr -> share -> doc -> qr-code-creatorusr -> share -> doc -> qr-code-creator -> changelog.gzusr -> share -> doc -> qr-code-creator -> copyrightusr -> share -> manusr -> share -> man -> man1usr -> share -> man -> man1 -> qr-code-creator.1.gzusr -> share -> pixmapsusr -> share -> pixmaps -> qr-code-creator.pngusr -> share -> qr-code-creator Removing .deb Packages Remove a Debian package using the following command: sudo dpkg -r <packagename> If you want to remove the configuration files as well, use the following command: sudo dpkg -P <packagename Note: If you are using a Ubuntu-based distribution, just double-click on the .deb file, and it loads into the Software Center. Then, click install. Continue Reading