How to Install DEB Files in Linux: Gdebi, Apt, Dpkg, & More
How to Install DEB Files in Linux: Gdebi, Apt, Dpkg, & More
Do you have a .DEB file that you need to install on Ubuntu, Debian, or Linux Mint? If you downloaded a DEB file for a program like Chrome from the web, you have several easy install options. If you prefer a graphical install method, you can use the Ubuntu Software tool to quickly install DEB files you downloaded from the web. Or, if you want to make sure you can easily install all dependencies for the program, try Gdebi, which has both graphical and command-line options. You can also use simple command line tools like Apt and Dpkg, which both come preinstalled on all Debian-based systems. We'll walk you through all 4 simple options for installing DEB files in Linux.
Things You Should Know
  • If you're using Ubuntu, you can double-click the DEB package and select "Install" for a quick graphical installation.
  • Use Gdebi to install a DEB package and all of its related dependencies with one simple command.
  • To install with Advanced Package Tool (apt), use sudo apt install ./filename.deb
  • To install with Dpkg, use sudo dpkg -i filename.deb

Using Ubuntu Software

Double-click the .DEB file. If you're using Ubuntu, this method will guide you through one of the most straightforward ways to install DEB packages. Start by double-clicking the file in your file manager, which will instantly open the Ubuntu Software tool. If that doesn't work, right-click the file and choose Open with software install. If you run into trouble with dependencies when using this method, try using Gdebi instead.

Click the Install button. If prompted, you may need to enter your password to complete the installation process. Once the software is installed, you'll find its name and icon in your app grid. Having trouble finding your installed package? Just press the Super key (also known as the Windows key) on your keyboard, search for the application name, and then click it in the search results. To uninstall a package, just launch Ubuntu Software, click Installed, choose the package you want to delete, and then click Remove.

Using Gdebi Package Installer

Install Gdebi if you haven't already done so. Gdebi is one of the most reliable ways to install DEB packages because of its ability to determine and resolve dependencies. If Gdebi finds that the program requires other programs or libraries to run, the tool will also install those required files. If you have Linux Mint, GDebi is already set up as your default package manager. If you're using Ubuntu or Debian, you'll need to install Gdebi. On Ubuntu, you can get Gdebi from Ubuntu Software. On Debian (or if you prefer Apt in Ubuntu), use these steps: Press Ctrl + Alt + T to open a terminal window. Type sudo apt update and press Enter. Enter your password when prompted. Type sudo apt install gdebi and press Enter or Return.

Open a terminal window. If you're logged into a shell account, just skip to the next step. Otherwise, you can press Ctrl + Alt + T to open a terminal window in most desktop environments. If you're using Linux Mint, you can install the DEB file now through Gdebi by double-clicking it in your file manager and selecting Install Package. If you're using Ubuntu or Debian and want to use the Gdebi GUI, open your file manager, right-click the DEB file, and select Open with Other Application. Choose Gdebi when prompted, and then click Install Package to complete the installation.

Use cd to navigate to the directory with the DEB file. For example, if you saved the file to /home/username/Downloads, type cd /home/username/Downloads and press Enter.

Type sudo gdebi filename.deb and press ↵ Enter. Replace filename.deb with the DEB file's actual name. This installs the DEB package and all related dependencies. If you want to make Gdebi the default install tool for DEB packages in Ubuntu or any Ubuntu-related distribution, it's easy: Right-click a .DEB file and choose Properties. Click the "Open with" drop-down menu and choose Gdebi Package Installer. If you want to uninstall a package you installed with Gdebi, use the apt command. The syntax is sudo apt remove packagename.

Using Apt

Open a terminal window. If you're logged into a shell account, just skip to the next step. Otherwise, you can press Ctrl + Alt + T to open a terminal window in most window managers. Apt is normally used to download and install software from remote sources, but you can use it to install local DEB packages using a special syntax. Unlike when using Gdebi to install DEB files locally, Apt may not automatically resolve all dependencies. However, Apt does resolve dependencies automatically if you use it to install software from remote repositories.

Use cd to navigate to the directory with the DEB file. For example, if you saved the file to /home/username/Downloads, type cd /home/username/Downloads and press ↵ Enter or ⏎ Return.

Run the installation command. Type sudo apt install ./filename.deb and press ↵ Enter or ⏎ Return. The software will now install. Be sure to replace filename.deb with the actual name of the file, take note of the ./ before it—if you leave it out, the apt tool will try searching for the package in remote repositories. If it's the first time you've run a command using sudo in this window, you'll have to enter your password when prompted to continue. To see a list of all installed packages with Apt, use the command sudo apt list --installed. To remove a package with Apt, use the command sudo apt remove packagename.

Using Dpkg

Open a terminal window. If you're logged into a shell account, just skip to the next step. Otherwise, you can press Ctrl + Alt + T to open a terminal window in most window managers. Dpkg comes preinstalled on all Debian-based Linux systems, including Ubuntu and Linux Mint. If you have trouble with dependencies using Dpkg, give Gdebi a try instead.

Use cd to navigate to the directory with the DEB file. For example, if you saved the file to /home/username/Downloads, type cd /home/username/Downloads and press ↵ Enter.

Type sudo dpkg -i filename.deb and press ↵ Enter. Replace filename.deb with the name of the DEB file. This command will install the package. Make sure you enter the -i using a lowercase i, as Dpkg commands are case-sensitive. If it's the first time you've run a command using sudo in this window, you'll have to enter your password when prompted to continue.

Resolve any dependency errors (optional). If the previous command threw an error about dependencies, run sudo apt-get install -f to resolve them. To see a list of all installed packages with Dpkg, use the command sudo dpkg-query -l . You can easily remove packages with Dpkg using dpkg -r packagename.

What's your reaction?

Comments

https://popochek.com/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!