Understanding Linux Package Management: Deep Dive into apt and dpkg
Use Case
Package management is a cornerstone of any Linux operating system. While commands like apt install -y {package}
simplify software deployment, a deeper understanding of the underlying processes can illuminate the power and convenience these tools provide. I explore the mechanics behind dependency resolution – the main advantage of package managers like apt (Advanced Packaging Tool) – by manually installing software using dpkg, the low-level package manager for Debian-based distributions.
What am I Doing?
Advanced Packaging Tool is a program that runs as the frontend to manage deb files and packages for distributions like Ubuntu. Since I want to know what is happening behind the scenes, I am going to work directly with the deb files using dpkg. I will work with 2 popular packages: Tree and nmap.
Tree is a program that shows the contents of a directory in its entirety via recursion. It is useful to look at what is inside a directory in one shot.
nmap is a network utility used for scanning networks and gathering information about hosts on networks.
First, I am going to look at a package already installed on our system (tree), then walk through the manual process of installing nmap using dpkg.
Steps
Locally Installed Package (Tree)
One can gather basic information about a package via apt or dpkg:
andrewtest@lfs203-ubuntu:~$ dpkg -s tree
Package: tree
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 108
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Version: 2.1.1-2ubuntu3
Depends: libc6 (>= 2.38)
Description: displays an indented directory tree, in color
Tree is a recursive directory listing command that produces a depth indented
listing of files, which is colorized ala dircolors if the LS_COLORS environment
variable is set and output is to tty.
Homepage: http://oldmanprogrammer.net/source.php?dir=projects/tree
Original-Maintainer: Florian Ernst <florian@debian.org>
andrewtest@lfs203-ubuntu:~$ apt info tree
Package: tree
Version: 2.1.1-2ubuntu3
Priority: optional
Section: universe/utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Florian Ernst <florian@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 111 kB
Depends: libc6 (>= 2.38)
Homepage: http://oldmanprogrammer.net/source.php?dir=projects/tree
Task: xubuntu-desktop, lubuntu-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop-minimal, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi, ubuntu-unity-desktop, ubuntucinnamon-desktop-minimal, ubuntucinnamon-desktop-raspi
Download-Size: 47.1 kB
APT-Manual-Installed: yes
APT-Sources: http://azure.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
Description: displays an indented directory tree, in color
Tree is a recursive directory listing command that produces a depth indented
listing of files, which is colorized ala dircolors if the LS_COLORS environment
variable is set and output is to tty.
Notice that the dpkg command above only works because the tree application is already installed on the system. Because dpkg does not deal with repos and only works with deb files locally, it would not have information about a package that is not locally installed.
Even though dpkg does not install applications from a central repo or automatically fix dependencies like apt, it does understand package dependencies for existing packages. It will prevent operations that would break dependencies, as shown below when attempting to remove a core library like libc6:
andrewtest@lfs203-ubuntu:~$ sudo dpkg --remove libc6
dpkg: dependency problems prevent removal of libc6:amd64:
zstd depends on libc6 (>= 2.34).
zlib1g:amd64 depends on libc6 (>= 2.14).
zerofree depends on libc6 (>= 2.34).
xz-utils depends on libc6 (>= 2.34).
xxd depends on libc6 (>= 2.34).
xfsprogs depends on libc6 (>= 2.38).
...abbreviated...
bcache-tools depends on libc6 (>= 2.34).
bc depends on libc6 (>= 2.38).
bash depends on libc6 (>= 2.38).
base-passwd depends on libc6 (>= 2.34).
base-files depends on libc6 (>= 2.34).
apt-utils depends on libc6 (>= 2.34).
apt depends on libc6 (>= 2.38).
appstream depends on libc6 (>= 2.34).
apparmor depends on libc6 (>= 2.38).
dpkg: error processing package libc6:amd64 (--remove):
dependency problems - not removing
Errors were encountered while processing:
libc6:amd64
andrewtest@lfs203-ubuntu:~$ sudo apt remove libc6
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
apt : Depends: gpgv but it is not going to be installed
Depends: libapt-pkg6.0t64 (>= 2.8.3) but it is not going to be installed
Depends: libc6 (>= 2.38) but it is not going to be installed
Depends: libgnutls30t64 (>= 3.8.1) but it is not going to be installed
Depends: libseccomp2 (>= 2.4.2) but it is not going to be installed
Depends: libstdc++6 (>= 13.1) but it is not going to be installed
Depends: libsystemd0 but it is not going to be installed
Recommends: ca-certificates but it is not going to be installed
base-files : PreDepends: awk
Depends: libc6 (>= 2.34) but it is not going to be installed
Depends: libcrypt1 (>= 1:4.4.10-10ubuntu3) but it is not going to be installed
...abbreviated...
sysvinit-utils : Depends: libc6 (>= 2.38) but it is not going to be installed
tar : PreDepends: libacl1 (>= 2.2.23) but it is not going to be installed
PreDepends: libc6 (>= 2.38) but it is not going to be installed
PreDepends: libselinux1 (>= 3.1~) but it is not going to be installed
util-linux : PreDepends: libblkid1 (>= 2.37.2) but it is not going to be installed
PreDepends: libc6 (>= 2.38) but it is not going to be installed
PreDepends: libcap-ng0 (>= 0.7.9) but it is not going to be installed
PreDepends: libcrypt1 (>= 1:4.1.0) but it is not going to be installed
PreDepends: libmount1 (>= 2.39.1) but it is not going to be installed
PreDepends: libpam0g (>= 0.99.7.1) but it is not going to be installed
PreDepends: libselinux1 (>= 3.1~) but it is not going to be installed
PreDepends: libsmartcols1 (>= 2.38) but it is not going to be installed
PreDepends: libsystemd0 but it is not going to be installed
PreDepends: libtinfo6 (>= 6) but it is not going to be installed
PreDepends: libudev1 (>= 183) but it is not going to be installed
PreDepends: libuuid1 (>= 2.16) but it is not going to be installed
PreDepends: zlib1g (>= 1:1.1.4) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
These errors clearly indicate that there will be dependency issues if libc6 were to be deleted.
For a comprehensive view of package dependencies, you can find more information on the Ubuntu Packages website. Here are detailed dependency information for tree and nmap:
Let us install nmap on our Ubuntu VM with dpkg. First, we need to get the deb files on the VM.
Finding the deb Files
When using apt to install software on Ubuntu, the system consults its configured repositories. We can generally see which repos are configured within /etc/apt/sources.list.d/
, which had 3 files:
andrewtest@lfs203-ubuntu:~$ ls /etc/apt/sources.list.d/
ubuntu-esm-apps.sources ubuntu-esm-infra.sources ubuntu.sources
ubuntu.sources is what we care about. The other two are subscription-based for security (I am using an Ubuntu VM in Azure).
andrewtest@lfs203-ubuntu:~$ cat /etc/apt/sources.list.d/ubuntu.sources
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
##
## If you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add supplemental sources in /etc/apt/sources.list.d
## c.) make changes to template file
## /etc/cloud/templates/sources.list.ubuntu.deb822.tmpl
##
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
## Ubuntu distribution repository
##
## The following settings can be adjusted to configure which packages to use from Ubuntu.
## Mirror your choices (except for URIs and Suites) in the security section below to
## ensure timely security updates.
##
## Types: Append deb-src to enable the fetching of source package.
## URIs: A URL to the repository (you may add multiple URLs)
## Suites: The following additional suites can be configured
## <name>-updates - Major bug fix updates produced after the final release of the
## distribution.
## <name>-backports - software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
## Components: Aside from main, the following components can be added to the list
## restricted - Software that may not be under a free license, or protected by patents.
## universe - Community maintained packages. Software in this repository receives maintenance
## from volunteers in the Ubuntu community, or a 10 year security maintenance
## commitment from Canonical when an Ubuntu Pro subscription is attached.
## multiverse - Community maintained of restricted. Software from this repository is
## ENTIRELY UNSUPPORTED by the Ubuntu team, and may not be under a free
## licence. Please satisfy yourself as to your rights to use the software.
## Also, please note that software in multiverse WILL NOT receive any
## review or updates from the Ubuntu security team.
##
## See the sources.list(5) manual page for further settings.
Types: deb
URIs: http://azure.archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
## Ubuntu security updates. Aside from URIs and Suites,
## this should mirror your choices in the previous section.
Types: deb
URIs: http://azure.archive.ubuntu.com/ubuntu/
Suites: noble-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
apt will query the mirrors to find the package, download it, and install it, along with its dependencies. Because dpkg does not use repos, it bypasses this automated process. I will be using Ubuntu’s Package website to directly download the deb files from one of the mirrors.
The Ubuntu Packages website for nmap lists all the immediate dependency packages and suggested packages HERE.
I will select the appropriate computer architecture (amd64, in this case), and use one of the mirrors to install the necessary deb files.
Installing Deb Files (In the Correct Order)
I will create a dedicated directory for the deb files on the VM:
mkdir nmap-debs && cd nmap-debs
I checked to see if the package was already installed locally by listing the package:
dpkg -l {package}
andrewtest@lfs203-ubuntu:~$ dpkg -l libgcc-s1
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===============-=====================-============-=================================
ii libgcc-s1:amd64 14.2.0-4ubuntu2~24.04 amd64 GCC support library
libgcc-s1 is already installed.
If the package is not found locally, dpkg will not recognize it.
andrewtest@lfs203-ubuntu:~$ dpkg -l liblinear4
dpkg-query: no packages found matching liblinear4
The order in which we download the deb files does not matter, but the installation order certainly will. I used wget
to download the deb files from a mirror:
wget http://mirrors.kernel.org/ubuntu/pool/universe/n/nmap/nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb
andrewtest@lfs203-ubuntu:~$ sudo wget http://mirrors.kernel.org/ubuntu/pool/universe/n/nmap/nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb
[sudo] password for andrewtest:
--2025-06-26 01:46:55-- http://mirrors.kernel.org/ubuntu/pool/universe/n/nmap/nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb
Resolving mirrors.kernel.org (mirrors.kernel.org)... 139.178.88.99, 2604:1380:45e3:2400::1
Connecting to mirrors.kernel.org (mirrors.kernel.org)|139.178.88.99|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://mirrors.edge.kernel.org/ubuntu/pool/universe/n/nmap/nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb [following]
--2025-06-26 01:46:55-- http://mirrors.edge.kernel.org/ubuntu/pool/universe/n/nmap/nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb
Resolving mirrors.edge.kernel.org (mirrors.edge.kernel.org)... 147.75.199.223, 2604:1380:45d1:ec00::1
Connecting to mirrors.edge.kernel.org (mirrors.edge.kernel.org)|147.75.199.223|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1694204 (1.6M) [application/octet-stream]
Saving to: ‘nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb’
nmap_7.94+git20230807.3be01e 100%[=============================================>] 1.62M 3.62MB/s in 0.4s
2025-06-26 01:46:55 (3.62 MB/s) - ‘nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb’ saved [1694204/1694204]
I checked to see if the package was installed, and if not, downloaded the package from the mirror for the rest of the dependencies for nmap. These are the packages needed to install nmap:
andrewtest@lfs203-ubuntu:~/nmap_debs$ ls -1
liblinear4_2.3.0+dfsg-5build1_amd64.deb
liblua5.4-0_5.4.6-3build2_amd64.deb
libssh2-1t64_1.11.0-4.1build2_amd64.deb
nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb
nmap-common_7.94+git20230807.3be01efb1+dfsg-3build2_all.deb
Installing the Packages
I first attempted to install all deb files at once, anticipating dependency issues:
andrewtest@lfs203-ubuntu:~/nmap_debs$ sudo dpkg -i *.deb
[sudo] password for andrewtest:
Selecting previously unselected package liblinear4:amd64.
(Reading database ... 73103 files and directories currently installed.)
Preparing to unpack liblinear4_2.3.0+dfsg-5build1_amd64.deb ...
Unpacking liblinear4:amd64 (2.3.0+dfsg-5build1) ...
Selecting previously unselected package liblua5.4-0:amd64.
Preparing to unpack liblua5.4-0_5.4.6-3build2_amd64.deb ...
Unpacking liblua5.4-0:amd64 (5.4.6-3build2) ...
Selecting previously unselected package libssh2-1t64:amd64.
Preparing to unpack libssh2-1t64_1.11.0-4.1build2_amd64.deb ...
Unpacking libssh2-1t64:amd64 (1.11.0-4.1build2) ...
Selecting previously unselected package nmap.
Preparing to unpack nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb ...
Unpacking nmap (7.94+git20230807.3be01efb1+dfsg-3build2) ...
Selecting previously unselected package nmap-common.
Preparing to unpack nmap-common_7.94+git20230807.3be01efb1+dfsg-3build2_all.deb ...
Unpacking nmap-common (7.94+git20230807.3be01efb1+dfsg-3build2) ...
dpkg: dependency problems prevent configuration of liblinear4:amd64:
liblinear4:amd64 depends on libblas3 | libblas.so.3; however:
Package libblas3 is not installed.
Package libblas.so.3 is not installed.
dpkg: error processing package liblinear4:amd64 (--install):
dependency problems - leaving unconfigured
Setting up liblua5.4-0:amd64 (5.4.6-3build2) ...
Setting up libssh2-1t64:amd64 (1.11.0-4.1build2) ...
dpkg: dependency problems prevent configuration of nmap:
nmap depends on liblinear4 (>= 2.01+dfsg); however:
Package liblinear4:amd64 is not configured yet.
dpkg: error processing package nmap (--install):
dependency problems - leaving unconfigured
Setting up nmap-common (7.94+git20230807.3be01efb1+dfsg-3build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.4) ...
Processing triggers for man-db (2.12.0-4build2) ...
Errors were encountered while processing:
liblinear4:amd64
nmap
As expected, this did not work as I needed libblas3 for liblinear4. To resolve this, I first need to download and install libblas3.
andrewtest@lfs203-ubuntu:~/nmap_debs$ sudo dpkg -i libblas3_3.12.0-3build1_amd64.deb
Selecting previously unselected package libblas3:amd64.
(Reading database ... 73974 files and directories currently installed.)
Preparing to unpack libblas3_3.12.0-3build1_amd64.deb ...
Unpacking libblas3:amd64 (3.12.0-3build1) ...
Setting up libblas3:amd64 (3.12.0-3build1) ...
update-alternatives: using /usr/lib/x86_64-linux-gnu/blas/libblas.so.3 to provide /usr/lib/x86_64-linux-gnu/libblas.so.3 (libblas.so.3-x86_64-linux-gnu) in auto mode
Processing triggers for libc-bin (2.39-0ubuntu8.4) ...
andrewtest@lfs203-ubuntu:~/nmap_debs$ ls
libblas3_3.12.0-3build1_amd64.deb libssh2-1t64_1.11.0-4.1build2_amd64.deb
liblinear4_2.3.0+dfsg-5build1_amd64.deb nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb
liblua5.4-0_5.4.6-3build2_amd64.deb nmap-common_7.94+git20230807.3be01efb1+dfsg-3build2_all.deb
With libblas3 installed, I proceeded to install the remaining packages in a correct order that respected their dependencies:
andrewtest@lfs203-ubuntu:~/nmap_debs$ sudo dpkg -i liblinear4_2.3.0+dfsg-5build1_amd64.deb
(Reading database ... 73981 files and directories currently installed.)
Preparing to unpack liblinear4_2.3.0+dfsg-5build1_amd64.deb ...
Unpacking liblinear4:amd64 (2.3.0+dfsg-5build1) over (2.3.0+dfsg-5build1) ...
Setting up liblinear4:amd64 (2.3.0+dfsg-5build1) ...
Processing triggers for libc-bin (2.39-0ubuntu8.4) ...
andrewtest@lfs203-ubuntu:~/nmap_debs$ dpkg -l liblinear
dpkg-query: no packages found matching liblinear
andrewtest@lfs203-ubuntu:~/nmap_debs$ dpkg -l liblinear4
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-================-==================-============-=======================================
ii liblinear4:amd64 2.3.0+dfsg-5build1 amd64 Library for Large Linear Classification
andrewtest@lfs203-ubuntu:~/nmap_debs$ sudo dpkg -i liblua5.4-0_5.4.6-3build2_amd64.deb
(Reading database ... 73981 files and directories currently installed.)
Preparing to unpack liblua5.4-0_5.4.6-3build2_amd64.deb ...
Unpacking liblua5.4-0:amd64 (5.4.6-3build2) over (5.4.6-3build2) ...
Setting up liblua5.4-0:amd64 (5.4.6-3build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.4) ...
andrewtest@lfs203-ubuntu:~/nmap_debs$ sudo dpkg -i libssh2-1t64_1.11.0-4.1build2_amd64.deb
(Reading database ... 73981 files and directories currently installed.)
Preparing to unpack libssh2-1t64_1.11.0-4.1build2_amd64.deb ...
Unpacking libssh2-1t64:amd64 (1.11.0-4.1build2) over (1.11.0-4.1build2) ...
Setting up libssh2-1t64:amd64 (1.11.0-4.1build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.4) ...
andrewtest@lfs203-ubuntu:~/nmap_debs$ sudo dpkg -i nmap-common_7.94+git20230807.3be01efb1+dfsg-3build2_all.deb
(Reading database ... 73981 files and directories currently installed.)
Preparing to unpack nmap-common_7.94+git20230807.3be01efb1+dfsg-3build2_all.deb ...
Unpacking nmap-common (7.94+git20230807.3be01efb1+dfsg-3build2) over (7.94+git20230807.3be01efb1+dfsg-3build2) ...
Setting up nmap-common (7.94+git20230807.3be01efb1+dfsg-3build2) ...
andrewtest@lfs203-ubuntu:~/nmap_debs$ sudo dpkg -i nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb
(Reading database ... 73981 files and directories currently installed.)
Preparing to unpack nmap_7.94+git20230807.3be01efb1+dfsg-3build2_amd64.deb ...
Unpacking nmap (7.94+git20230807.3be01efb1+dfsg-3build2) over (7.94+git20230807.3be01efb1+dfsg-3build2) ...
Setting up nmap (7.94+git20230807.3be01efb1+dfsg-3build2) ...
Processing triggers for man-db (2.12.0-4build2) ...
Finally, we can verify nmap is installed and functional:
andrewtest@lfs203-ubuntu:~/nmap_debs$ dpkg -s nmap
Package: nmap
Status: install ok installed
Priority: optional
Section: net
Installed-Size: 4071
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Version: 7.94+git20230807.3be01efb1+dfsg-3build2
Depends: nmap-common (= 7.94+git20230807.3be01efb1+dfsg-3build2), libc6 (>= 2.38), libgcc-s1 (>= 3.3.1), liblinear4 (>= 2.01+dfsg), liblua5.4-0 (>= 5.4.6), libpcap0.8t64 (>= 1.5.1), libpcre2-8-0 (>= 10.32), libssh2-1t64 (>= 1.2.9), libssl3t64 (>= 3.0.0), libstdc++6 (>= 11), zlib1g (>= 1:1.1.4)
Suggests: ncat, ndiff, zenmap
Description: The Network Mapper
Nmap is a utility for network exploration or security auditing. It
supports ping scanning (determine which hosts are up), many port
scanning techniques, version detection (determine service protocols
and application versions listening behind ports), and TCP/IP
fingerprinting (remote host OS or device identification). Nmap also
offers flexible target and port specification, decoy/stealth scanning,
sunRPC scanning, and more. Most Unix and Windows platforms are
supported in both GUI and commandline modes. Several popular handheld
devices are also supported, including the Sharp Zaurus and the iPAQ.
Homepage: https://nmap.org/
Original-Maintainer: Debian Security Tools <team+pkg-security@tracker.debian.org>
andrewtest@lfs203-ubuntu:~/nmap_debs$ dpkg -l nmap
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-=======================================-============-=================================
ii nmap 7.94+git20230807.3be01efb1+dfsg-3build2 amd64 The Network Mapper
andrewtest@lfs203-ubuntu:~/nmap_debs$ which nmap
/usr/bin/nmap
andrewtest@lfs203-ubuntu:~/nmap_debs$ nmap --version
Nmap version 7.94SVN ( https://nmap.org )
Platform: x86_64-pc-linux-gnu
Compiled with: liblua-5.4.6 openssl-3.0.13 libssh2-1.11.0 libz-1.3 libpcre2-10.42 libpcap-1.10.4 nmap-libdnet-1.12 ipv6
Compiled without:
Available nsock engines: epoll poll select
andrewtest@lfs203-ubuntu:~/nmap_debs$ nmap avisiblenetwork.com
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-06-26 18:44 UTC
Nmap scan report for avisiblenetwork.com (20.69.151.16)
Host is up (0.0013s latency).
Not shown: 998 filtered tcp ports (no-response)
PORT STATE SERVICE
80/tcp open http
443/tcp open https
Nmap done: 1 IP address (1 host up) scanned in 4.62 seconds
What I Learned
apt is a powerful tool that addresses many issues from manually managing packages. Because dpkg can only handle deb files locally, there are extra steps involved to download the deb files, manually check dependency issues, install the files in the correct order, etc.
Here are the strengths of apt:
- automatically identifies, downloads, and installs dependencies, including nested ones.
- handles interactions with repos and ensures necessary packages are installed.
- convenience and efficiency of doing all of the processes with one line.
Takeaways
We take for granted the convenience of package managers, and rightly so. The efficiency of rapidly deploying and managing software on systems greatly enhances productivity – something that cannot be beat compared to manual management.
A note on dependencies: software dependency does not stop with the package you want to install at hand. The packages required for one software also may require packages of its own, and thus have dependencies that will not appear in the list of required software you are looking at. In my example, libblas3 was not listed as a required application for nmap. However, liblinear4 required libblas3, so it would not install until libblas3 was installed. These nested dependencies can add significant time to trace and install.
Lastly, here are a few good reads that I came across to better understand the complexities of package management and its histories: