Complete APT Package Management Guide for Ubuntu 26.04

Introduction
APT — the Advanced Package Tool — is the foundation of software management on Ubuntu and every Debian-based Linux distribution. Whether you are installing your first application, updating a production server’s packages, troubleshooting a broken dependency, or managing a fleet of machines through automation scripts, APT is the tool you reach for. Understanding APT deeply is not optional for anyone administering Ubuntu systems — it is as fundamental as understanding the filesystem.
Ubuntu 26.04 LTS (Resolute Raccoon) ships with APT 3.1.16, a version that brings several meaningful improvements over the APT versions found in previous Ubuntu releases. The default dependency resolver has been replaced with solver3, a ground-up rewrite using a SAT-solver-inspired approach that is faster and more predictable. Two new diagnostic subcommands — apt why and apt why-not — finally give administrators visibility into APT’s dependency decisions. The DEB822 .sources format replaces the legacy one-line sources.list format as the standard for repository configuration. Repository-level package filtering through Include and Exclude fields enables fine-grained control over which packages are available from each repository. And the apt modernize-sources command provides an automated migration path from legacy .list files to the modern .sources format.
| APT 3.1.16 ON UBUNTU 26.04 | Ubuntu 26.04 ships APT 3.1.16 as a direct Debian sync (no Ubuntu-specific suffix). Key new features: solver3 enabled by default, apt why/why-not diagnostic commands, DEB822 sources as default format, Include/Exclude repository filtering, apt modernize-sources migration tool, and apt history (undo/redo/rollback) introduced in APT 3.1.x. Confirm your version: apt –version |
Installing Packages
Install a single package
sudo apt install package-name
Install multiple packages in one operation
sudo apt install package1 package2 package3
Install a specific version of a package
sudo apt install package-name=2.1.0-1ubuntu1
Install a local .deb file (APT resolves dependencies automatically)
sudo apt install ./path/to/package.deb
Install without interactive confirmation prompts (for scripts)
sudo apt install -y package-name
Reinstall a package (useful when files are corrupted)
sudo apt install --reinstall package-name
| LOCAL .DEB INSTALLATION | Always use the ./ prefix when installing local .deb files with apt: sudo apt install ./package.deb. Without the prefix, APT interprets the argument as a package name from repositories rather than a file path. The ./ prefix forces APT to treat it as a local file and automatically resolve any missing dependencies from repositories. |
Removing Packages
Remove a package (keeps configuration files)
sudo apt remove package-name
Remove a package AND its configuration files (complete removal)
sudo apt purge package-name
Remove unused dependencies that were auto-installed with other packages
sudo apt autoremove
Combine purge and autoremove in one operation
sudo apt autoremove --purge
apt remove leaves configuration files intact in /etc/ — useful if you plan to reinstall the package later and want to keep your settings. apt purge removes configuration files as well, returning the system to a completely clean state for that package. For most removals, purge is the more thorough and recommended choice.
Listing Installed Packages
List all installed packages
apt list --installed
Filter installed packages by name
apt list --installed | grep python
Count total installed packages
apt list --installed | wc -l
Check if a specific package is installed
dpkg -l package-name
Show all files installed by a package
dpkg -L package-name
Checking Dependencies
Show a package’s dependencies
apt-cache depends package-name
Show what packages depend on this package (reverse dependencies)
apt-cache rdepends package-name
Simulate an installation (shows what would happen without doing it)
apt install --dry-run package-name
Or equivalently:
apt install -s package-name
New in APT 3.1.16: solver3, apt why, and apt why-not
solver3: The New Default Dependency Resolver
Ubuntu 26.04 enables solver3 as the default dependency resolver for all apt operations. Solver3 is a complete rewrite of APT’s dependency resolution logic, replacing the classic solver that had been in use since APT’s early days. The new solver uses a DPLL (Davis–Putnam–Logemann–Loveland) algorithm with unit propagation a SAT-solver-inspired approach that evaluates dependency graphs more systematically.
In practical terms, solver3 delivers three main improvements over the classic solver. It is approximately 40% faster because it does not evaluate every package in the repository when computing a solution — it only evaluates packages relevant to the current operation. It produces more predictable results, particularly in complex dependency conflict scenarios where the classic solver’s behavior could be surprising. And it handles the ordering of alternatives in dependency groups (Depends: pkgA | pkgB) more consistently, always respecting the left-to-right preference order documented in Debian policy.
Conclusion
APT on Ubuntu 26.04 is meaningfully more capable than the APT versions found in previous Ubuntu releases. The solver3 upgrade makes dependency resolution faster and more reliable. The apt why and apt why-not commands bring long-needed diagnostic transparency to operations that were previously opaque. The DEB822 format modernizes repository configuration. The Include/Exclude filtering simplifies third-party repository management. And apt history gives administrators a native rollback capability for the first time.
Share this:
- Share on Facebook (Opens in new window) Facebook
- Share on X (Opens in new window) X
- Share on Bluesky (Opens in new window) Bluesky
- Share on LinkedIn (Opens in new window) LinkedIn
- Share on Reddit (Opens in new window) Reddit
- Share on Threads (Opens in new window) Threads
- Print (Opens in new window) Print
- Share on Mastodon (Opens in new window) Mastodon








