5 Best Methods to Install .deb Ubuntu

Written by

Reviewed by

Last updated: June 13, 2024

Expert verified

SVG Image

TL;DR

To install .deb Ubuntu, follow these steps:

  1. Open the Terminal by pressing Ctrl + Alt + T.
  2. Navigate to the directory containing the .deb file using cd /path/to/your/file.
  3. Install the .deb file with sudo dpkg -i filename.deb (replace filename.deb with your file name).
  4. Enter your password when prompted to authorize the installation.
  5. Update your system and resolve any dependencies by running sudo apt update.

Explore the article below to learn how to install deb file in Ubuntu, common errors, and best practices for managing deb files.

You’ve probably downloaded a software package and wondered how to install it on Ubuntu. There’s a straightforward solution to manage these installations. In this post, I’ll guide you through different methods to install .deb Ubuntu using both command-line and graphical interfaces.

You’ll learn how to efficiently handle package installations, updates, and removals to keep your system running smoothly. Whether you’re a beginner or an advanced user, this guide will provide you with the necessary steps and best practices to maintain an organized and efficient Ubuntu system. Let’s make your software management easier!

What is a .deb File?

A .deb file is a software package format used by Debian-based Linux distributions like Ubuntu. It contains all the files and information needed to install a software program on your system. Think of it as a zip file for software, it bundles everything required for the installation process, making it easy to distribute and install programs.

Importance of .deb Files

  1. Standardization: .deb files create a standard way to package and distribute software for Debian-based systems. This standardization ensures that software developers can create a single package that works across multiple distributions like Debian, Ubuntu, and Linux Mint.
  2. Ease of Installation: Using .deb files makes installing software straightforward. Users can simply download a .deb file and install it with a few commands or a double-click, without needing to compile the software from source.
  3. Dependency Management: .deb files help manage dependencies, which are other software libraries and tools that a program needs to run. The package management system automatically checks and installs these dependencies, ensuring that all required components are present for the software to function correctly.
  4. Consistency: By using .deb files, Debian-based distributions maintain a consistent method for software installation and updates. This consistency helps prevent conflicts and issues that can arise from using different installation methods.
  5. Integration with Package Managers: .deb files integrate seamlessly with package managers like apt, dpkg, and gdebi. These tools provide a user-friendly way to install, update, and remove software, making system maintenance easier.

How to Install .deb Ubuntu Using CLI

To install .deb Ubuntu using CLI, first open the Terminal by pressing. Navigate to the directory containing the .deb file with the cd command. Use sudo dpkg -i filename.deb (replace filename.deb with your file name) to install the file. Enter your password when prompted to authorize the installation. Finally, resolve any dependencies by running sudo apt update to ensure all system packages are up-to-date.

That was the quick answer. Here are the detailed steps for two different methods to Ubuntu install deb file:

1. dpkg Command

Installing deb files through the Terminal offers a powerful and flexible approach, allowing advanced users to have precise control over the installation process and execute commands efficiently. Here’s a step-by-step guide to install .deb Ubuntu:

  1. Open the Terminal by pressing Ctrl+Alt+T.
opening terminal 6
  1. Navigate to the directory containing the deb file using the cd command.
navigating to directory 1
  1. Install the deb file using the following command: 
sudo dpkg -i filename.deb

Replace filename.deb with the actual name of your deb file.

installing deb file using terminal
  1. If prompted, enter your password to authorize the installation.
  2. Update your system to resolve any dependencies by running 
sudo apt update
  1. The command will update the system packages.
updating system packages 2

2. APT Package Manager

Ubuntu’s APT package manager offers automatic dependency resolution and streamlined package management, enabling users to easily install deb files on Ubuntu while maintaining system stability. Here’s how to install .deb on Ubuntu using APT:

  1. Open the Terminal by pressing Ctrl+Alt+T and update the package list by running the command:
sudo apt update
updating system packages list
  1. Install the deb file using the following command: 
sudo apt install ./filename.deb 

Replace filename.deb with the actual name of your deb file.

installing deb file using apt package manager

How to Install .deb Files on Ubuntu Using GUI

To install .deb Ubuntu using GUI, open the Ubuntu Software Center from the application menu. Use the search bar to find the .deb file you want to install. Click on the file to open its details page, then click the Install button. Enter your password if prompted to authorize the installation.

Alternatively, you can use Gdebi Package Installer by right-clicking the .deb file, selecting Open with Gdebi Package Installer, and then clicking the Install Package button. Both methods provide a user-friendly way to install .deb files without using the command line.

Here is the detailed step-by-step guide for three different methods to install .deb files using GUI:

1. Ubuntu Software Center

The Ubuntu Software Center provides a user-friendly graphical interface, making it a convenient choice for users who prefer a straightforward and intuitive method to install deb files on Ubuntu. Follow these steps:

  1. Open the  Ubuntu Software Center by searching for it in the application menu.
opening ubuntu software
  1. Use the search bar to find the deb file you wish to install. Click on the deb that you want to install  to open its details page.
searching for deb file to install
  1. Click the Install button to begin the installation process.
click on install button to install deb files on Ubuntu
  1. Enter your password, if prompted, to authorize the installation.
enter password to aunthenticate

2. Gdebi Package Installer

Gdebi Package Installer simplifies the installation of deb files, providing a dedicated tool that ensures smooth installation, handles dependencies, and offers a streamlined experience. Follow these steps to deb file install Ubuntu:

  1. Install Gdebi from the Ubuntu Software Center by searching for Gdebi and clicking the Install button.
installing Gdebi on ubuntu
  1. Locate the deb file you want to install.
locating deb file
  1. Right-click on the file and choose Open with Gdebi Package Installer.
open file with Gdebi package installer
  1. Gdebi will open and display information about the package. Click the Install Package button to proceed.
installing package through Gdebi

3. Synaptic Package Manager

Synaptic Package Manager provides a comprehensive graphical interface for managing packages, offering advanced features and fine-grained control over deb file installations and configurations. To install deb files using Synaptic, follow these steps:

  1. Install Synaptic from the Ubuntu Software Center by searching for Synaptic and clicking the Install button.
installing synaptic package manager
  1. Open Synaptic from the application menu.
opening synaptic manager
  1. Use the search bar to find the deb file you want to install. Select the package from the search results and click the Apply button to begin the installation process.
using synaptic manager to install deb file packages

How to Remove .deb Packages?

Removing unnecessary or unwanted packages can help free up space and keep your system organized. Here are various methods to delete .deb packages on Ubuntu.

1. Using apt

apt is a high-level package management command-line tool that handles installation, updates, and removal of packages.

  1. Press Ctrl + Alt + T to open the terminal.
  2. Use the following command to remove the package:
sudo apt remove package_name

Replace package_name with the name of the package you want to remove.

removing a deb package using apt
  1. After removing the package, clean up any dependencies that are no longer needed:
sudo apt autoremove
removing unnecessary depedencies

2. Using dpkg

dpkg is a low-level package manager for Debian-based systems, allowing direct control over package installation, removal, and querying.

  1. Access your command window.
  2. Use the following command to remove the package:
sudo dpkg -r package_name

Replace package_name with the name of the package you want to remove.

removing a deb package using dpkg
  1. Use the following command to remove dependencies that are no longer needed:
sudo apt autoremove
removing unnecessary depedencies 1

3. Using Ubuntu Software Center

The Ubuntu Software Center provides a graphical interface to manage software packages, making it easy to install and remove applications.

  1. Open the Software Center from the application menu.
launching ubuntu software from application menu
  1. Use the search bar to find the package you want to remove.
searching for package in ubuntu software center
  1. Click on the package and select Remove to uninstall it.
removing a package using ubuntu software center

How to Update Installed .deb Packages

Keeping your packages up to date is essential for security and performance. Updating installed .deb packages ensures you have the latest features and bug fixes.

  1. Launch your Terminal. Ensure your package list is up-to-date by running the following command:
sudo apt update

This command refreshes the list of available packages and their versions.

updating system package list 3
  1. Upgrade all the packages on your system to their latest versions with:
sudo apt upgrade

This command will install the latest versions of all the packages currently installed on your system.

upgrading system packages to latest version
  1. To check if a specific package installed via a .deb file has an available upgrade, use:
sudo apt list --upgradable

This command lists all the packages that have newer versions available.

If a newer version is available for a specific package, download the updated .deb file from the official source.

Install the downloaded .deb file using one of the methods mentioned earlier (e.g., dpkg, gdebi, apt).

checking if the package has an available upgrade

Best Practices for Managing Installed Deb Files

Managing installed deb files is critical to maintaining a well-organized and efficient Ubuntu system. You can ensure system cleanliness, optimize resources, and streamline the software installation process by effectively keeping track of installed packages, removing unnecessary ones, and leveraging package managers. Here are three best practices:

  • 📦 Keeping Track of Installed Packages: Maintaining an organized record of installed deb packages is crucial for efficient system management. Use tools like dpkg and aptitude to list all installed packages and generate detailed reports. Commands such as dpkg -l help you track package names, versions, and installation dates.
  • 🗑️ Removing Unnecessary Packages: Free up disk space and optimize system performance by removing unused or unnecessary packages. Regularly clean your system of these packages to prevent clutter and potential software conflicts. Use package management tools or graphical interfaces to uninstall packages you no longer need, improving system efficiency and reclaiming valuable disk space.
  • 🚫 Avoiding Manual Package Installations: Rely on package managers for most installations to ensure system stability and ease of maintenance. Package managers like APT automate dependency resolution and simplify updates. Commands like sudo apt update and sudo apt upgrade keep your software current.

Ubuntu deb Install: In a Nutshell

To wrap up, you can install .deb files on Ubuntu using command-line tools like dpkg and apt, or graphical interfaces like the Software Center and Gdebi. Follow best practices by regularly removing unnecessary packages and using package managers for installations and updates. This keeps your system clean, organized, and efficient.

For further learning, I recommend:

  • Discover how to install a specific package version using apt, which will help you manage software versions precisely and ensure compatibility.
  • Learn how to efficiently uninstall software on Ubuntu using Linux uninstaller, helping you keep your system clean and organized.
  • Explore how to fix the “You Have Held Broken Packages” error on Linux to resolve common package management issues and maintain a smooth-running system.

Frequently Asked Questions

How can I check if a deb file is already installed on my system?

To determine if a package installed from a deb file is already on your system, you can utilize the dpkg -l command followed by the package name. This command stands for list and provides a comprehensive list of installed packages. If the specific package is installed, it will be displayed in the output along with its version number and other relevant details. Cross-referencing the package name lets you quickly ascertain its installation status on your system.

Can I install deb files on Ubuntu from sources other than the Ubuntu Software Center?

Absolutely! Ubuntu allows you to install deb files from various sources apart from the Ubuntu Software Center. You can obtain deb files from software repositories, third-party websites, or even directly from developers’ official websites. This flexibility provides users with a wide range of software options. However, it is crucial to exercise caution and verify the authenticity and trustworthiness of these alternative sources to ensure the integrity and security of your system.

Is it possible to downgrade a package installed from a deb file?

Downgrading a package installed from a deb file can be a complex process, as it may involve addressing dependency conflicts and potential system instability. Generally, it is recommended to uninstall the package’s current version first and then install the desired older version using the appropriate deb file. This ensures a clean transition between versions and minimizes the chances of encountering compatibility issues or unintended consequences.

Ojash

Author

Ojash is a skilled Linux expert and tech writer with over a decade of experience. He has extensive knowledge of Linux's file system, command-line interface, and software installations. Ojash is also an expert in shell scripting and automation, with experience in Bash, Python, and Perl. He has published numerous articles on Linux in various online publications, making him a valuable resource for both seasoned Linux users and beginners. Ojash is also an active member of the Linux community and participates in Linux forums.

Akshat

Reviewer

Akshat is a software engineer, product designer and the co-founder of Scrutify. He's an experienced Linux professional and the senior editor of this blog. He is also an open-source contributor to many projects on Github and has written several technical guides on Linux. Apart from that, he’s also actively sharing his ideas and tutorials on Medium and Attirer. As the editor of this blog, Akshat brings his wealth of knowledge and experience to provide readers with valuable insights and advice on a wide range of Linux-related topics.

Share this article
Shareable URL
Prev Post

How to Create a Directory in Linux Using mkdir Command [5 best Methods]

Next Post

How to Kill Tmux Session [4 Best Methods]

Leave a Reply

Your email address will not be published. Required fields are marked *

Read next