How to Run A Deb File on Ubuntu

Ubuntu is one of the most popular and widely-used Linux-based Operating Systems. It is renowned for its user-friendly interface, reliability, and low hardware requirements. It provides support for a wide range of packages and software that make it a great choice for developers, enthusiasts, and professionals. One of the most popular package formats that Ubuntu supports is a “deb” file. A deb file is a binary package format used by Debian-based systems and contains software packages, dependencies, and configuration files. If you have just switched to Ubuntu from another operating system and are not familiar with the deb packages, you may find it challenging to install software and packages downloaded from the internet. This blog post will teach you how to run a deb file on Ubuntu in multiple ways to help you install the software you need.

Video Tutorial:

Why You Need to Run a Deb File on Ubuntu

Ubuntu Software Center provides an easy and efficient way to install a wide range of software. You can search, install, and manage software packages via GUI in just a few clicks. However, some people prefer to download software and packages from third-party sources that may not be in the official Ubuntu repositories. In such cases, you may have to download a Debian package (.deb file) and install it manually in Ubuntu. Additionally, a deb file provides a faster, more convenient and reliable way to install software in the terminal. Installing packages via the command line is generally faster, and the terminal provides more granular control over the installation process. Running deb files on Ubuntu can also be useful when you need to test the latest version of a package or install software not yet included in the official Ubuntu repositories.

Method 1: Using Gdebi

Gdebi is a graphical package installer in Ubuntu used to install, view, and remove packages. It is a user-friendly tool and provides straightforward installation of packages. Follow these steps to install a deb file in Ubuntu via Gdebi.

Step 1: Open the terminal by pressing Ctrl + Alt + T or search the terminal in the Ubuntu launcher.

Step 2: Download the deb file from the internet and save it to the Downloads folder.

Step 3: Type the following command in the terminal to install Gdebi.
"`
sudo apt install gdebi
"`
Step 4: Next, navigate to the downloaded deb file location in the terminal. For example, if you downloaded a file named "package.deb" in the Downloads folder, type the following command in the terminal.
"`
cd ~/Downloads
"`
Step 5: Type the following command to run the Gdebi installer for the downloaded package.
"`
sudo gdebi package.deb
"`
Step 6: The Gdebi GUI package installation window will open containing details of the package you want to install, such as its name, version, and size. Click the Install Package button to proceed.

Step 7: Enter your Ubuntu password if prompted, and the package installation process will begin. Wait for the package to install, and once complete, the installation window will close.

Pros:

  • Gdebi provides a simple and straightforward way to install packages.
  • It automatically installs dependencies required by the package, making it convenient to use.
  • With Gdebi, you can view the details of the package before installation.

Cons:

  • Gdebi does not provide much granular control or options for configuring the installation.

Method 2: Using the dpkg command

The dpkg command is a simple, yet powerful command-line tool used to install, remove, and manage .deb packages in Debian and Ubuntu systems. You can install deb files on Ubuntu using the dpkg command if you are comfortable with the command line. Here’s how:

Step 1: Open the terminal by pressing Ctrl + Alt + T or search for the terminal in the Ubuntu launcher.

Step 2: Download the deb file from the internet and save it to the Downloads folder.

Step 3: Type the following command in the Terminal to navigate to the downloaded package location. For example, if your downloaded deb file is located in the Downloads folder, type:
"`
cd ~/Downloads
"`
Step 4: Run the following command in the terminal to install the package.
"`
sudo dpkg -i package.deb
"`
Step 5: Enter your Ubuntu password when prompted. The installation process will start, and you will see the progress in the terminal.

Step 6: If the dpkg command prompts you with any dependency errors, run the following command to fix dependencies.
"`
sudo apt-get install -f
"`
Step 7: Wait for the installation process to complete. The installation process may take some time, depending on the size and complexity of the package.

Pros:

  • The dpkg command provides more granular control over package installation and configuration.
  • The dpkg command is fast and reliable.

Cons:

  • The dpkg command does not automatically install dependencies required for the package.
  • You may need to manually fix dependency issues if they occur.
  • The dpkg command does not have a graphical interface, making it less user-friendly for new Ubuntu users.

Method 3: Using the apt command

Ubuntu comes with the Advanced Packaging Tool (apt), a command-line tool used to install, remove and manage Ubuntu packages. The apt command is a convenient and straightforward way to install deb files in Ubuntu. Here’s how:

Step 1: Download the deb file from the internet and save it to the Downloads folder.

Step 2: Open the terminal by pressing Ctrl + Alt + T or search for the terminal in the Ubuntu launcher.

Step 3: Navigate to the Downloads folder using the cd command. For example:
"`
cd ~/Downloads
"`
Step 4: Install the package using the apt command by typing:
"`
sudo apt install ./package.deb
"`
The Ubuntu system will check for package dependencies and prompt you to confirm installation by pressing the Y key. Press “Y” and hit enter to start the installation.

Step 5: The apt command will install the deb package, and you can monitor the installation process in the terminal.

Pros:

  • The apt command is user-friendly and provides convenient dependency handling.
  • The apt command provides the most up-to-date version of the package, if available, from Ubuntu’s repositories.
  • The apt command installs packages from trusted sources, reducing the risk of installing compromised software.

Cons:

  • The apt command does not provide much granular control for configuring package installation.
  • The apt command may not be useful for installing packages that are not available in the Ubuntu repository.

Method 4: Using Ubuntu Software Center

The Ubuntu Software Center is a graphical user interface program used to search, install and manage software packages in Ubuntu. It provides a comprehensive list of packages available in the Ubuntu repository and a convenient method for installing .deb files. Here’s how to install a deb file via the Ubuntu Software Center:

Step 1: Double-click on the deb file you downloaded to open it.

Step 2: The package installer will open. Click on the Install button to start the installation process.

Step 3: Enter your Ubuntu password if prompted.

Step 4: Wait for the package to install, and once complete, the installation window will close.

Pros:

  • The Ubuntu Software Center provides a user-friendly graphical interface and dependency handling.
  • The Ubuntu Software Center automatically installs package dependencies.
  • The Ubuntu Software Center provides a comprehensive library of software available in the Ubuntu repositories.

Cons:

  • The Ubuntu Software Center may not be able to install packages not present in the Ubuntu repositories.
  • The Ubuntu Software Center may provide dated package versions.

What to Do If You Can’t Run A Deb File on Ubuntu

If for some reason you are unable to install deb files on Ubuntu, you could try the following fixes.

1. Check if the deb file is compatible with your system architecture. Deb files come in 32-bit and 64-bit versions. Ensure that you download the appropriate version for your system architecture.

2. Make sure that you have proper system updates. Type the following command to update system libraries that are essential for installing the downloaded deb file.
"`
sudo apt-get update && sudo apt-get upgrade
"`
3. If the deb file shows some errors while installing, you can try installing it via the dpkg or apt-get commands.

Bonus Tips

1. Make sure to download packages or software from a trusted source only.
2. Always perform a virus scan on downloaded .deb files to avoid installing compromised software.
3. Avoid using sudo with unverified or unknown software packages.

5 FAQs

Q1: What are deb files?

A: A deb file is a binary package format used by Debian-based systems and contains software packages, dependencies, and configuration files.

Q2: Why can’t I run my deb file on Ubuntu?

A: You may not have installed or have dependencies required for the package.

Q3: Can I install deb files on other Linux-based operating systems?

A: Yes, you can install deb files on most Debian-based systems like Debian, Mint, etc.

Q4: How can I remove a deb package installed on Ubuntu?

A: You can remove a package installed via “dpkg” using the command:
"`
sudo dpkg -r package-name
"`
If the package was installed via “apt,” use the command:
"`
sudo apt remove package-name
"`

Q5: What happens if I install a compromised .deb file?

A: Installing a compromised .deb file might harm your system, exposing your personal information and private data or even render your system unusable.

Final Thoughts

Installing software via a deb package in Ubuntu is a practical and efficient way of installing packages. It provides a granular level of control over the installation process and can save you time searching for software via the Ubuntu Software Center. With the options we have discussed above, you now have multiple ways of installing .deb files, depending on your expertise and preference. However, ensure that before installing any software package, you download from trusted sources and always verify package authenticity before installing.{"@context":"https://schema.org”,"@type":"FAQPage","mainEntity":null}