Exercise 2: The Same .deb File Fails Under dpkg but Works Under apt — Possible Solution ==================================================================== WHAT dpkg ACTUALLY DOES, PER THIS CHAPTER ------------------------------ Per this chapter, "dpkg is the low-level tool that actually installs a single .deb file - it has no concept of fetching a package from anywhere, and no automatic dependency resolution; handing it a package whose dependencies aren't already present simply fails." Running dpkg -i directly against the downloaded file attempts to install exactly that one package and nothing else - if it depends on other packages that aren't already installed on the system, dpkg has no mechanism to go find and install them. WHAT apt ACTUALLY DOES DIFFERENTLY ------------------------------ Per this chapter, "apt is the high-level tool built on top of it - it resolves dependencies, fetches packages (and their dependencies) from configured repositories, and calls dpkg underneath to actually perform the install." When apt installs the same .deb file, it first checks what that package depends on, fetches any missing dependencies from the system's configured repositories, installs those first, and only then calls dpkg to complete the installation of the original package - using the exact same dpkg underneath, just with the missing pieces already resolved beforehand. WHY THE SAME FILE PRODUCES DIFFERENT RESULTS ------------------------------ The .deb file itself is identical in both cases - the difference is entirely in which tool is being asked to install it. dpkg alone simply has no way to obtain the dependencies the package needs, so it fails outright when they're missing. apt performs the exact same underlying install (via dpkg) but only after ensuring every dependency the package actually needs is already present, which is precisely why the same file succeeds under apt when it failed under dpkg alone. WHY THIS ISN'T dpkg BEING "BROKEN" ------------------------------ dpkg working this way isn't a limitation to be fixed - the two tools are deliberately layered, with dpkg handling the low-level mechanics of actually placing files and registering the package, and apt handling the higher-level job of ensuring everything that package needs is available first. Each tool is doing exactly its own designed job. WHY THIS WORKS AS AN ANSWER ------------------------------ It contrasts what dpkg and apt each actually do using this chapter's own explanation, and explains precisely why the identical file behaves differently depending on which tool is used - dpkg's lack of dependency resolution versus apt's automatic handling of it before calling dpkg itself.