Dependency resolution with apt-get and apt
Command Line – Debian Package Management
© Lead Image © James Steidel, 123RF.com
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.
[...]
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
-
Ubuntu Core 26 Offers Game-Changing Enterprise Features
Ubuntu Core 26 could be a game-changer for organizations looking for increased security and reliability.
-
AI Flooding the Linux Kernel Security Mailing List
AI is giving Linus Torvalds a headache, but not in the way you might think.
-
Top Priorities for Open Source Pros Seeking a New Job
Professional fulfillment tops the list, according to LPI report.
-
Container-Based Fedora Hummingbird Designed for Agent-First Builders
Fedora Hummingbird brings the same approach to the host OS as it does to containers to level up security.
-
Linux kernel Developers Considering a Kill Switch
With the rise of Linux vulnerabilities, the kernel developers are now considering adding a component that could help temporarily mitigate against them… in the form of a kill switch.
-
Fedora 44 Now Gaming Ready
The latest version of Fedora has been released with gaming support.
-
Manjaro 26.1 Preview Unveils New Features
The latest Manjaro 26.1 preview has been released with new desktop versions, a new kernel, and more.
-
Microsoft Issues Warning About Linux Vulnerability
The company behind Windows has released information about a flaw that affects millions of Linux systems.
-
Is AI Coming to Your Ubuntu Desktop?
According to the VP of Engineering at Canonical, AI could soon be added to the Ubuntu desktop distribution.
-
Framework Laptop 13 Pro Competes with the Best
Framework has released what might be considered the MacBook of Linux devices.
