Understanding how to install software is a fundamental skill for any Ubuntu user. While the Ubuntu Software Center and the apt command handle most common installations, there are instances where you might need to install a .deb package directly. These packages are the standard format for software on Debian-based systems, including Ubuntu. This guide will walk you through the most common and effective methods for installing .deb files, ensuring you can expand your software library with ease and confidence.
Understanding .deb Packages
A .deb file is essentially an archive containing the files needed to install a program on a Debian or Ubuntu system. It also includes metadata such as the package name, version, and dependencies. Unlike installing from repositories, where apt automatically manages dependencies, installing a .deb file directly can sometimes lead to unmet dependency issues if not handled carefully. Nevertheless, .deb files are prevalent for software that isn’t available in the standard Ubuntu repositories, or for specific versions of software.

The Anatomy of a .deb File
A .deb file is a Debian package archive. Internally, it’s a ar archive that contains at least two additional tar archives:
control.tar.gz(or.xz,.bz2): This contains control information, including package metadata, pre-installation scripts, and post-installation scripts.data.tar.gz(or.xz,.bz2): This contains the actual files to be installed on your system, placed in their correct locations.
When to Install .deb Files
You’ll typically encounter scenarios where installing a .deb file is the most straightforward or only method available:
- Proprietary Software: Many hardware manufacturers and software vendors provide their drivers or applications in
.debformat for easy installation on Ubuntu. - Bleeding-Edge Software: Developers might release newer versions of their software as
.debfiles before they are packaged into official repositories. - Specific Software Versions: You might need a particular version of an application that is not the latest offered by your distribution’s repositories.
- Offline Installations: In situations where internet connectivity is limited, pre-downloaded
.debfiles can be used for installation.
Method 1: Using the Graphical Software Installer
For users who prefer a visual interface, Ubuntu provides a straightforward method to install .deb files using its built-in software installer. This is often the most intuitive approach for beginners.
Opening the .deb File
When you download a .deb file, double-clicking it in your file manager will usually open it with the default “Software” application (or “GDebi Package Installer” if you have it installed).
The Installation Process
- Locate the File: Navigate to the directory where you downloaded the
.debfile. - Double-Click: Double-click the
.debfile. - Software Application: The Ubuntu Software application will launch and display information about the package, including its name, version, and a brief description.
- Click “Install”: You will see an “Install” button. Click it.
- Authenticate: You will be prompted to enter your user password to authorize the installation. This is a security measure to ensure that only authorized users can install software that modifies system files.
- Installation Progress: The Software application will proceed with the installation. You will see a progress bar indicating the status.
- Completion: Once the installation is complete, the “Install” button will change to an “Uninstall” button, indicating that the software has been successfully installed.
Handling Dependency Issues (Graphical)
If the .deb package has unmet dependencies, the Software application will usually inform you. It might offer to search for and install the missing dependencies from the Ubuntu repositories. If it cannot resolve them automatically, you might need to use the command line to install them manually.
Method 2: Using the GDebi Package Installer (Recommended for Dependencies)
While the default Software application is convenient, the gdebi package installer offers a more robust solution for handling dependencies. gdebi can check for and install missing dependencies before installing the .deb file, significantly reducing the chances of a broken installation.
Installing GDebi
If gdebi is not already installed on your system, you can install it using apt:
sudo apt update
sudo apt install gdebi
Using GDebi from the GUI
- Locate the File: Find your
.debfile in the file manager. - Right-Click: Right-click on the
.debfile. - Open With GDebi: Select “Open With Other Application” and then choose “GDebi Package Installer.” If
gdebiis set as the default for.debfiles, a simple double-click might suffice. - Review and Install:
gdebiwill open and analyze the package. It will list any required dependencies. If all dependencies are met or can be installed from your configured repositories, you’ll see an “Install Package” button. Click it. - Authenticate: Enter your password when prompted.
- Completion:
gdebiwill install the package and its dependencies.
Using GDebi from the Command Line
You can also use gdebi directly from the terminal, which is often faster and provides more detailed output.
- Open Terminal: Press
Ctrl + Alt + Tto open a terminal window. - Navigate to Directory: Use the
cdcommand to navigate to the directory where your.debfile is located. For example, if it’s in your Downloads folder:
bash
cd ~/Downloads
- Run GDebi: Execute the following command, replacing
package-name.debwith the actual name of your.debfile:
bash
sudo gdebi package-name.deb
- Dependency Check:
gdebiwill scan for dependencies. It will prompt you to confirm the installation of the package and any missing dependencies. Typeyand press Enter to proceed. - Authentication: Enter your password.
- Installation:
gdebiwill install the package and its dependencies.
Method 3: Using the dpkg Command (Advanced)
The dpkg command is the low-level package manager for Debian-based systems. It’s powerful but less user-friendly than gdebi or the Software application, as it doesn’t automatically handle dependency resolution. However, it’s essential to know for troubleshooting and understanding the package management process.
Installing with dpkg

- Open Terminal: Press
Ctrl + Alt + T. - Navigate: Change your directory to where the
.debfile is located:
bash
cd /path/to/your/deb/file
- Install the Package: Use the
dpkg -icommand followed by the filename:
bash
sudo dpkg -i package-name.deb
Replacepackage-name.debwith the actual name of your.debfile. - Authentication: Enter your password.
Handling Dependency Errors with dpkg
If dpkg encounters unmet dependencies, it will usually output an error message indicating which packages are missing. You will then need to install these missing dependencies using apt before trying to install the .deb file again.
Example of a dependency error:
dpkg: dependency problems prevent configuration of <package-name>:
<package-name> depends on <dependency-name>; however:
Package <dependency-name> is not installed.
To fix this, you would typically run:
sudo apt --fix-broken install
This command tells apt to find and install all missing dependencies for packages that are currently installed but not configured correctly, or for packages that failed to install due to missing dependencies. After running this command, you can attempt to install the .deb file again with dpkg or gdebi.
Understanding dpkg Options
-ior--install: Installs a package.-ror--remove: Removes a package but keeps its configuration files.-Por--purge: Removes a package and its configuration files.-lor--list: Lists installed packages.-sor--status: Shows the status of a package.
Method 4: Using apt with Local .deb Files (Modern Approach)
Since Ubuntu 16.04 LTS, the apt command itself has gained the ability to install local .deb files while also handling their dependencies. This is often the most convenient and recommended command-line method for installing .deb packages.
Installing with apt
- Open Terminal: Press
Ctrl + Alt + T. - Navigate: Change your directory to where the
.debfile is located:
bash
cd /path/to/your/deb/file
- Install the Package: Use the
apt installcommand with the path to the.debfile:
bash
sudo apt install ./package-name.deb
The./is important to specify that you are referring to a file in the current directory. - Authentication: Enter your password.
How it Works
When you use apt install ./package-name.deb, apt first inspects the .deb file to determine its dependencies. It then checks your system and configured repositories to see if these dependencies are available. If they are, apt will download and install them along with your .deb package. This makes it a far more robust method than dpkg alone.
Advantages of using apt
- Automatic Dependency Resolution: This is the primary advantage.
aptintelligently fetches and installs missing dependencies from your configured software sources. - Unified Workflow: You can use
aptfor both repository installations and local.debfile installations, simplifying your command-line workflow. - Better Error Reporting:
aptoften provides clearer error messages and suggestions if an installation fails.
Best Practices and Troubleshooting
When installing .deb packages, a few best practices can save you time and prevent common issues.
Always Update Your Package Lists
Before attempting any installation, especially when dealing with external .deb files, ensure your local package index is up-to-date:
sudo apt update
This fetches the latest information about available packages from your configured repositories, which can help apt or gdebi find necessary dependencies.
Check Software Sources
Ensure that your software sources are correctly configured. If a .deb file’s dependencies cannot be found, it might be because the repositories containing them are not enabled or configured properly. You can manage software sources through “Software & Updates” in your system settings.
Verify Package Integrity
If you download .deb files from unofficial sources, there’s always a slight risk of corruption or malicious modification. Whenever possible, download from official vendor websites or trusted repositories. Some vendors may provide checksums (like MD5 or SHA256) for their .deb files, allowing you to verify their integrity after downloading.

Uninstalling .deb Packages
Once installed, .deb packages are managed by the system’s package manager and can be uninstalled like any other software.
- Graphical: Open the “Software” application, search for the installed program, and click the “Uninstall” button.
- Command Line (apt):
bash
sudo apt remove <package-name>
sudo apt purge <package-name>
Replace<package-name>with the actual name of the package (which might be different from the.debfilename). You can find the package name usingdpkg -l | grep <partial-name>.
By mastering these methods for installing .deb packages, you equip yourself with the flexibility to manage your software on Ubuntu, ensuring access to a broader range of applications and utilities. Whether you prefer the ease of a graphical interface or the power of the command line, understanding these techniques is crucial for any advanced Ubuntu user.
