010-160 Package Management 2 — Questions and Answers
Question 1: Which command upgrades all installed packages on a Debian-based system?
- apt-get update
- apt-get upgrade (Correct answer)
- dpkg --upgrade
- apt-cache upgrade
Correct answer: apt-get upgrade
'apt-get upgrade' downloads and installs the newest versions of all currently installed packages.
Question 2: What does the 'apt-cache search' command do?
- Installs a package from cache
- Searches the local package index for matching packages (Correct answer)
- Clears cached package files
- Validates package integrity
Correct answer: Searches the local package index for matching packages
'apt-cache search' searches the local package database for packages matching a keyword or pattern.
Question 3: Which command would display detailed information about a package using APT?
- apt-get info
- apt-cache show (Correct answer)
- dpkg --describe
- apt-list details
Correct answer: apt-cache show
'apt-cache show packagename' displays detailed metadata about a package including its description, version, and dependencies.
Question 4: When using dpkg to install a local .deb file, which option is correct?
- dpkg -q package.deb
- dpkg -r package.deb
- dpkg -i package.deb (Correct answer)
- dpkg -l package.deb
Correct answer: dpkg -i package.deb
dpkg -i installs a .deb package file directly from the local filesystem.
Question 5: Which tool is the next-generation replacement for yum on Fedora and RHEL 8+?
- apt
- zypper
- dnf (Correct answer)
- pacman
Correct answer: dnf
DNF (Dandified YUM) replaced yum as the default package manager in Fedora and RHEL 8 and later.
Question 6: What is a software repository in the context of Linux package management?
- A local directory where compiled binaries are stored
- A remote or local storage location from which packages are downloaded and installed (Correct answer)
- A version control system for tracking changes to packages
- A configuration file that maps package names to their dependencies
Correct answer: A remote or local storage location from which packages are downloaded and installed
A repository is a centralized server or location that hosts packages available for download by a package manager.
Question 7: Which command removes a package but keeps its configuration files on a Debian system?
- apt-get purge
- apt-get remove (Correct answer)
- dpkg --delete
- apt-get clean
Correct answer: apt-get remove
'apt-get remove' uninstalls the package binaries but retains configuration files, unlike 'purge' which removes everything.
Which command upgrades all installed packages on a Debian-based system?