Install DEB file on Ubuntu 20.04 Focal Fossa Linux

A file that has the .DEB file extension is a Debian software package file. They contain software to be installed on Debian or a Debian-based operating system. Ubuntu falls into that category, being based on Debian and capable of executing .DEB files.

In this article, we’ll go over the steps to install a DEB file on Ubuntu 20.04 Focal Fossa and talk about some best practices along the way.

In this tutorial you will learn:

  • DEB file security and searching Ubuntu’s package repository
  • How to intall DEB files with dpkg
  • How to install DEB files with gdebi
  • How to install DEB files via GUI
  • Install DEB file on Ubuntu 20.04

    Install DEB file on Ubuntu 20.04

    Software Requirements and Linux Command Line Conventions
    Category Requirements, Conventions or Software Version Used
    System Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa
    Software None
    Other Privileged access to your Linux system as root or via the sudo command.
    Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
    $ – requires given linux commands to be executed as a regular non-privileged user

    A word of warning

    Before you jump into installing a DEB file on your system, realize that installing software from third party sources can have a negative impact on the stability and security of your Ubuntu system. Only install DEB files if you’re confident about the source of the file and can verify its integrity.

    One of the awesome things about Ubuntu and other flavors of Linux is that they have a myriad of stable, tested, and secure software available in their software repositories, only a short download away. Before installing a DEB file, you should check Ubuntu’s repository first to see if the software is already available from there.

    To search Ubuntu’s package repository for a package, open a terminal and type the following command:

    $ apt search SOME-KEYWORD
    


    apt search shows that net-tools package is available

    apt search shows that net-tools package is available

    If you see the desired package within the output returned from apt, take note of the package’s name and install it with this command:

    $ sudo apt install PACKAGE-NAME
    

    Install DEB file using dpkg

    Using the dpkg command is the first method we’ll go over for installing DEB packages and is also probably the most common. Run the command like this, while replacing example.deb with the name of your package:

    $ sudo dpkg -i example.deb
    
    Using dpkg to install DEB file

    Using dpkg to install DEB file

    If the package requires dependencies that aren’t already on your system, you’ll see this error in the terminal:

    dpkg: error processing package
    

    Don’t fret, because we can install the required dependencies with a single command, assuming that they are available in Ubuntu’s package repository. Just run this command to install the dependencies:

    $ sudo apt install -f
    

    Install DEB file using gdebi

    Using the gdebi command to install DEB packages is even better than dpkg because it will automatically download and install any required dependencies, while of course installing the DEB file itself.

    The gdebi command may not be available on your system by default, so you’ll have to install the gdebi-core package in order to access it. Use this command to install gdebi-core:

    $ sudo apt install gdebi-core
    

    Now that the gdebi command is available, use it to install your package by executing this command:

    $ sudo gdebi example.deb
    

    gdebi will prompt you to ask whether or not to install the file, just enter y for ‘yes’ and allow the installation proceed.



    Install DEB file via GUI

    If you prefer to use the GUI instead of command line, this section is for you. Follow these steps to install a DEB file on your Ubuntu system via GUI:

    1. Right click on the DEB file you wish to install and select Open With Software Install.
      Open With Software Install

      Open With Software Install

    2. The next window will give you a little information about what you’re installing. Click the Install button to continue.
      Click install to proceed

      Click install to proceed

    3. Installing software always requires administrator privileges. Enter your password to proceed with the installation.
      Enter admin password

      Enter admin password



    4. The DEB file is now installed on your system. As you can see, the Install button has been replaced with a Remove button, which you can use later in case you need to uninstall the software.
      DEB file successfully installed

      DEB file successfully installed

    Conclusion

    In this article, we learned how to install DEB file packages on Ubuntu 20.04 Focal Fossa. We covered two different command line options for the installation, as well as a GUI alternative.

    We also learned of the potential dangers that lie with DEB files, and how to search Ubuntu’s repository as a preferred installation source. Now that you know how to install DEB files, stay safe by only installing them from sources you trust.