Package Management

0%
Packagesaptyumdnfrpmdpkgpackagesrepositories

Package Management

6 interactive questions

PackagesQuestion
aptyumdnfrpmdpkgpackagesrepositories

`apt update` vs `apt upgrade` vs `apt install`?

Click to reveal answer
PackagesAnswer

apt update refreshes the package index (metadata) from repos. apt upgrade installs available upgrades for already installed packages. apt install <pkg> fetches and installs a new package with dependencies. ⚠️ Always update before upgrade/install.

PackagesQuestion
aptyumdnfrpmdpkgpackagesrepositories

`dpkg` vs `apt`?

Click to reveal answer
PackagesAnswer

dpkg is the low-level tool that installs .deb files directly (no dependency resolution). apt is the high-level front-end that resolves deps, downloads from repos, and calls dpkg. Use apt for daily work; dpkg -i file.deb for local files.

PackagesQuestion
aptyumdnfrpmdpkgpackagesrepositories

How do you find which package owns a file?

Click to reveal answer
PackagesAnswer

dpkg -S /path/to/file (Debian/Ubuntu) or rpm -qf /path/to/file (RHEL/Fedora).

PackagesQuestion
aptyumdnfrpmdpkgpackagesrepositories

What is a PPA?

Click to reveal answer
PackagesAnswer

Personal Package Archive — a Launchpad-hosted repo for Ubuntu. add-apt-repository ppa:user/ppa adds it, then apt update. ⚠️ Third-party; verify trust before adding.

PackagesQuestion
aptyumdnfrpmdpkgpackagesrepositories

How do you hold a package at a specific version?

Click to reveal answer
PackagesAnswer

apt-mark hold <pkg> prevents upgrades. apt-mark unhold <pkg> releases it. apt-mark showhold lists held packages.

PackagesQuestion
aptyumdnfrpmdpkgpackagesrepositories

How do you clean up apt cache?

Click to reveal answer
PackagesAnswer

apt clean removes all .deb files from /var/cache/apt/archives/. apt autoclean removes only obsolete (uninstallable) packages. apt autoremove removes auto-installed deps no longer needed.