While APT handles most software installation from repositories, sometimes you need to install a .deb package directly—proprietary apps from vendor websites, locally built packages, or software not in default repos. This guide covers every method to install .deb packages on Ubuntu 26.04, including dependency resolution and troubleshooting.
[!TIP] Real-World Scenario: You’re trying to install that one specific version of VS Code or Chrome that isn’t in the repos, and you download a
.debfile. You double-click it, and… nothing happens. This is where knowing the CLI commands saves you from a frustrating ‘Linux moment’.
sudo apt install ./package.deb— preferred method with automatic dependenciessudo dpkg -i package.deb— low-level installation without dependency resolutionsudo apt --fix-broken install— resolve missing dependencies after dpkgsudo apt install gdebi-core— install GDebi for GUI or CLI with dependency handling
Prerequisites
Before you start, you need:
- Ubuntu 26.04 with sudo access
- Familiarity with basic APT package management
- A .deb file to install (download from vendor or build locally)
What is a .deb package?
A .deb file is the Debian package format used by Ubuntu and Debian-based distributions. It’s an archive containing:
- Compiled application binaries
- Configuration files
- Documentation
- Metadata (dependencies, version, maintainer info)
When you need to install a .deb manually:
- Software vendor distributes as .deb (Chrome, VS Code, Zoom)
- You’ve built a package locally from source
- Need a specific version not in current repositories
- Installing on a system without internet access
How do I install .deb packages with apt?
The apt install command is the preferred method because it automatically resolves and installs missing dependencies.
Install a .deb File
Navigate to the directory containing the .deb file:
cd ~/Downloads
sudo apt install ./package.deb The leading ./ is essential. Without it, APT searches repositories for a package name instead of using the local file.
Verify the Installation
apt show package-name
dpkg -l | grep package-name APT displays a summary and installs additional dependencies from repositories. Review the list and confirm with Y when prompted.
Permission notice: You may see a message about “Download is performed
unsandboxed as root.” This is harmless—APT falls back to root when the _apt
user can’t read files in your home directory. The package installs correctly.
To avoid this, move the .deb to /tmp before installing.
Always prefer apt install ./package.deb over dpkg -i when you have an
internet connection. APT handles the entire dependency chain in one step.
How do I install .deb packages with dpkg?
The dpkg command is the low-level package manager underlying APT. It installs .deb files directly but doesn’t resolve dependencies automatically.
Basic dpkg Installation
sudo dpkg -i package.deb If all dependencies are satisfied, the installation completes successfully.
Resolve Missing Dependencies
If dpkg reports unmet dependencies:
sudo apt --fix-broken install This reads the dependency information left by dpkg, downloads required packages, and completes the installation.
Verify Installation
dpkg -l | grep package-name A status of ii confirms the package is fully installed.
Install Multiple .deb Files
Install several packages at once:
sudo dpkg -i package1.deb package2.deb package3.deb Or install all .deb files in a directory:
sudo dpkg -i /path/to/debs/*.deb Follow with sudo apt --fix-broken install to resolve any dependency issues.
How do I install .deb packages with GDebi?
GDebi combines a simple interface with automatic dependency resolution. It’s useful for desktop users or as a dpkg alternative with built-in dependency handling.
Install GDebi
# Command-line only
sudo apt install gdebi-core
# With graphical interface
sudo apt install gdebi Install with GDebi CLI
sudo gdebi package.deb GDebi displays the package description and lists required dependencies before asking for confirmation, then downloads and installs everything in one step.
Install with GDebi GUI
Right-click a .deb file in the file manager and select “Open With GDebi Package Installer.” The window shows package details, dependencies, and an “Install Package” button.
How do I manage installed .deb packages?
Once installed, .deb packages are managed like any repository package.
Check Package Information
# Display detailed information
apt show package-name
# List all files installed by the package
dpkg -L package-name
# Check which package owns a specific file
dpkg -S /path/to/file Remove a Package
Remove while keeping configuration files:
sudo apt remove package-name Remove including configuration files:
sudo apt purge package-name Clean up orphaned dependencies:
sudo apt autoremove How do I troubleshoot installation errors?
Dependency Errors
If dpkg -i fails with dependency errors:
sudo apt --fix-broken install If required dependencies aren’t in your repositories, add the appropriate repository or download dependency .deb files manually.
Architecture Mismatch
If installing a package for a different architecture:
# Check your system architecture
dpkg --print-architecture
# Enable multiarch support (e.g., for i386 on amd64)
sudo dpkg --add-architecture i386
sudo apt update Then retry the installation.
File Conflicts
If a package tries to overwrite a file owned by another package:
# Find which package owns the file
dpkg -S /path/to/conflicting/file Remove the conflicting package first, or if certain the overwrite is safe, force it:
sudo dpkg -i --force-overwrite package.deb Use --force-overwrite with extreme caution. Overwriting files from other
packages can break your system. Always verify the conflict before forcing.
Permission Denied Errors
Ensure you’re using sudo with installation commands. Package installation requires root privileges.
Summary
- Use
sudo apt install ./package.debas your default method for automatic dependency handling - Use
sudo dpkg -i package.debfor low-level control or offline installations, then runsudo apt --fix-broken install - Use
sudo gdebi package.debfor a convenient CLI alternative with dependency resolution - Verify installations with
apt show,dpkg -L, anddpkg -S - Remove packages with
sudo apt removeorsudo apt purge - Always verify the source of .deb files before installing—untrusted packages can compromise your system
FAQ
What is the difference between apt install ./package.deb and dpkg -i?
The key difference is dependency handling. apt install ./package.deb automatically downloads and installs missing dependencies. dpkg -i only installs the specified package and fails if dependencies are missing, requiring you to manually run sudo apt --fix-broken install afterward.
Why does apt install require the ./ prefix for local .deb files?
The ./ prefix tells APT you’re specifying a file path rather than a package name. Without it, APT searches repository indexes. The ./ signals a local file in the current directory.
Can I install a .deb package without an internet connection?
Yes. Use dpkg -i package.deb for offline installation. If the package has dependencies not already installed, you’ll need to provide those dependency .deb files as well. Pre-download all dependencies on a connected system using apt download and transfer them to the offline machine.
Is it safe to install .deb packages from third-party websites? Only install .deb packages from trusted sources like official vendor download pages. Third-party .deb files aren’t reviewed by Ubuntu’s security team and could contain malware. When possible, verify package checksums or GPG signatures.
How do I check which .deb packages I’ve installed manually?
There’s no built-in distinction, but packages from local .deb files that don’t match any repository appear with status “local” when you run apt list --installed. Check /var/log/apt/history.log for local installation records.
What to Read Next
- Install and Configure APT Repositories on Ubuntu 26.04 — add third-party repositories for automatic updates
- Build .deb Packages from Source — create your own packages for distribution
- Install and Configure Software — manage complex software stacks
Related Articles
Deepen your understanding with these curated continuations.
Install and Configure Git on Ubuntu 26.04
Complete guide to install Git on Ubuntu 26.04. Configure user identity, generate SSH keys for GitHub/GitLab, master essential workflow commands, and customize with aliases.
Install and Configure PostgreSQL on Ubuntu 26.04
Complete guide to install PostgreSQL 18 on Ubuntu 26.04. Set up roles, databases, remote access, authentication methods, and security hardening.
Install and Secure MySQL on Ubuntu 26.04
Complete guide to install and harden MySQL on Ubuntu 26.04. Run mysql_secure_installation, create users and databases, configure remote access with firewall rules.