Ubuntu Linux, one of the most popular Linux distributions (distro), offers a vast repository of software available for installation. However, there are instances when you might need to install software not found in the official Ubuntu repositories. This is where .deb files come into play. In this comprehensive guide, we will walk you through the process of installing .deb files in Ubuntu, ensuring that you can effortlessly add the software you need to enhance your Linux experience.
If you want the short version, use the Ubuntu terminal and run the package with apt:
cd ~/Downloads
sudo apt install ./package.debFor most people, this is the best method to install a .deb file in Ubuntu because apt handles package dependencies better than dpkg alone. Also, a quick clarification: you don't really "run" a .deb file like a normal executable. You install the Debian package first, then launch the app from your applications menu or from the terminal after installation.
Interested in Exploring More About Ubuntu? Dive deeper into the world of Ubuntu! Read What is Ubuntu and uncover comprehensive insights on its unique features, understand its key advantages, and learn about its potential drawbacks.
When You Should Use a .deb File Instead of Ubuntu Repositories
A local .deb package usually comes into play when you download software directly from a vendor website, need a version that isn't in Ubuntu's repository yet, or you're doing an offline/manual install. Chrome, Slack, and a bunch of commercial tools are common examples.
That said, if the software exists in Ubuntu's official repositories, I'd usually start there. Repository packages are easier to maintain, receive updates through the normal Ubuntu package manager, and are generally safer than grabbing random files from the internet.
A .deb file is the standard Debian package format used by Ubuntu and other Debian-based distributions. So yes, this general process also applies to Debian, Linux Mint, Pop!_OS, and similar systems — though the GUI experience may look a little different.
If you're still getting comfortable in the shell, a broader Basic Linux commands and some basic SSH / terminal basics can make this whole job easier. Once you're up and running, you might want to install npm on Ubuntu to manage JavaScript packages for your development projects.
Methods to Install .deb Files
Installing .deb files in Ubuntu can be accomplished using a couple of methods. We'll explore both the command-line approach and the graphical user interface (GUI) methods. Whether you prefer the precision of the terminal or the convenience of a GUI tool, we've got you covered.
If your search was basically "install deb file ubuntu terminal" or "ubuntu install deb package command line," this is the section you want. Most downloaded packages land in ~/Downloads, so move there first.
cd ~/Downloads
ls
Install with apt (Recommended)
This is the cleanest way to install a local package file in Ubuntu:
sudo apt install ./package.debThe ./ matters. Without it, apt may treat the name as a repository package instead of a local file in your current directory. That tiny detail trips people up all the time.
Why use apt install ./file.deb? Because apt understands dependencies and will try to pull in what the package needs. For everyday command line installation, that's exactly what you want.
If the file lives elsewhere, point to the full path:
sudo apt install /home/your-user/Downloads/package.deb
Using the dpkg Command
The dpkg command is the most direct way to install .deb files. Here's how you can do it:
sudo dpkg -i package_name.deb- Replace
package_name.debwith the actual name of the .deb file you want to install. - The
-iflag stands for "install."
Using dpkg provides a straightforward and efficient method, but it doesn't automatically handle dependencies. dpkg is lower-level. It installs the Debian package itself, but it won't automatically resolve missing dependencies from repositories. I still use dpkg -i in troubleshooting and scripted situations. But for normal users? It's usually not my first pick.
Fix Dependencies After dpkg -i
If dpkg leaves the package half-installed because of unmet dependencies, follow up with:
sudo apt --fix-broken installYou may also see this shorter form:
sudo apt install -fBoth commands tell apt to repair broken packages and finish dependency resolution. The common workflow looks like this:
sudo dpkg -i package.deb
sudo apt --fix-broken install
GDebi Package Installer
gdebi used to be the go-to answer for local .deb installs because it handled dependencies better than plain dpkg. It's still useful, especially if you like a simple package installer, but it's less central now because apt already does the job well.
To install GDebi using the terminal in Ubuntu:
- Open a terminal window by pressing
Ctrl + Alt + Tor by searching for "Terminal" in the Ubuntu Dash. - Update the package list to make sure you have the latest information about available packages:
sudo apt update
sudo apt install gdebi- After the installation is complete, you can use GDebi to install
.debpackages. For example, to install a package namedexample.deb:
sudo gdebi example.debGDebi will resolve and install any dependencies that the package may have. Or open the file with the graphical GDebi Package Installer if your desktop is configured for it.
Install GDebi via Ubuntu Software Center
- Launch the Ubuntu Software Center application and search for "gdebi." The relevant result will appear shortly.

- Select the package installer and navigate to the subsequent window, which features a prominent "Install" button in green. Click on this button to initiate the installation process.

- Upon clicking "Install," the system will prompt for authentication by requesting the Ubuntu user password, as illustrated below. Provide the password and click "Authenticate" to proceed.

- Following successful authentication, the installation will commence and take a few minutes to complete. Once the installation is finalized, you will notice the status of the GDebi package has changed to "Installed."

Install deb Files Using GUI
If you prefer a more user-friendly and intuitive approach, GUI tools are the way to go. If you'd rather avoid the shell, Ubuntu can usually open a local package file from the file manager. Just keep in mind the app name may vary: on one system you'll see Ubuntu Software, on another it may be App Center. If you're managing a remote server and prefer a graphical interface, an Ubuntu RDP server lets you install and manage packages through a full desktop environment.
Install with Ubuntu Software or App Center
- Open the file manager and go to your downloaded package, usually in
Downloads. - Double-click the
.debfile, or right-click and choose the software installer. - Review the package details.
- Click Install.
- Enter your password if prompted.
This is the simplest route for beginners. If it works on your system, great — use it. But honestly, when the GUI acts flaky, the terminal is faster than arguing with it. If you're setting up a fresh server and want a desktop environment, check our guide on how to install a GUI on Ubuntu.
Install with GDebi Package Installer (GUI)
- First, make sure you've installed GDebi using the command
sudo apt install gdebi -y. - Right-click on the .deb file and select "Open with GDebi Package Installer."

- Follow the on-screen instructions to complete the installation. GDebi will automatically handle dependencies for you.

Install via Ubuntu Software Center (Right-Click)
To install a Debian (deb) package using the Software Center in Ubuntu, follow these straightforward steps:
- Find the downloaded deb package; typically, downloaded files are stored in the Downloads directory by default.

- Right-click on the deb file and select "Open with Another Application."
- Choose "Software Install" from the list of programs.

- Click the "Install" button to initiate the installation process.

- When prompted, enter the user's password and press Enter to authenticate.

- It's ready.
The GUI methods are more user-friendly and handle dependencies automatically, making them an excellent choice for those who prefer a visual approach.
apt vs dpkg vs gdebi: Which Method Should You Use?
Here's the practical answer. Use apt for most local package installs, use dpkg when you need lower-level control, use the GUI if you want the easiest path, and keep gdebi as an optional alternative.
| Method | Best For | Handles Dependencies | Difficulty |
apt install ./file.deb |
Most users | Yes | Easy |
dpkg -i file.deb |
Manual control and low-level package work | No | Medium |
gdebi file.deb |
CLI/GUI alternative for local packages | Yes | Easy |
| Ubuntu Software / App Center | Beginners and quick GUI installs | Usually yes | Easy |
So what's the best method to install .deb files in Ubuntu? For almost everyone, it's sudo apt install ./package.deb. Clear winner.
How to Check a .deb File Before Installing
This part gets skipped a lot. It shouldn't. Before you install downloaded software in Ubuntu, it's smart to inspect the package metadata, contents, and architecture — especially if the file came from outside the official repositories.
View Package Metadata
To inspect metadata such as package name, version, architecture, and description, run:
dpkg-deb -I package.debThis is useful when the filename is messy or the vendor naming is odd. You can often find the real package name here, which helps later if you need to remove or purge it.
List Package Contents
To see what files the package will install:
dpkg-deb -c package.debThis gives you a file listing from inside the archive. If you're wondering where binaries, desktop launchers, or config files will land, this is the quickest way to check.
Check Architecture Compatibility
Before installing, verify that the package architecture matches your system. Check your Ubuntu system architecture with:
dpkg --print-architecture
uname -mCommon values include amd64 for most 64-bit PCs and arm64 for ARM systems. Then compare that to the architecture reported by dpkg-deb -I.
If your machine is amd64 and the package is arm64, it won't install normally. That's not a broken file — it's the wrong build.
Verify the File Source or Checksum
Only install local .deb packages from trusted sources. Official vendor sites are one thing. Random mirror sites from a forum thread five years ago? Hard pass.
If the vendor publishes a checksum, verify it. For example:
sha256sum package.debThen compare the output with the checksum on the vendor's site. If signatures or official install docs exist, use them. The official Ubuntu documentation is also worth checking when you want the distro's own guidance.
Common Installation Issues
This is where most tutorials get too vague. Let's keep it practical.
- Dependency Errors: One of the most common issues is missing or unresolved dependencies. If you see an error related to dependencies, double-check and ensure you've followed the steps mentioned in the "Managing Dependencies" section. You'll usually see errors like "dependency problems prevent configuration" or messages about unmet dependencies. This happens most often after using
dpkg -ion a package that needs other packages first. Fix it with:
sudo apt --fix-broken install
sudo dpkg --configure -a- Permission Denied: If you encounter a "permission denied error in Linux" while trying to install a .deb file, make sure you're running the installation with superuser privileges using
sudo. Additionally, ensure you have the necessary permissions to write to the installation directory. If the file itself can't be read, check where it is and who owns it. Downloading it again into your home directory often clears up weird permission edge cases.
- Corrupted .deb File: A corrupted .deb file can cause installation failures. If you suspect this, re-download the file from a trusted source and try again. You can inspect the file type with:
file package.debAnd if a checksum is available, compare it with sha256sum.
- Package Architecture Does Not Match System: This error means the Debian package was built for a different CPU architecture than your Ubuntu install.
dpkg --print-architecture
dpkg-deb -I package.deb
file package.debIf your system says amd64 and the package metadata shows arm64 or i386, download the correct build from the software source.
- Package Manager Lock Errors: If you see messages about
/var/lib/dpkg/lock-frontendor another lock file, another package manager process is already running. Maybe Software Updater is open. Maybe anotheraptprocess is still finishing. Wait a minute and check again. If you're sure nothing is running, try:
ps aux | grep -E 'apt|dpkg'
sudo dpkg --configure -aOnly remove lock files manually if you know no package manager is active. If you must, be careful:
sudo rm /var/lib/dpkg/lock-frontend- Conflict with Existing Packages: Sometimes the new package conflicts with something already installed. The error may mention overwrite conflicts, broken packages, or package configuration failures. Start with:
sudo apt --fix-broken install
sudo dpkg --configure -aIf needed, identify the conflicting package and remove it first. This is where understanding Ubuntu package management with apt really helps.
Solutions to Common Errors and Problems
- Using Force Options: In some cases, you might need to use force options with the
dpkgcommand to overcome errors, such as:
sudo dpkg --force-overwrite -i package_name.debUse force options cautiously, as they can potentially lead to system instability.
- Inspecting Log Files: Check the installation log files, which can provide detailed information about the installation process. These files are usually located in
/var/logand have names likedpkg.logorapt.log. - Uninstalling Problematic Packages: If you encounter conflicts with existing packages, you may need to uninstall or disable them temporarily. This can be done using the
aptordpkgcommands. - Seeking Online Support: Online forums and communities are excellent resources for resolving specific issues. Often, others have encountered and overcome the same problems, and their solutions can be valuable.
Debugging and Error Analysis
- Read Error Messages Carefully: Error messages often provide clues about what went wrong. Carefully read and interpret these messages to pinpoint the issue.
- Check System Logs: System logs can provide additional information about errors. Review these logs to gather more context and details about the problem.
- Research and Documentation: Consult the software's official documentation, forums, or community support for guidance. Other users may have encountered and resolved similar issues.
- Test in Isolation: If possible, create a test environment to isolate the issue and experiment with potential solutions without affecting your main system.
How to Remove .deb Packages
There are various approaches to uninstall a previously installed deb package, and the specific method employed is contingent upon how the package was originally installed.
Option 1: Software Center
To uninstall a deb package through the software center, follow these steps:
- Launch the Ubuntu Software application.

- Go to the Installed tab.

- Find the desired software for removal. Click on "Uninstall" to initiate the removal process.

- Confirm the uninstallation and enter the user's password to finalize the software removal.
Option 2: GDebi GUI
To remove software using GDebi, follow these steps:
- Find the .deb package file on your system.
- Right-click on the file and choose "Open With Other Application."
- Select GDebi Package Installer from the available options.
- Click on "Remove Package" to uninstall the software.

- Enter the user's password and wait for the uninstallation process to finish.
Option 3: Using the dpkg Command
The dpkg command can be used to remove a .deb package from your system. To uninstall a package, open a terminal and run the following command:
sudo dpkg -r package_nameReplace package_name with the name of the .deb package you wish to remove. This command will remove the package without deleting its configuration files.
If you want to completely remove the package, including its configuration files, use the following command:
sudo dpkg --purge package_nameOption 4: Using the Apt Package Manager
You can also utilize the apt package manager to remove .deb packages. The advantage of using apt is that it can automatically handle dependencies and make the removal process smoother.
To remove a .deb package using apt, open a terminal and run:
sudo apt remove package_nameOnce again, replace package_name with the actual name of the package you want to uninstall. The apt command will also keep the configuration files intact.
For a complete removal that includes configuration files, use:
sudo apt purge package_nameClean Up Unused Dependencies
After uninstalling a package, remove orphaned dependencies with:
sudo apt autoremoveThis clears out packages that were installed automatically and are no longer needed.
Find the Installed Package Name
If you're not sure what the package is actually called, search the installed package list:
dpkg -l | grep package-name
apt list --installed | grep package-nameThat's especially useful when the downloaded filename doesn't match the internal package name. For more removal workflows, see this guide on how to uninstall packages in Ubuntu.
Ubuntu Version Notes for 20.04, 22.04, and 24.04
The command-line side of this is pretty consistent across Ubuntu 20.04, 22.04, and 24.04. If you know cd ~/Downloads, sudo apt install ./package.deb, and the fix-broken workflow, you're in good shape on all three.
The GUI naming is where things shift a bit. Some releases label the graphical installer as Ubuntu Software, while newer setups may show App Center. The exact buttons and layout can change, but the basic idea stays the same: open the local package and click install.
If you're comparing systems, understanding the differences between Ubuntu vs Debian can also help explain why package behavior feels familiar across both.
Not sure which Ubuntu edition fits your use case? See the differences between Ubuntu Server vs Ubuntu Desktop before you commit.
Final Words
Installing .deb files is a skill that empowers you to customize your Ubuntu system and extend its capabilities beyond the software readily available in the official repositories. Whether you're a seasoned Linux user or new to the Ubuntu ecosystem, this guide has equipped you with the knowledge and techniques needed to handle .deb files with confidence. If you're looking for a reliable environment to practice, an Ubuntu VPS server gives you full root access and a safe sandbox to experiment with package management.
Hello, everyone, my name is Lisa. I'm a passionate electrical engineering student with a keen interest in technology. I'm fascinated by the intersection of engineering principles and technological advancements, and I'm eager to contribute to the field by applying my knowledge and skills to solve real-world problems.