Linux+ CompTIA Linux+ Linux Installation and Package Management 2 — Questions and Answers
Question 1: Which command displays detailed information about an installed RPM package, including version, release, and description?
- rpm -qi <package> (Correct answer)
- rpm -ql <package>
- rpm -qR <package>
- rpm -qd <package>
Correct answer: rpm -qi <package>
The `rpm -qi` command queries (-q) package information (-i) including name, version, release, architecture, and description.
Question 2: During a Linux installation, which partition mount point is REQUIRED for the system to boot successfully?
- /boot (Correct answer)
- /home
- /var
- /tmp
Correct answer: /boot
The /boot partition holds the kernel and bootloader files (GRUB), which are essential for the system to initialize and boot.
Question 3: A system administrator needs to add a new repository to a RHEL-based system so dnf can find packages from it. Which file location is appropriate?
- /etc/yum.repos.d/ (Correct answer)
- /etc/dnf/dnf.conf
- /var/cache/dnf/
- /usr/share/dnf/
Correct answer: /etc/yum.repos.d/
Custom repository definitions are placed as .repo files inside /etc/yum.repos.d/, which dnf scans for available package sources.
Question 4: Which apt command removes a package AND its configuration files from a Debian-based system?
- apt purge <package> (Correct answer)
- apt remove <package>
- apt clean <package>
- apt autoremove <package>
Correct answer: apt purge <package>
`apt purge` removes the package binary AND its configuration files, whereas `apt remove` leaves configuration files behind.
Question 5: When compiling software from source, what is the correct sequence of commands?
- ./configure → make → make install (Correct answer)
- make → ./configure → make install
- make install → ./configure → make
- ./configure → make install → make
Correct answer: ./configure → make → make install
./configure checks dependencies and generates a Makefile, make compiles the code, and make install copies binaries to the system.
Question 6: Which command lists all files installed by a specific Debian package without running the package installation?
- dpkg -L <package> (Correct answer)
- dpkg -l <package>
- dpkg -s <package>
- dpkg -c <package>
Correct answer: dpkg -L <package>
`dpkg -L` (uppercase L) lists all files belonging to an already-installed package by reading the dpkg database.
Question 7: A technician wants to verify the integrity of a downloaded RPM file before installing it. Which command accomplishes this?
- rpm -K <package.rpm>
- rpm -V <package.rpm>
- rpm --checksig <package.rpm>
- Both A and C are correct (Correct answer)
Correct answer: Both A and C are correct
`rpm -K` and `rpm --checksig` are synonymous commands that verify the GPG signature and MD5 checksum of an RPM file.
Which command displays detailed information about an installed RPM package, including version, release, and description?