LCA Package Management & Software Installation 5 — Questions and Answers
Question 1: Which command compiles and installs software from source code using the traditional UNIX build method?
- ./configure && make && make install (Correct answer)
- cmake && build && install
- autogen.sh && gcc install
- build-essentials && make all
Correct answer: ./configure && make && make install
The classic source install sequence runs configure to check dependencies, make to compile, and make install to copy binaries to the system.
Question 2: What does the 'rpm -e' command do?
- Erases (uninstalls) a specified package (Correct answer)
- Exports a package to a file
- Edits a package's metadata
- Evaluates package dependencies
Correct answer: Erases (uninstalls) a specified package
rpm -e (erase) removes an installed package from the system while checking for dependent packages.
Question 3: What is the '/etc/yum.repos.d/' directory used for?
- Storing .repo configuration files that define YUM/DNF package repositories (Correct answer)
- Caching downloaded repository metadata
- Storing installed repository packages
- Logging repository access history
Correct answer: Storing .repo configuration files that define YUM/DNF package repositories
Each .repo file in /etc/yum.repos.d/ defines one or more repositories with their URLs, GPG keys, and enabled status.
Question 4: Which apt command removes a package along with its configuration files?
- apt purge <package> (Correct answer)
- apt remove --config <package>
- apt delete <package>
- apt clean <package>
Correct answer: apt purge <package>
'apt purge' removes the package and all its system-wide configuration files, unlike 'apt remove' which leaves configs behind.
Question 5: What information does 'rpm -qi <package>' display?
- Detailed package information including version, architecture, description, and install date (Correct answer)
- A list of files installed by the package
- The package's changelog entries only
- Package installation dependencies only
Correct answer: Detailed package information including version, architecture, description, and install date
rpm -qi (query info) shows package metadata such as name, version, release, architecture, size, description, and installation date.
Question 6: What is the purpose of 'apt-get autoclean' compared to 'apt-get clean'?
- autoclean removes only obsolete cached packages; clean removes all cached packages (Correct answer)
- autoclean removes all caches automatically; clean requires confirmation
- autoclean cleans dependency caches; clean cleans package caches
- They are identical commands with different names
Correct answer: autoclean removes only obsolete cached packages; clean removes all cached packages
apt-get autoclean removes cached .deb files for packages that are no longer downloadable (obsolete), while apt-get clean removes all cached .deb files.
Question 7: When building an RPM package, which directory structure is expected under the RPM build root?
- BUILD, RPMS, SOURCES, SPECS, SRPMS (Correct answer)
- src, bin, lib, doc, spec
- input, output, build, release, source
- compile, package, install, test, publish
Correct answer: BUILD, RPMS, SOURCES, SPECS, SRPMS
The rpmbuild process expects the standard directory structure: SOURCES for tarballs, SPECS for spec files, BUILD for compilation, RPMS for binary RPMs, and SRPMS for source RPMs.
Which command compiles and installs software from source code using the traditional UNIX build method?