Dependency resolution with apt-get and apt
Command Line – Debian Package Management
Over the past 30 years, the apt family has played an important role in dependency resolution for Debian distros.
While Debian did not originate dependency resolution in Linux, it was the first major distribution to develop it to modern standards. As early as 1994, Debian was using dpkg
, a low-level front end for libapt-pkg that freed package installation from dependency hell – the seemingly endless effort to provide all necessary dependencies for a new package. Debian even took the problem one step further, adding suggested packages: Those that enhanced a package but were not strictly necessary for basic functionality. Although universal today, at the time dependency resolution was so unusual that other developers joked that Debian coders ordered lunch by typing apt-get sandwich
. For ease of use, dpkg
was soon supplemented by the even higher level apt-get
command, although dpkg
is still used for installation of local packages. Since those early days, apt-get
has given rise to an entire ecosystem of utility scripts. In the past decade, the ecosystem became so complex that Ubuntu released apt
, a simpler version of apt-get
aimed at beginners or casual users. Today, Debian package management has become a comprehensive system that continues to evolve, but one whose intricacies can sometimes be overwhelming.
apt-get vs. apt
Like dpkg
, apt-get
and apt
are both front ends for libapt-pkg and use the same lists of package repositories. Both have similar commands to install, remove packages, update repository lists, and remove packages that are no longer needed, although the command syntax is usually slightly shorter with apt
(see Table 1). Both offer similar feedback. Although feedback is slightly cleaned up in apt
, it is hard to tell one from the other (Figure 1). However, apt
includes the functionality of apt-cache
and apt-query
, two widely used separate scripts for searching packages. In addition, apt
displays the number of upgradeable packages and includes a progress bar, as well as the ability to edit lists of sources directly. However, apt-get
has more options for upgrading and for solving installation problems. Moreover, not all apt-get
-based scripts may be compatible with apt
. In other words, apt
is designed for the most common use cases and less knowledgeable users, while apt-get
remains a choice for the more experienced. However, because both interact with the same library and resources, users can switch back and forth between them without any problems.
Repository Structure
Debian repositories are listed in /etc/apt
, which also includes keyrings, preferences, and configuration files for apt-get
and apt
. Repositories can be edited in any text editor or directly with apt edit-sources
, and the changes activated with apt-update
. The entire system can be updated with apt-get dist-upgrade
or apt full-grade update
.
[...]
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.