How To Run Deb File In Ubuntu

How To Run Deb File In Ubuntu

Reading time1 min
#Linux#Ubuntu#Software#Debian#PackageManagement#DPKG

Mastering the Art of Running .deb Files in Ubuntu: From Basics to System Integration

Forget blindly clicking through GUI installers or struggling with unmet dependencies—this guide reveals a systematic, expert-approved approach to running .deb files that ensures seamless installation and better system control.

If you’re an Ubuntu user or developer looking to expand your software options beyond the official repositories, learning how to run .deb packages efficiently is essential. .deb files are Debian package files used not only by Ubuntu but numerous Debian-based distributions to install software. Understanding their proper installation process helps you manage software smoothly, handle dependencies gracefully, and avoid common pitfalls that can compromise your system’s stability.

Let’s dive into the nuts and bolts of running .deb files on your Ubuntu system, step by step.


What is a .deb File?

A .deb file is an archive that contains the installer scripts and binaries for a piece of software. Think of it as an installation package tailored specifically for Debian-based Linux systems like Ubuntu.

Instead of downloading software from application stores or using apt from configured repositories, a .deb file lets you install third-party or locally built applications directly.


Why Use .deb Files?

  • Access Software Not Available in Standard Repositories: Some developers distribute their software only as .deb packages.
  • Offline Installation: If you don’t have internet access on your Linux machine, you can download .deb files elsewhere and port them in.
  • Custom or Pre-release Software: Test specific versions without waiting for repository updates.

How to Run a .deb File in Ubuntu — The Basics

1. Download the .deb File

Download your desired .deb package from a trusted source—for example, from the official website of a popular software or GitHub releases page.

Example:

wget https://example.com/sample_software_1.0_amd64.deb

2. Install Using dpkg

The core tool for handling Debian packages is dpkg.

Run:

sudo dpkg -i sample_software_1.0_amd64.deb

The -i flag stands for install.

What Happens Here?

  • The package content installs in appropriate directories (/usr/bin/, /usr/share/, etc.).
  • Post-install scripts run if included.
  • However, if required dependencies are missing, dpkg will warn you but will not automatically resolve them.

3. Fix Dependency Issues

If you encounter errors like:

dpkg: dependency problems prevent configuration of sample_software:
 sample_software depends on libfoo (>= 1.2); however:
  Package libfoo is not installed.

You can fix this by running:

sudo apt-get install -f

The -f flag tells APT to fix broken dependencies by installing what is missing. This command reviews the current installations and tries to resolve all outstanding dependency issues caused by manual installations such as those with dpkg.


Alternative: Use apt Directly with Local Files (Recommended)

Starting with newer versions of APT (Ubuntu 16.04+), you can install local .deb files using:

sudo apt install ./sample_software_1.0_amd64.deb

or

sudo apt install /path/to/sample_software_1.0_amd64.deb

Advantages:

  • It automatically resolves and downloads required dependencies.
  • Simplifies management compared with manual dpkg -i + apt-get install -f.

Graphical Approach Using Software Center

If CLI isn’t your style:

  1. Locate the .deb file in your Files manager.
  2. Double click it.
  3. The Ubuntu Software Center will open showing package details.
  4. Click Install.
  5. Enter your password when prompted.

Note: The GUI installer also tries to resolve dependencies but isn’t always as robust as terminal commands in troubleshooting complex issues.


Example: Installing Google Chrome via .deb

Google Chrome isn’t available in Ubuntu’s default repos but distributes official builds as .deb.

Download Chrome:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

Install it:

sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get install -f      # Fix any dependency issues if needed

Or simply:

sudo apt install ./google-chrome-stable_current_amd64.deb

Now launch Chrome from terminal by typing:

google-chrome-stable &

How To Remove Installed Packages (.deb)

Removing a package installed from a .deb is just as simple using apt remove. For example:

sudo apt remove sample_software

Or if you want to purge config files too:

sudo apt purge sample_software

For manual removal using dpkg, you could run:

sudo dpkg -r sample_software

But it’s better to stick with APT because it manages dependencies thoughtfully.


Troubleshooting Tips

  • Dependency Hell? Always try installing with apt install ./package.deb. It’s smarter about resolving deps.

  • Check Package Info:

    dpkg-deb -I sample_software_1.0_amd64.deb
    
  • Force Reinstall or Repair Broken Packages

    sudo dpkg --configure -a    # Configure any unpacked but unconfigured packages 
    sudo apt-get install -f      # Fix broken installs 
    
  • Inspect Installed Files

    dpkg -L sample_software  
    

Conclusion

By mastering how to run .deb files properly on Ubuntu, you gain greater control over your software environment beyond relying solely on packaged repositories or snaps. Using tools like dpkg, paired smartly with apt, helps ensure your installations are clean, dependencies managed smoothly, and your system remains stable.

Whether downloading proprietary apps, beta builds, or niche utilities delivered via .deb, these strategies bridge convenience with system integrity—empowering both Linux newcomers and power users alike.

Happy installing!


If you found this helpful or want more Linux tips delivered straight to your inbox, subscribe below or leave a comment sharing your own experiences running .deb packages!