What a .deb file is and why you need the command line
A .deb file is a software package for Linux systems that use Debian or Ubuntu. It contains the program you want to install, along with instructions for where to put the files and how to set things up. Unlike clicking an installer on Windows or Mac, installing a .deb file on Linux almost always means opening the terminal and typing a command — there is no way around this step.
The terminal looks intimidating if you have never used it, but the actual command is short and straightforward. You type one line, press Enter, and the system installs the software. This guide walks you through exactly what to do, step by step.
Key Takeaways
- Open the terminal, navigate to the folder where your .deb file is saved, and run a single command to install it.
- The command you type is sudo dpkg -i filename.deb, replacing "filename" with the actual name of your file.
- If the installation fails because of missing dependencies, run sudo apt install -f afterward to fix them automatically.
- You can also double-click a .deb file in your file manager on some Linux desktops, which opens a graphical installer.
Opening the terminal and finding your .deb file
First, open the terminal. On Ubuntu, press Ctrl+Alt+T. On other Linux desktops, look for an application called Terminal or Console in your applications menu. A black or white window will open with a blinking cursor.
Next, navigate to the folder where your .deb file is saved. If you downloaded it, it is probably in your Downloads folder. Type this command and press Enter:
cd Downloads
The terminal will move into your Downloads folder. If your .deb file is somewhere else — like your Desktop or a USB drive — replace "Downloads" with the correct folder name. You can also type ls and press Enter to see a list of all files in the current folder, which helps you confirm your .deb file is there.
Running the install command
Once you are in the folder with your .deb file, type this command, replacing "filename" with the actual name of your file:
sudo dpkg -i filename.deb
For example, if your file is called "google-chrome-stable.deb", you would type:
sudo dpkg -i google-chrome-stable.deb
Press Enter. The system will ask for your password — this is the same password you use to log into your computer. Type it in (you will not see the letters appear, which is normal) and press Enter again. The installation will begin.
If everything works, you will see messages confirming the software has been unpacked and set up. The process usually takes a few seconds to a minute. When it finishes, you will see your cursor again and the terminal is ready for a new command.
What to do if the installation fails
Sometimes the installation stops and shows an error message about "unmet dependencies." This means the .deb file needs other software to work, and that software is not installed yet. Do not panic — this is easy to fix.
Type this command and press Enter:
sudo apt install -f
This tells the system to find and install everything the .deb file needs. It will download the missing pieces automatically and finish the installation. After this runs, your software should be ready to use.
If you see a different error — one that does not mention dependencies — write down the exact error message and search for it online along with the name of the software you are trying to install. Most common problems have solutions posted on forums or the software's support page.
Using the graphical installer instead
If you prefer not to use the terminal, many Linux desktops let you install a .deb file by double-clicking it in your file manager. Open your file manager, navigate to the folder with your .deb file, and double-click it. A window will open showing the software details and an Install button. Click Install, enter your password when prompted, and the system will handle the rest.
This graphical method works on Ubuntu with GNOME, Linux Mint, and several other desktops. It does the same thing as the terminal command, just with a visual interface. If the graphical installer does not appear when you double-click, your desktop does not support it, and you will need to use the terminal method instead.
Finding and launching your newly installed software
After installation finishes, your new software is ready to use. Open your applications menu — usually a grid icon or the word "Activities" in the top left — and search for the program by name. Click it to launch it.
Some software installs but does not appear in the applications menu right away. If you cannot find it, restart your computer and try again. If it still does not show up, the software may run from the terminal instead. Check the software's documentation or support page for the command to launch it.
Removing a .deb file you no longer want
If you install software and later decide you do not want it, you can remove it from the terminal. Type this command, replacing "software-name" with the actual name of the package:
sudo apt remove software-name
For example, to remove Google Chrome, you would type:
sudo apt remove google-chrome-stable
Press Enter, enter your password, and the system will uninstall the software. The package name is not always the same as the program name, so if you are unsure, search online for "how to uninstall [software name] on Linux" to find the exact command.
Frequently Asked Questions
What if I get a "permission denied" error?
This usually means you forgot to type sudo at the start of the command. The sudo part tells the system you have permission to install software. Always include it: sudo dpkg -i filename.deb.
Can I install a .deb file from a different Linux system?
Not reliably. A .deb file built for Ubuntu may not work on Fedora or Arch Linux, which use different package formats. Stick to .deb files on Debian-based systems like Ubuntu and Linux Mint. If you are on a different Linux type, look for a package in your system's native format instead.
Do I need to keep the .deb file after installation?
No. Once the software is installed, you can delete the .deb file. The software itself is now on your computer and will stay there even if you remove the installer file. You only need the .deb file if you want to reinstall the software later on a different computer.
Why does the terminal ask for my password?
Installing software changes system files, so Linux requires your password to confirm you really want to do it. This is a security feature. Type your password carefully — if you make a mistake, press Ctrl+C to cancel and try the command again.
What is the difference between dpkg and apt?
dpkg installs the .deb file itself but does not automatically fetch missing dependencies. apt is smarter — it finds and installs everything needed. For most users, using dpkg first and then apt install -f if needed works fine and gives you control over what happens.