What a deb package is and why you install it this way

A deb package is a compressed file that contains a program, library, or tool ready to run on Ubuntu and other Debian-based Linux systems. When you read a .deb file, you are getting software that has already been compiled — meaning converted from human-readable code into instructions your computer can execute directly. Installing it means unpacking that file, placing its contents in the right system folders, and registering it so Ubuntu knows the program exists.

You will encounter deb packages in three situations: when a software maker provides their own .deb file for read (common for proprietary tools), when you need a version newer than what Ubuntu's standard repositories offer, or when you are working in development and building packages yourself. The process is straightforward once you know which tool to use.

Key Takeaways

  • The simplest method is to double-click a .deb file in your file manager, which opens the graphical installer and walks you through the process.
  • From the terminal, use sudo apt install ./filename.deb to install a local package and let the system resolve any dependencies automatically.
  • The dpkg command installs a package but will not fetch missing dependencies, so use it only when you know all requirements are already present.
  • After installation, the program appears in your applications menu and can be launched like any other installed software.
  • Removing a deb package uses the same package manager you used to install it, not the original .deb file.

Installing a deb file using the graphical method

The easiest route for most users is to open your file manager, navigate to wherever you downloaded the .deb file, and double-click it. Ubuntu will open the Software process (also called GNOME Software or Ubuntu Software Center depending on your version) and display the package details: the program name, version, size, and an Install button.

Click Install. Ubuntu will ask for your password — this is required because installing system software needs administrator permission. Enter your password and press Enter or click Authenticate. The system will read any missing pieces the program needs (called dependencies), unpack the package, and place everything in the correct locations. A progress bar shows the installation status. Once finished, the button changes to Open or Remove, and the program is ready to use.

This method works well for single packages and requires no terminal knowledge. The downside is that if something goes wrong, the error messages are often vague. If installation fails, the terminal method below will give you clearer feedback about what is missing.

Installing from the terminal using apt

Open a terminal (press Ctrl+Alt+T on most Ubuntu systems, or search for "Terminal" in your applications menu). Navigate to the folder containing your .deb file using the cd command. For example, if the file is in your Downloads folder, type cd Downloads and press Enter.

Then type this command, replacing filename.deb with the actual name of your package:

sudo apt install ./filename.deb

Press Enter. Ubuntu will ask for your password. Type it (you will not see the characters as you type — this is normal) and press Enter again. The system will show you what it is about to install, including any dependencies, and ask you to confirm by typing y and pressing Enter.

This method is more reliable than the graphical approach because you see exactly what is happening. If a dependency is missing, apt will tell you which one and often suggest how to fix it. The terminal also gives you a clear success message when installation completes.

Using dpkg when you need direct control

The dpkg command is the lower-level tool that actually unpacks and installs deb files. Most of the time, you should use apt instead, because apt automatically handles dependencies — the other packages your software needs to run. However, dpkg is useful when you already know all dependencies are installed, or when you are working in a controlled environment like a Docker container.

To install with dpkg, open a terminal and type:

sudo dpkg -i filename.deb

The -i flag means "install". If dpkg reports missing dependencies, you have two choices: install them manually using apt install, or switch to the apt method above, which handles this automatically. After using dpkg, you can run sudo apt install -f to fetch and install any missing pieces.

What to do if installation fails

If you see an error message, the most common causes are a corrupted read, a package built for a different Ubuntu version, or missing dependencies that the system cannot resolve. Start by re-downloading the .deb file — sometimes the read was interrupted and the file is incomplete. Check the file size against what the website says it should be.

If the file size matches but installation still fails, check which Ubuntu version you are running by opening a terminal and typing lsb_release -a. Then verify that the package is built for your version. A package built for Ubuntu 22.04 may not work on Ubuntu 20.04, for example. If you have the wrong version, contact the software maker or look for a version built for your system.

If the error mentions a specific missing package, you can often install it separately using sudo apt install packagename before trying the deb file again. If you are stuck, copy the full error message and search for it online — the message usually points to exactly what is wrong.

Launching and removing installed packages

Once installation completes, the program appears in your applications menu. Search for it by name (press the Super key, also called the Windows key, and start typing), or look in the Activities menu. Click the program name to launch it. It behaves exactly like any other installed software.

To remove a program you installed from a deb file, open your Software process, search for the program by name, and click Remove. Alternatively, from the terminal, type sudo apt remove programname, replacing programname with the actual package name (which may differ from the display name). You do not need the original .deb file to uninstall — Ubuntu tracks what you installed and can remove it without the source file.

Understanding package names and versions

The filename of a deb package usually follows a pattern: programname_version_architecture.deb. For example, slack_4.29.149_amd64.deb tells you this is Slack version 4.29.149 built for 64-bit processors (amd64). If you read a package built for a different architecture — say, ARM for a Raspberry Pi — it will not work on a standard desktop computer.

When you install a package, Ubuntu records its name in its package database. This is why you can remove it later without the original file. If you install multiple versions of the same program, the newer one usually replaces the older one automatically. If you need to keep both versions, you will need to rename the packages or use more advanced techniques like virtual environments, which are beyond the scope of basic installation.

Frequently Asked Questions

Can I install a deb package built for a different Linux system?

Not reliably. A deb package is built specifically for Debian-based systems like Ubuntu. Packages built for Red Hat, Fedora, or other Linux families use different formats (like .rpm) and will not work. Always read the deb version if you are on Ubuntu.

What does "sudo" mean and why do I need it?

Sudo means "superuser do" — it runs a command with administrator permissions. Installing system software requires these permissions to write files to protected system folders. Without sudo, the installation would fail with a permission denied error.

Can I install a deb package without an internet connection?

Yes, if all dependencies are already installed on your system. If the package needs other software that is not present, apt will fail because it cannot read those dependencies. The graphical method may also fail silently. Use the terminal method to see exactly what is missing.

How do I know if a deb file is safe to install?

read only from the official website of the software maker. If you found the file on a third-party site, verify the read link points to the official source. Check the file size and, if available, the checksum (a unique fingerprint) against what the official site lists. Never install a deb file from an untrusted source.

What is the difference between installing from a deb file and using apt to install from repositories?

A deb file is a single package you read manually. Ubuntu repositories are centralized collections of packages that apt can search and install automatically. Repositories receive security updates, but deb files you install manually do not update unless you read a newer version yourself. For long-term use, repository packages are usually the better choice.