CCNA Linux Installation and Package Management Questions

75 of 82 questions · Page 1/2 · Linux Installation and Package Management · Answers revealed

1
MCQhard

Refer to the exhibit. After modifying /etc/default/grub to enable serial console output, which command must be run to apply the changes to the GRUB configuration?

A.grub-editenv
B.grub-install
C.grub-set-default
D.update-grub
AnswerD

This runs grub-mkconfig to generate grub.cfg from /etc/default/grub and /etc/grub.d/.

Why this answer

On systems with GRUB 2, the command to regenerate grub.cfg is 'update-grub' (or 'grub-mkconfig -o /boot/grub/grub.cfg'). 'grub-install' installs GRUB to disk, not update config. 'grub-set-default' sets default entry but doesn't regenerate config. 'grub-editenv' modifies environment block.

2
MCQhard

A company maintains a private Debian repository for internal packages. A new package 'internal-tool' version 2.0 has been added to the repository, but when users run 'apt-get update && apt-get install internal-tool', the old version 1.0 is still being offered. What is the most likely cause?

A.The package version number is not higher than the installed version
B.The local apt cache needs to be cleared with 'apt-get clean'
C.The 'apt-get update' command did not run successfully due to network issues
D.The repository's Release file has not been regenerated after adding the new package
AnswerD

apt uses the Release file to check validity; if outdated, it may ignore new Packages files.

Why this answer

The most likely cause is that the repository's Release file has not been regenerated after adding the new package. APT relies on the Release file (and its associated InRelease or Release.gpg) to obtain the current package metadata, including version information. If the Release file is not updated to reflect the new package version 2.0, APT will still see the old metadata and offer version 1.0, even though the package file exists in the repository.

Exam trap

The trap here is that candidates often assume the problem is with the local client cache (option B) or network issues (option C), when the real issue is a server-side metadata synchronization failure that prevents APT from discovering the new package version.

How to eliminate wrong answers

Option A is wrong because if the package version number (2.0) is higher than the installed version (1.0), APT would normally offer the upgrade; the issue is not about version comparison but about metadata not reflecting the new version. Option B is wrong because 'apt-get clean' only removes downloaded package files (.deb) from the local cache, not the metadata cache; the metadata is refreshed by 'apt-get update', and clearing the package cache would not fix a missing Release file update. Option C is wrong because the question states users run 'apt-get update && apt-get install internal-tool', implying the update command ran; if it had failed due to network issues, users would likely see an error message, not a silent offering of the old version.

3
MCQhard

You are a Linux administrator for a company that uses a custom RPM-based distribution. The development team has built a new version of the internal tool 'monitor-app' (version 2.0) and placed the RPM package in a local YUM repository located at http://internal.repo/monitor-app-2.0.el7.x86_64.rpm. The repository metadata has been updated using 'createrepo'. On a test server running CentOS 7, you run 'yum update monitor-app' but the system reports 'No packages marked for update'. The currently installed version is 1.0. You verify that the repository is enabled and accessible via 'yum repolist'. What is the most likely cause and the correct course of action?

A.Download the RPM and install it locally with 'rpm -Uvh monitor-app-2.0.el7.x86_64.rpm'
B.Run 'yum list available | grep monitor' to see if the package is listed with a different name, then install it with the exact name
C.Check the version number in the repository using 'yum info monitor-app' and compare with installed version
D.Run 'yum clean all' and then 'yum update monitor-app' again
AnswerB

This identifies the exact package name in the repository.

Why this answer

Option B is correct because the most likely cause is that the package name in the repository differs from the installed package name (e.g., 'monitor-app' vs. 'monitor-app-2.0'). Running 'yum list available | grep monitor' will reveal the exact package name in the repository, allowing you to install it with the correct name. This is a common scenario when package naming conventions change between versions or when the repository uses a different naming scheme than the installed package.

Exam trap

The trap here is that candidates assume the package name in the repository is identical to the installed package name, leading them to try cache-clearing or local RPM installation instead of verifying the actual package name in the repository.

How to eliminate wrong answers

Option A is wrong because downloading and installing the RPM locally with 'rpm -Uvh' bypasses YUM's dependency resolution and repository metadata, which can lead to broken dependencies or conflicts, and does not address why YUM did not detect the update. Option C is wrong because 'yum info monitor-app' will show the same installed version (1.0) if the package name in the repository does not match the installed package name, so it would not reveal the discrepancy. Option D is wrong because 'yum clean all' clears the local cache but does not fix the underlying issue of a mismatched package name; if the package name is different, YUM will still not see it as an update after cleaning the cache.

4
MCQeasy

A technician needs to add the official Debian repository for the 'buster' release. Which line should be added to /etc/apt/sources.list?

A.`deb http://deb.debian.org/debian buster-updates main`
B.`deb-src http://deb.debian.org/debian buster main`
C.`rpm http://deb.debian.org/debian buster main`
D.`deb http://deb.debian.org/debian buster main`
AnswerD

Standard format for binary package repository.

Why this answer

The correct format for a Debian repository line is `deb http://deb.debian.org/debian buster main`. The other options are incorrect: `deb-src` is for source packages, the line with `buster-updates` is for updates, and `rpm` is not used on Debian.

5
MCQmedium

A system administrator needs to find out which package installed the file /usr/bin/foo on a Red Hat system. Which command should be used?

A.`rpm -qa /usr/bin/foo`
B.`rpm -qi /usr/bin/foo`
C.`rpm -ql /usr/bin/foo`
D.`rpm -qf /usr/bin/foo`
AnswerD

Queries the package that owns the file.

Why this answer

`rpm -qf /path/to/file` queries the RPM database to determine which package owns the specified file. The other options are incorrect: `rpm -ql` lists files in a package, `rpm -qi` shows package information, and `rpm -qa` lists all installed packages.

6
MCQeasy

A system administrator needs to install a local Debian package file named 'myapp.deb'. Which command should be used?

A.rpm -ivh myapp.deb
B.aptitude install myapp.deb
C.dpkg -i myapp.deb
D.apt-get install myapp.deb
AnswerC

dpkg -i installs a package from a .deb file.

Why this answer

The correct command to install a local Debian package file is `dpkg -i myapp.deb`. The `dpkg` tool is the low-level package manager for Debian-based systems that directly handles `.deb` files, and the `-i` flag triggers installation. Unlike `apt-get` or `aptitude`, `dpkg` does not resolve dependencies automatically, but it is the proper tool for installing a standalone `.deb` file from disk.

Exam trap

The trap here is that candidates confuse `dpkg` with `apt-get` or `aptitude`, assuming that any package manager can install a local file, but only `dpkg` directly handles `.deb` files without requiring a repository lookup.

How to eliminate wrong answers

Option A is wrong because `rpm -ivh` is used for RPM-based distributions (e.g., Red Hat, Fedora) and cannot process `.deb` files; it would fail with an error about an invalid package format. Option B is wrong because `aptitude install` expects a package name from a repository, not a local file path; while `aptitude` can install a `.deb` file with `./myapp.deb` syntax, the standard and most direct command for a local `.deb` is `dpkg -i`. Option D is wrong because `apt-get install` also expects a package name from a repository, not a local file; it would attempt to fetch 'myapp.deb' from configured sources and fail, as it does not accept a file path directly.

7
MCQeasy

A system administrator needs to remove a package called 'apache2' from a Red Hat Enterprise Linux system while leaving its configuration files intact. Which command accomplishes this?

A.yum erase apache2
B.yum remove apache2
C.rpm -e apache2
D.rpm -F apache2
AnswerC

Removes package but preserves configuration files.

Why this answer

Option D is correct because rpm -e removes the package but leaves config files if they are not marked as configuration. Option A is incorrect because yum remove removes config files by default. Option B is incorrect because rpm -F upgrades packages, not removes.

Option C is incorrect because yum erase is synonymous with yum remove, which removes config files.

8
MCQhard

You are responsible for maintaining a legacy Red Hat Enterprise Linux 6 server that hosts an internal web application. The application was compiled years ago and relies on an old version of OpenSSL (0.9.8). Due to a security audit, you must update OpenSSL to 1.0.1 but the application fails to run with the new version. The vendor no longer supports the application. You must keep the system secure while keeping the application operational. You have access to the application source code but cannot modify it. What is the best solution?

A.Modify the application source code to be compatible with OpenSSL 1.0.1 and recompile.
B.Update OpenSSL system-wide and use 'LD_PRELOAD' to load the old library for the application.
C.Keep OpenSSL 0.9.8 and accept the risk.
D.Install OpenSSL 1.0.1 in /usr/local/lib and keep 0.9.8 in /usr/lib. Rebuild the application with an RPATH pointing to /usr/local/lib/openssl0.9.8.
AnswerD

Keeps both versions, application uses old one via RPATH.

Why this answer

Installing both versions allows the application to link dynamically to the old library if it's placed in a non-standard path and the application's RPATH is set. Option A is insecure. Option B is drastic.

Option D requires source modification, which is not allowed.

9
MCQhard

An RPM-based system has a package 'example-1.0' installed, but a newer version 'example-2.0' is available in a repository. Which command will upgrade the package?

A.rpm -Uvh example-2.0.rpm
B.yum update example
C.yum check-update example
D.yum install example
AnswerB

yum update updates the specified package from the repository.

Why this answer

Option B is correct because 'yum update example' is the standard command to upgrade a specific package to the latest available version from configured repositories. YUM automatically resolves dependencies and retrieves the newer package from the repository, making it the appropriate tool for upgrading from a repository source.

Exam trap

The trap here is that candidates often confuse 'yum install' (which installs a new package or upgrades if already installed but is not the standard upgrade command) with 'yum update' (the explicit command for upgrading installed packages), or they mistakenly think 'rpm -Uvh' works with repository packages without a local file.

How to eliminate wrong answers

Option A is wrong because 'rpm -Uvh example-2.0.rpm' requires a local RPM file and does not query repositories; it would fail if the file is not present locally, and it bypasses automatic dependency resolution from repositories. Option C is wrong because 'yum check-update example' only lists available updates without performing any upgrade; it is a query command, not an installation command. Option D is wrong because 'yum install example' would install the package if not present, but if the package is already installed, it may not upgrade to a newer version unless the installed version is older; however, 'yum update' is the explicit command for upgrading an already installed package.

10
MCQhard

An RPM-based system reports a file conflict during package installation. Which option to the rpm command will allow the installation to overwrite files from another package?

A.--force
B.--replacefiles
C.--nodeps
D.--justdb
AnswerB

This option replaces files from other packages.

Why this answer

The --replacefiles option tells rpm to overwrite files that already exist on the system from a different package, resolving file conflicts during installation. This is the correct and targeted way to allow overwriting without bypassing other important checks.

Exam trap

The trap here is that candidates often choose --force because it sounds like it would force overwrites, but it is a blunt instrument that also skips dependency checks, which is not what the question asks for.

How to eliminate wrong answers

Option A is wrong because --force is a legacy alias that actually combines --replacepkgs, --replacefiles, and --nodeps, which is overly broad and can mask dependency issues. Option C is wrong because --nodeps skips dependency checks entirely, not file conflict resolution. Option D is wrong because --justdb only updates the RPM database without actually installing or overwriting any files on disk.

11
MCQmedium

You are a Linux consultant hired by a university IT department. They have a custom scientific application that must be compiled from source on a cluster of identical workstations running Ubuntu 20.04. The compilation process requires a specific version of a library (libfoo 1.2) that is not available in the standard repositories, but an older version (libfoo 1.0) is available. You must provide instructions for installing libfoo 1.2 without breaking the system. The workstations have no internet access to external repositories; they can only access an internal repository. You have the source code and a .deb package for libfoo 1.2 built previously. Which approach would you recommend?

A.Install the pre-built .deb package using 'dpkg -i libfoo_1.2.deb' and then fix any dependency issues with 'apt-get install -f'.
B.Create a chroot environment with the required library and compile the application inside it.
C.Force install the library over the existing one using 'dpkg --force-depends -i'.
D.Download the source, configure with custom prefix and run 'make install' to place libraries in /usr/local/lib, then set LD_LIBRARY_PATH.
AnswerA

This is the standard way to install a local .deb.

Why this answer

Installing the pre-built .deb package with dpkg handles dependencies correctly if met. Option B is bad because it could break other packages. Option C may introduce incompatibilities with system libraries.

Option D is complex and unnecessary if a .deb exists.

12
Multi-Selecteasy

Which two commands can be used to list all packages that have the string 'kernel' in their name on a Debian system? (Choose two.)

Select 2 answers
A.`apt list --installed '*kernel*'`
B.`dpkg -l '*kernel*'`
C.`dpkg --get-selections | grep kernel`
D.`apt-cache search kernel`
E.`rpm -qa | grep kernel`
AnswersA, B

Lists installed packages matching the pattern.

Why this answer

`dpkg -l '*kernel*'` lists packages matching the pattern using dpkg's wildcard. `apt list --installed '*kernel*'` does the same using apt. `apt-cache search` searches package names and descriptions, not just names. `dpkg --get-selections` with grep can also work but not as direct. `rpm -qa` is for RPM-based systems.

13
Multi-Selectmedium

A Debian system has some partially installed packages due to a failed installation. Which TWO commands can help resolve the broken dependencies? (Choose exactly two.)

Select 2 answers
A.apt-get -f install
B.apt-get dist-upgrade
C.apt-get upgrade
D.dpkg --configure -a
E.apt-get remove --purge
AnswersA, D

Fixes broken dependencies.

Why this answer

Options A and C are correct. apt-get -f install attempts to fix broken dependencies. dpkg --configure -a configures any unpacked packages that were left half-configured. Option B is incorrect because apt-get upgrade only upgrades, does not fix broken. Option D is incorrect because apt-get dist-upgrade handles dependencies but may also remove packages; it is not specifically for fixing broken installations.

Option E is incorrect because apt-get remove removes packages, not fix.

14
MCQhard

The exhibit shows output from an RPM query on a RHEL 8 system. The installation time is shown as a Unix timestamp. Which command would display the installation date of the openssh-server package in a human-readable format?

A.rpm -q --dump openssh-server
B.rpm -q --changelog openssh-server
C.rpm -qi openssh-server
D.rpm -q --scripts openssh-server
AnswerC

Shows package info including install date.

Why this answer

Option D is correct because rpm -qi shows detailed information including installation date. Option A is incorrect because rpm -q --changelog shows changelog. Option B is incorrect because rpm -q --scripts shows scripts.

Option C is incorrect because rpm -q --dump shows file dump.

15
MCQeasy

A technician needs to remove a package named 'apache2' along with its configuration files from a Debian system. Which command should be used?

A.dpkg -r apache2
B.apt-get autoremove apache2
C.apt-get purge apache2
D.apt-get remove apache2
AnswerC

Removes package and config files.

Why this answer

Option C is correct because the 'apt-get purge' command removes the specified package along with its configuration files from a Debian system. Unlike 'remove', which leaves configuration files intact, 'purge' deletes both the package binaries and the associated configuration data from /etc and other locations, fulfilling the requirement to remove 'apache2' completely.

Exam trap

The trap here is that candidates often confuse 'apt-get remove' with 'apt-get purge', mistakenly thinking 'remove' also deletes configuration files, or they incorrectly assume 'dpkg -r' performs a purge, when in fact it only removes the package without configuration cleanup.

How to eliminate wrong answers

Option A is wrong because 'dpkg -r apache2' removes the package but leaves configuration files on the system, which does not meet the requirement to remove configuration files. Option B is wrong because 'apt-get autoremove' is used to remove packages that were automatically installed as dependencies and are no longer needed; it does not accept a package name as an argument to remove a specific package like 'apache2'. Option D is wrong because 'apt-get remove apache2' removes the package binaries but retains configuration files, failing to satisfy the requirement to remove them.

16
Matchingmedium

Match each SELinux context component to its purpose.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

SELinux user identity

Role-based access control component

Type enforcement (most common)

Multi-Level Security sensitivity level

Combined sensitivity and category set

Why these pairings

Components of an SELinux security context (user:role:type:level).

17
Multi-Selectmedium

Which three options are valid ways to install a package 'curl' on a RHEL 8 system? (Choose three.)

Select 3 answers
A.`apt-get install curl`
B.`dnf install curl`
C.`rpm -i curl.rpm`
D.`yum install curl`
E.`zypper install curl`
AnswersB, C, D

Dnf is the default package manager on RHEL 8.

Why this answer

Option B is correct because `dnf` is the default package manager on RHEL 8, replacing `yum` for handling RPM packages with automatic dependency resolution. It directly installs the `curl` package from configured repositories.

Exam trap

The trap here is that candidates may think `yum` is obsolete on RHEL 8, but it still works as a compatibility wrapper, while `apt-get` and `zypper` are clearly from different distributions, and `rpm -i` requires a local file, not a package name.

18
MCQhard

An organization uses a custom YUM repository. After adding a new RPM package to the repository, clients running 'yum update' do not see the new package. The repository metadata was regenerated using 'createrepo'. What is the most likely reason the clients are not seeing the update?

A.Clients have cached metadata and need to run 'yum clean all' or wait for cache expiration
B.The 'gpgcheck=1' option in the repo file prevents metadata download
C.The repository metadata was not signed with a GPG key
D.The RPM package version number is lower than the currently installed version
AnswerA

Yum caches repomd.xml; a fresh 'yum makecache' is needed.

Why this answer

Option A is correct because YUM clients cache repository metadata locally to improve performance. When a new package is added to a repository and 'createrepo' regenerates the metadata, clients will not see the update until they refresh their cached metadata. Running 'yum clean all' removes the cached metadata and forces a fresh download, or the cache will expire based on the 'metadata_expire' setting in the repo configuration (default is 6 hours).

Exam trap

The trap here is that candidates may think GPG signing or version numbers are the cause, but the real issue is that YUM's metadata caching prevents clients from immediately seeing repository changes without a cache refresh.

How to eliminate wrong answers

Option B is wrong because 'gpgcheck=1' only enables GPG signature verification on packages after they are downloaded, it does not prevent metadata download or repository access. Option C is wrong because repository metadata does not need to be signed with a GPG key for clients to download and use it; GPG signing of metadata is optional and not required for 'yum update' to see new packages. Option D is wrong because if the RPM package version number is lower than the currently installed version, YUM would simply not upgrade it, but the client would still see the package in the repository listing; the question states clients do not see the new package at all, indicating a metadata freshness issue, not a version comparison.

19
Drag & Dropmedium

Order the steps to configure a Linux system to use a proxy server for HTTP.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order

Why this order

Proxy configuration involves setting environment variables and application-specific configs.

20
Multi-Selecteasy

Which TWO commands are used to manage Debian packages? (Choose two.)

Select 2 answers
A.zypper
B.apt-get
C.dpkg
D.yum
E.rpm
AnswersB, C

apt-get manages .deb packages via repositories.

Why this answer

dpkg is the low-level Debian package manager, and apt-get (or apt) is the higher-level tool. rpm and yum are for Red Hat-based systems. zypper is for SUSE.

21
MCQhard

A DevOps engineer is setting up an automated build pipeline for a Python application on a Debian system. The application must be packaged into a .deb for deployment. The engineer writes a Makefile that creates the package but the final 'dpkg -i' step fails due to unmet dependencies: the application requires python3-requests >= 2.0, but the repositories provide 1.0. The team has a local mirror with custom packages including python3-requests 2.0. The mirror is correctly listed in /etc/apt/sources.list. The engineer runs 'apt-get update' before building, but the dependency resolution still fails. What is the most likely cause?

A.The engineer must set the --force-depends option to skip dependency checks.
B.The .deb package should be installed using 'apt install ./package.deb' instead of 'dpkg -i'.
C.The 'apt-get update' command did not run successfully; the engineer should check the output.
D.The python3-requests 2.0 package has not been correctly built or uploaded to the local mirror.
AnswerB

apt automatically resolves and installs dependencies from repositories.

Why this answer

dpkg does not resolve dependencies; it only checks the local dpkg database. The solution is to use a higher-level tool like 'apt' that handles dependencies. Option B is wrong because apt-get update was run.

Option C is redundant but not the cause of dpkg failure. Option D is not necessary.

22
MCQmedium

Refer to the exhibit. The system administrator wants to determine which package provides the file /etc/passwd. Based on the output, which command would be most appropriate to find the package?

A.`dpkg -L base-passwd`
B.`apt-file search /etc/passwd`
C.`dpkg -S /etc/passwd`
D.`apt-cache show /etc/passwd`
AnswerC

Searches for the package that owns the file.

Why this answer

`dpkg -S /path` searches the installed packages for ownership of the file. `apt-file search` can also do this but is not installed by default. `dpkg -L` lists files in a package, not the reverse. `apt-cache show` shows package info, not file ownership.

23
MCQeasy

You are a junior administrator for a company that uses a standard disk image for all Linux servers. The image is based on CentOS 7. You need to ensure that new servers automatically install all available security updates during the first boot. You plan to run a command in a startup script. Which command should you use?

A.yum check-update
B.yum install yum-cron
C.yum update -y
D.apt-get upgrade -y
AnswerC

Updates all packages automatically.

Why this answer

Option C is correct because `yum update -y` installs all available updates, including security updates, without prompting for confirmation. On CentOS 7, this command updates all packages to their latest versions, which encompasses security patches. Running this in a startup script ensures that security updates are applied automatically on first boot.

Exam trap

The trap here is that candidates may confuse the command for listing updates (`check-update`) with the command for installing them, or mistakenly apply a Debian-based command (`apt-get`) to a Red Hat-based system like CentOS 7.

How to eliminate wrong answers

Option A is wrong because `yum check-update` only lists available updates without installing any, so it would not apply security updates. Option B is wrong because `yum install yum-cron` installs the yum-cron package, which is used for automatic periodic updates, but does not itself install updates immediately; it requires configuration and is not a one-time command for first boot. Option D is wrong because `apt-get upgrade -y` is a Debian/Ubuntu package manager command, not applicable to CentOS 7 which uses yum (or dnf in later versions).

24
MCQeasy

Which command lists all installed packages on a Debian-based system by querying the dpkg database?

A.apt-cache search .
B.dpkg -L
C.dpkg --get-selections
D.apt-show-versions
AnswerC

Lists all installed packages.

Why this answer

Option C is correct because `dpkg --get-selections` queries the dpkg database directly and outputs a list of all installed packages along with their installation state (e.g., 'install'). This command does not rely on remote repositories or cache files, making it a reliable method for listing installed packages on a Debian-based system.

Exam trap

The trap here is that candidates confuse `dpkg -L` (which lists files for a specific package) with a command that lists all installed packages, or they assume `apt-cache search .` shows only installed packages when it actually queries the entire repository cache.

How to eliminate wrong answers

Option A is wrong because `apt-cache search .` searches the APT package cache for packages matching a pattern (the dot matches any character), but it lists all available packages in the repositories, not just those installed. Option B is wrong because `dpkg -L` lists files installed by a specific package (e.g., `dpkg -L bash`), not all installed packages; it requires a package name as an argument. Option D is wrong because `apt-show-versions` is not a standard Debian command; the correct tool for showing installed package versions is `apt list --installed` or `dpkg -l`, and `apt-show-versions` is a third-party script that may not be present by default.

25
MCQeasy

A systems administrator downloads a .deb package file but it fails to install due to unmet dependencies. Which command sequence should be used to resolve the dependencies and complete the installation?

A.apt-get install -f
B.dpkg -i package.deb; apt-get install -f
C.dpkg --configure -a
D.apt-get upgrade
AnswerB

dpkg -i installs the package; apt-get install -f resolves dependencies.

Why this answer

Option A is correct because dpkg -i installs the package and then apt-get install -f fixes broken dependencies. Option B is incorrect because dpkg --configure -a only configures partially installed packages but does not fetch missing dependencies. Option C is incorrect because apt-get install -f alone does not install the .deb.

Option D is incorrect because apt-get upgrade upgrades packages but does not fix missing dependencies.

26
MCQeasy

An administrator added a new APT repository to sources.list. Which command must be run to make the system aware of the packages from that repository?

A.apt-get upgrade
B.apt upgrade
C.apt-cache search
D.apt update
AnswerD

apt update synchronizes the package index files from sources.

Why this answer

The 'apt update' (or 'apt-get update') command refreshes the package index. 'apt upgrade' and 'apt-get upgrade' upgrade installed packages. 'apt-cache' is used for querying the package cache.

27
Drag & Dropmedium

Arrange the steps to schedule a cron job that runs a script every day at 2 AM.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order

Why this order

Crontab -e opens the user's cron file; the syntax minute hour day month weekday command must be correct.

28
MCQeasy

You are the system administrator of a small office network. The company has a Debian-based server that runs a critical database application. The database package was installed from the official Debian repository. After an ‘apt upgrade’, the database service fails to start. The error log indicates a library version mismatch. You suspect the upgrade updated a shared library that the database depends on, but the database binary was not updated because the repository no longer supports it. The vendor provides a custom .deb package for the database on their website. You need to restore the database functionality as quickly as possible, but you also want to avoid breaking other packages that may depend on the newer library. What should you do?

A.Restore the entire system from a backup taken before the upgrade.
B.Download the vendor's .deb package and install it using 'dpkg -i' after removing the old database package.
C.Downgrade the library to the previous version using 'apt-get install <package>=<oldversion>'.
D.Use 'dpkg --force-depends -i' to force installation of the old database binary against the new library.
AnswerB

Vendor's package should be compatible and minimize disruption.

Why this answer

Option B is correct: Reinstall the database using the vendor's .deb package, as it was designed for the current library versions. Option A is wrong because downgrading the library could break other packages that depend on the newer version. Option C is wrong because forcing an older library version without--no-deps still affects the system.

Option D is wrong because reverting the entire system is overly drastic and may cause data loss.

29
Multi-Selecthard

Which THREE locations are used to configure package repositories on a typical Linux system? (Choose three.)

Select 3 answers
A./etc/zypp/repos.d/
B./etc/apt.conf.d/
C./etc/yum.repos.d/
D./etc/pacman.d/
E./etc/apt/sources.list
AnswersA, C, E

Repository directory for Zypper.

Why this answer

/etc/apt/sources.list is for APT (Debian/Ubuntu). /etc/yum.repos.d/ is a directory for YUM/DNF repository files (Red Hat). /etc/zypp/repos.d/ is for Zypper (SUSE). /etc/apt.conf.d/ is for APT configuration, not repositories. /etc/pacman.d/ is for Arch Linux (not in LPIC scope).

30
Multi-Selecthard

A system administrator is troubleshooting a package dependency issue on a Debian system. Which three commands can be used to display dependency information for a package? (Choose three.)

Select 3 answers
A.`dpkg --info curl.deb`
B.`apt show curl`
C.`apt-cache depends curl`
D.`dpkg -s curl`
E.`apt-get check`
AnswersB, C, D

Displays package details including dependencies.

Why this answer

`apt-cache depends` shows dependencies of a package. `apt show` displays package info including dependencies. `dpkg -s` shows package status including dependencies. `apt-get check` only verifies the system for broken dependencies, not for a specific package. `dpkg --info` shows info from a .deb file, not the installed database.

31
Multi-Selecthard

Which THREE are valid fields in a GRUB 2 configuration file (grub.cfg) generated by update-grub? (Choose three.)

Select 3 answers
A.set root
B.password
C.chainloader
D.linux
E.menuentry
AnswersA, D, E

This sets the device for the kernel and initrd.

Why this answer

A is correct because 'set root' is a valid GRUB 2 command used in grub.cfg to specify the root device (e.g., 'set root=(hd0,msdos1)') from which GRUB loads kernel and initrd images. This directive is automatically generated by update-grub based on the system's partition layout.

Exam trap

The trap here is that candidates confuse GRUB Legacy syntax (like 'password' or 'chainloader' being common in manual entries) with the auto-generated GRUB 2 configuration, which only includes 'set root', 'linux', and 'menuentry' as core directives produced by update-grub.

32
Multi-Selectmedium

Which TWO of the following commands can be used to list all installed packages on a Debian-based system?

Select 2 answers
A.apt-get check
B.apt list --installed
C.apt-cache showpkg
D.dpkg -l
E.dpkg --get-selections
AnswersB, D

Lists installed packages.

Why this answer

Option B is correct because `apt list --installed` is a modern APT command that lists all installed packages on Debian-based systems. Option D is correct because `dpkg -l` displays the status and names of all packages known to dpkg, including those installed, effectively listing installed packages.

Exam trap

The trap here is that candidates often confuse `dpkg --get-selections` with a command that lists only installed packages, when in fact it lists all packages with their selection state (including those marked for removal), requiring additional filtering to isolate installed ones.

33
MCQmedium

Based on the exhibit, what does the 'rc' status for the package 'apache2-bin' indicate?

A.The package is unpacked but not yet configured
B.The package has been completely purged
C.The package is installed and configured
D.The package has been removed but configuration files remain
AnswerD

'rc' means removed but config files left.

Why this answer

In Debian-based package management (dpkg/APT), the 'rc' status code means the package was marked for removal ('r') but its configuration files were left behind ('c'). This occurs when using 'apt-get remove' or 'dpkg -r' without the --purge option, leaving residual config files in /etc or other locations.

Exam trap

The trap here is that candidates confuse 'rc' with a fully removed or purged state, not realizing that 'c' specifically indicates residual configuration files remain on the filesystem.

How to eliminate wrong answers

Option A is wrong because 'unpacked but not yet configured' is represented by status 'iU' (installed/unpacked) or 'U' (unpacked), not 'rc'. Option B is wrong because a completely purged package shows status 'pn' (purged/not installed) or no entry at all, not 'rc'. Option C is wrong because an installed and configured package shows status 'ii' (installed/installed), not 'rc'.

34
MCQmedium

During system startup, GRUB 2 displays a prompt. Which command should be typed at the GRUB prompt to boot the currently selected entry normally?

A.normal
B.linux
C.initrd
D.boot
AnswerD

This command boots the already loaded kernel image.

Why this answer

At the GRUB 2 prompt, the 'boot' command instructs GRUB to load the operating system using the currently configured kernel, initrd, and root device settings. This is the standard way to proceed with normal booting after any manual adjustments or when the menu is not displayed. Without 'boot', GRUB remains at the prompt and does not transfer control to the kernel.

Exam trap

The trap here is that candidates confuse the 'boot' command with the 'linux' or 'initrd' commands, thinking those alone start the boot process, when in fact they only load components and must be followed by 'boot' to execute the actual boot.

How to eliminate wrong answers

Option A is wrong because 'normal' is not a valid GRUB 2 command; it is a GRUB Legacy command that was used to load the normal module, but in GRUB 2 the equivalent functionality is handled by the 'normal' module being loaded automatically or via 'insmod normal'. Option B is wrong because 'linux' is used to specify the kernel image path and boot parameters, not to boot the entry; it must be followed by 'boot' to actually start the kernel. Option C is wrong because 'initrd' loads an initial ramdisk image into memory, but it does not initiate the boot process; it is a preparatory command that must be followed by 'boot'.

35
MCQeasy

You are a system administrator for a small company running a web server on Ubuntu 20.04 LTS. The web server application was installed using apt from the official repositories. Recently, a critical security patch was released for the web server package. You run 'apt update' and 'apt upgrade' but the package is not upgraded. You check the package status with 'apt-cache policy <package>' and see that the installed version is 2.4.41-4ubuntu3.6, and the candidate version is the same. The latest patched version in the repository is 2.4.41-4ubuntu3.7. You verify that the system has internet connectivity and that the repository URLs in /etc/apt/sources.list are correct. What is the most likely reason the upgrade is not being offered?

A.Add the universe repository to sources.list and run 'apt update'.
B.Run 'apt-mark unhold <package>' and then 'apt upgrade'.
C.Use 'apt dist-upgrade' instead of 'apt upgrade'.
D.Run 'apt install <package>' which will force the upgrade.
AnswerB

If the package is held, it will not be upgraded. Unholding allows the upgrade.

Why this answer

The most likely reason is that the package has been placed on hold using 'apt-mark hold', which prevents it from being upgraded even when a newer version is available in the repository. Running 'apt-mark unhold <package>' removes this hold, allowing 'apt upgrade' to proceed normally.

Exam trap

The trap here is that candidates may assume the issue is with repository configuration or command syntax, when in fact the package hold mechanism is a subtle but common administrative action that directly prevents upgrades.

How to eliminate wrong answers

Option A is wrong because the universe repository is not relevant; the web server package is in the main repository, and adding universe would not provide the patched version. Option C is wrong because 'apt dist-upgrade' handles dependency changes but does not bypass package holds; if the package is held, dist-upgrade will also skip it. Option D is wrong because 'apt install <package>' will upgrade the package even if it is held, but this is not the most likely reason the upgrade is not being offered; the question asks for the most likely cause, and a hold is a common administrative action that prevents upgrade, whereas force-installing bypasses the hold without addressing the underlying issue.

36
Multi-Selecteasy

Which TWO commands are used to install packages on a Debian-based system? (Choose two.)

Select 2 answers
A.pacman -S
B.apt-get install
C.dpkg -i
D.rpm -i
E.yum install
AnswersB, C

This installs packages from repositories.

Why this answer

B is correct because `apt-get install` is the standard command-line tool for installing packages from Debian repositories, handling dependencies automatically. C is correct because `dpkg -i` installs a local `.deb` package file directly, though it does not resolve dependencies.

Exam trap

The trap here is that candidates often confuse package managers across distributions, mistakenly associating `rpm` or `yum` with Debian systems due to superficial familiarity with Linux package management.

37
MCQmedium

A Linux administrator is troubleshooting a package dependency issue. When attempting to install package 'foo', the package manager reports a missing dependency 'libbar.so.2'. Which of the following is the most appropriate next step?

A.Run 'ldconfig' to update the library cache
B.Reinstall the 'foo' package using 'rpm -i --force foo.rpm'
C.Run 'rpm -q --whatrequires libbar.so.2'
D.Use 'apt-file search libbar.so.2' or 'dnf provides libbar.so.2' to find the package that contains the file
AnswerD

Identifies the package providing the missing library.

Why this answer

The error indicates that the file 'libbar.so.2' is missing from the system. The most appropriate next step is to identify which package provides this file, so that it can be installed to satisfy the dependency. On Debian-based systems, 'apt-file search' queries the package repository metadata to find the package containing a specific file; on Red Hat-based systems, 'dnf provides' performs the same function.

This targeted search is the correct first troubleshooting step before any installation or library cache update.

Exam trap

The trap here is that candidates may confuse 'ldconfig' (which only updates the cache for already-installed libraries) with a tool that can resolve missing dependencies, or they may think that forcing installation with '--force' is an acceptable workaround, when in fact it bypasses safety checks and can lead to system instability.

How to eliminate wrong answers

Option A is wrong because 'ldconfig' updates the runtime linker cache for shared libraries that are already installed; it cannot install missing libraries or resolve a missing file dependency. Option B is wrong because using 'rpm -i --force' forces installation of the package even if dependencies are missing, which can leave the system in a broken or inconsistent state and is not a proper resolution. Option C is wrong because 'rpm -q --whatrequires libbar.so.2' queries which installed packages depend on that file, but the file is not present on the system, so the command will return nothing useful and does not help locate the missing provider.

38
MCQmedium

You work for a hosting company that manages hundreds of CentOS 7 servers. Each server runs a standard set of monitoring tools. Your team needs to deploy a custom monitoring agent that is only available as source code (tarball). The agent must be installed on all servers from a central repository. You have set up an internal YUM repository with the compiled RPMs of the agent. On a test server, you run 'yum install custom-agent', but it fails with a message that the package is not found. You verify the package is present in the repository directory and that the createrepo command has been run. Which step is most likely missing?

A.The GPG key for the repository is not imported.
B.The package architecture does not match (e.g., x86_64 package on i386).
C.The .repo file references the wrong baseurl hostname.
D.The repository is not being served via HTTP or FTP; it is only available as a local file path.
AnswerD

YUM expects an HTTP/HTTPS/FTP URL unless using file:/// but baseurl often omitted.

Why this answer

The repository metadata must be available via HTTP or FTP. Option B is the common cause: the repository is not served by a web server. Option A is irrelevant because repo files are independent of hostname.

Option C is not needed if the repo is local to the server. Option D could be a secondary issue but the primary is serving.

39
MCQhard

A system administrator is responsible for a production Debian 10 (buster) server that hosts a critical web application. The application requires the package 'libssl1.1' version 1.1.1 or higher, but the official Debian 10 repository only provides version 1.1.0. The administrator has already attempted to install the newer version from Debian 11 (bullseye) sources, but this caused dependency conflicts with the existing libc6 version. The server cannot be upgraded to Debian 11 due to application compatibility. The administrator needs to resolve this situation without breaking the existing system or introducing unofficial packages. Which of the following is the most appropriate course of action?

A.Add the Debian Backports repository for buster and install libssl1.1 from there.
B.Upgrade the entire system to Debian 11 using a rolling upgrade.
C.Use dpkg --force-depends to force the installation of libssl1.1 from Debian 11.
D.Download the libssl1.1 source package from Debian 11 and compile it on the buster system with custom flags.
AnswerA

Backports are specifically designed to provide newer versions of packages that are compatible with the stable release. This is the recommended way to get updated software without upgrading the entire distribution.

Why this answer

Option A is correct because Debian Backports provides newer versions of select packages (like libssl1.1) that are recompiled against the stable release's libraries (e.g., libc6 from buster), avoiding dependency conflicts. This allows the administrator to obtain libssl1.1 version 1.1.1 or higher without upgrading the entire system or introducing unofficial packages, maintaining system stability and security.

Exam trap

The trap here is that candidates may think compiling from source (Option D) is a safe workaround, but they overlook that the compiled binary will still depend on the older libc6 and may introduce subtle runtime issues, while the backports repository is the official, supported method for this exact scenario.

How to eliminate wrong answers

Option B is wrong because upgrading the entire system to Debian 11 would break application compatibility, as stated in the scenario, and is not a targeted fix for the libssl1.1 requirement. Option C is wrong because using dpkg --force-depends bypasses dependency checks, which can lead to a broken system with unresolved dependencies, runtime crashes, and security vulnerabilities. Option D is wrong because compiling libssl1.1 from Debian 11 source on buster would still link against the older libc6, potentially causing the same dependency conflicts and introducing untested binaries that may not integrate properly with the package manager.

40
MCQmedium

A Linux administrator is managing a server that uses RPM-based package management. They need to find which installed package provides the '/etc/ssh/sshd_config' file. Which command should they use?

A.rpm -qi /etc/ssh/sshd_config
B.rpm -qf /etc/ssh/sshd_config
C.rpm -ql /etc/ssh/sshd_config
D.rpm -qa | grep sshd_config
AnswerB

Queries the package that owns the file.

Why this answer

The correct command is `rpm -qf /etc/ssh/sshd_config`. The `-q` flag queries the RPM database, and `-f` (or `--file`) tells RPM to find which installed package owns the specified file. This is the standard way to map a file back to its originating package in RPM-based systems.

Exam trap

The trap here is that candidates confuse the purpose of RPM query options: `-qi` (package info), `-ql` (file list), and `-qf` (file ownership), and often pick `-ql` thinking it lists files, but fail to realize it requires a package name, not a file path.

How to eliminate wrong answers

Option A is wrong because `rpm -qi` queries package information (like description, version, and architecture) from the RPM database, but it requires a package name as an argument, not a file path; using a file path with `-qi` will fail or produce irrelevant output. Option C is wrong because `rpm -ql` lists all files owned by a specified package; it expects a package name, not a file path, so it cannot be used to find which package owns a given file. Option D is wrong because `rpm -qa | grep sshd_config` lists all installed packages and pipes the output to grep, which would only match if a package name literally contains 'sshd_config' (which is unlikely); it does not query the RPM database's file-to-package mapping and will not reliably find the package that owns the file.

41
MCQeasy

Which file defines the APT software repositories used by a Debian-based system?

A./etc/apt/preferences
B./etc/apt/sources.list.d/
C./etc/apt/sources.list
D./etc/apt/apt.conf
AnswerC

This is the main repository definition file.

Why this answer

Option C is correct because `/etc/apt/sources.list` is the primary configuration file that defines the APT software repositories (e.g., Debian mirrors, Ubuntu archives) used by a Debian-based system. APT reads this file to fetch package indexes and install packages from the specified URIs, distributions, and components.

Exam trap

The trap here is that candidates confuse `/etc/apt/sources.list` with `/etc/apt/sources.list.d/`, thinking the directory is the primary definition file, but the exam expects the traditional main file as the correct answer.

How to eliminate wrong answers

Option A is wrong because `/etc/apt/preferences` controls the priority (pin) of packages from different repositories, not the repository definitions themselves. Option B is wrong because `/etc/apt/sources.list.d/` is a directory containing additional repository definition files (with `.list` extension), but the primary file is `/etc/apt/sources.list`; the question asks for the file that defines repositories, and while files in this directory also define repositories, the canonical answer is the main file. Option D is wrong because `/etc/apt/apt.conf` is the main configuration file for APT's behavior (e.g., proxy settings, caching options), not for repository definitions.

42
Multi-Selecteasy

Which THREE package management tools are native to Debian-based Linux distributions? (Choose exactly three.)

Select 3 answers
A.dpkg
B.rpm
C.yum
D.apt
E.apt-get
AnswersA, D, E

Low-level package manager for Debian.

Why this answer

Options A, C, and D are correct. dpkg is the low-level package manager. apt-get and apt are front-ends for APT. Option B is incorrect because rpm is used on Red Hat-based systems. Option E is incorrect because yum is used on Red Hat-based systems.

43
MCQmedium

A Red Hat system administrator suspects that the files belonging to the 'openssh-server' package have been modified since installation. Which command verifies the integrity of the installed package files?

A.rpm -K openssh-server
B.rpm -qa | grep openssh
C.rpm -q openssh-server
D.rpm -V openssh-server
AnswerD

Verifies installed files against package database.

Why this answer

Option D is correct because rpm -V (verify) compares installed files against package metadata. Option A is incorrect because rpm -q queries package info. Option B is incorrect because rpm -qa lists all packages.

Option C is incorrect because rpm -K checks GPG signature of the package file, not installed files.

44
MCQeasy

A Linux administrator wants to update the local package index from all configured repositories on an Ubuntu system. Which command accomplishes this?

A.dpkg --configure -a
B.apt upgrade
C.apt-get install
D.apt update
AnswerD

This updates the package index.

Why this answer

The `apt update` command (equivalent to `apt-get update`) refreshes the local package index by downloading the latest package lists from all repositories defined in `/etc/apt/sources.list` and `/etc/apt/sources.list.d/`. This is the prerequisite step before any installation or upgrade, ensuring the system knows about the newest available versions and dependencies.

Exam trap

The trap here is confusing `apt update` (which updates the package index) with `apt upgrade` (which upgrades installed packages), a common mix-up that leads candidates to choose the upgrade command instead of the index refresh command.

How to eliminate wrong answers

Option A is wrong because `dpkg --configure -a` is used to finish configuring any packages that were left in an unconfigured state after a partial installation, not to update the package index. Option B is wrong because `apt upgrade` actually installs newer versions of already-installed packages based on the current local index, but it does not refresh that index itself. Option C is wrong because `apt-get install` is used to install or upgrade specific packages, and it does not update the package lists from repositories.

45
MCQmedium

A system administrator needs to install a package 'foo' which depends on library 'libbar.so.2' that is not currently installed. The administrator runs `apt-get install foo` and receives an error about unmet dependencies. Which of the following is the most appropriate next step?

A.Run `apt-get install -f` to fix broken dependencies.
B.Use `dpkg --force-depends -i foo.deb` to force installation.
C.Run `apt-get update` and retry the installation.
D.Manually download `libbar.so.2` and install it using `dpkg -i`.
AnswerA

This command attempts to correct unmet dependencies.

Why this answer

The command `apt-get install -f` attempts to fix broken dependencies by installing missing packages or removing conflicting ones. It is the correct next step after a failed installation due to unmet dependencies. Option A is incorrect because `apt-get update` only refreshes the package list.

Option C is incorrect because force-installing can break the system. Option D is incorrect because manual installation may not resolve all dependencies.

46
MCQeasy

A system administrator needs to install the latest version of a package named 'webapp' from a third-party repository that has been added to the system. Which command should be used to update the package list and install the package in one step?

A.apt-get update && apt-get install webapp
B.apt-get upgrade webapp
C.dpkg -i webapp.deb
D.apt-cache search webapp && apt-get install webapp
AnswerA

Updates package list and installs the package.

Why this answer

Option A is correct because it first runs `apt-get update` to refresh the local package index from all configured repositories (including the third-party one), then uses `&&` to conditionally execute `apt-get install webapp` only if the update succeeds. This ensures the latest version available from the third-party repository is fetched and installed in a single command sequence.

Exam trap

The trap here is that candidates may think `apt-get upgrade` can install new packages, but it strictly upgrades existing packages and never installs new ones, while `apt-get install` alone does not refresh the package list, so the latest version from a newly added repository might not be available.

How to eliminate wrong answers

Option B is wrong because `apt-get upgrade` only upgrades already installed packages to their latest versions from the configured repositories; it does not install a new package that is not already present on the system. Option C is wrong because `dpkg -i webapp.deb` installs a local `.deb` file directly, bypassing repository metadata and dependency resolution, and it does not update the package list from a third-party repository. Option D is wrong because `apt-cache search webapp` only searches the local package cache for packages matching the name; it does not update the package list, and the `&&` would attempt `apt-get install webapp` even if the search fails or the cache is outdated.

47
MCQhard

When troubleshooting a problem with a Debian package installation, an administrator wants to see which version of a package would be installed from the configured repositories. Which command displays the candidate version?

A.dpkg -l package
B.apt-show-versions package
C.apt-get -s install package
D.apt-cache policy package
AnswerD

Shows candidate version and priority.

Why this answer

The `apt-cache policy package` command displays the package's priority, the installed version (if any), and the candidate version (the version that would be installed by default from the configured repositories). This makes it the correct tool for determining which version will be installed from the repositories.

Exam trap

The trap here is that candidates often confuse `apt-get -s install` (a simulation) with the dedicated `apt-cache policy` command for querying the candidate version, or they mistakenly think `dpkg -l` or `apt-show-versions` provide repository-level candidate information.

How to eliminate wrong answers

Option A is wrong because `dpkg -l package` lists the status and version of an installed package, but it does not query repositories or show the candidate version from repositories. Option B is wrong because `apt-show-versions package` shows available and installed versions, but it is not the standard command for displaying the candidate version; `apt-cache policy` is the authoritative tool. Option C is wrong because `apt-get -s install package` performs a dry-run simulation of installation, which can show what would be installed, but it is not the dedicated command for viewing the candidate version; `apt-cache policy` is more direct and standard for this purpose.

48
MCQmedium

A Yellowdog Updater Modified (YUM) transaction that included several package installations and upgrades completed successfully, but a recent change caused a service to break. The administrator wants to revert the entire transaction using its transaction ID. Which command should be used?

A.yum history redo 123
B.yum remove <packages>
C.yum history rollback 123
D.yum history undo 123
AnswerD

Undoes transaction with ID 123.

Why this answer

Option A is correct because yum history undo ID reverts a specific transaction. Option B is incorrect because yum history redo repeats the transaction. Option C is incorrect because yum history rollback reverts to a point, but not a single transaction.

Option D is incorrect because yum remove is not transaction-based.

49
MCQmedium

Based on the dpkg -l output in the exhibit, what does the 'rc' status indicate for the apache2 package?

A.The package was removed but configuration files remain.
B.The package is unpacked but not configured.
C.The package is installed and configured.
D.The package is completely purged.
AnswerA

'rc' = removed, config files remain.

Why this answer

Option B is correct. The 'rc' status means the package is removed but configuration files remain. Option A is incorrect because 'ii' indicates installed and ok.

Option C is incorrect because 'un' indicates unknown. Option D is incorrect because 'pu' would indicate purged.

50
MCQhard

A system has multiple APT repositories configured. The administrator needs to ensure that for a specific package, the version from a particular repository is always preferred over others, regardless of version number. Which configuration would achieve this?

A.Editing /etc/apt/sources.list and setting the release in sources.list
B.Using apt-mark hold on the package after installing from desired repository
C.Creating a file in /etc/apt/preferences.d/ with a high Pin-Priority for that package and origin
D.Adding the repository and using apt-get install -t release package
AnswerC

APT pinning allows persistent preference.

Why this answer

Option C is correct because APT pinning using /etc/apt/preferences with a Pin-Priority higher than 1000 forces that version. Option A is incorrect because apt-get install -t only selects a target release temporarily. Option B is incorrect because apt-cache policy shows candidate versions but does not configure pinning.

Option D is incorrect because apt-mark hold only prevents upgrades, not selection.

51
MCQmedium

An administrator needs to downgrade a package from version 2.0 to version 1.9. Which apt-get command can be used to perform this action?

A.`apt-get downgrade package=1.9`
B.`apt-get upgrade package=1.9`
C.`apt-get dist-upgrade package=1.9`
D.`apt-get install package=1.9`
AnswerD

Specifies the version to install, enabling downgrade.

Why this answer

`apt-get install package=version` allows installing a specific version, enabling downgrade. `apt-get downgrade` is not a valid command. `apt-get upgrade` only upgrades. `apt-get dist-upgrade` also handles dependencies but cannot downgrade a package easily.

52
MCQmedium

An administrator needs to install apache2 version 2.4.41-4ubuntu3.4 from the security repository to ensure the latest security patches. Based on the exhibit, which command should they use?

A.apt-get install apache2/focal-security
B.apt-get install -t focal-security apache2
C.apt-get install apache2 2.4.41-4ubuntu3.4
D.apt-get install apache2=2.4.41-4ubuntu3.4
AnswerD

This command correctly specifies the exact version using the '=' syntax, which apt will install from the appropriate repository (security in this case) because the version is present there.

Why this answer

Option D is correct because the `apt-get install apache2=2.4.41-4ubuntu3.4` command explicitly pins the package to the exact version number, ensuring that the specified version from the security repository is installed. This syntax is the standard way to install a specific package version in APT, overriding the default candidate version.

Exam trap

The trap here is that candidates often confuse the `-t` option (which sets a target release) with the version pinning syntax, or they mistakenly use a space instead of an equals sign when specifying a version, leading to an invalid command.

How to eliminate wrong answers

Option A is wrong because `apache2/focal-security` uses a slash to specify a release or suite, but APT does not support this syntax for pinning a package to a repository; it would be interpreted as a package name with a slash, leading to an error. Option B is wrong because `-t focal-security` sets the target release for all packages, but it does not guarantee the exact version 2.4.41-4ubuntu3.4; it would install the latest version available in that repository, which might not be the specified version. Option C is wrong because `apache2 2.4.41-4ubuntu3.4` (with a space) is invalid syntax; APT requires an equals sign (`=`) to specify a version, and using a space would cause a parsing error.

53
MCQmedium

A technician is tasked with installing a package from a third-party repository on a CentOS 7 system. What is the correct first step to add the repository?

A.Run 'yum localinstall' with the repository URL.
B.Create a .repo file in /etc/yum.repos.d/.
C.Edit /etc/yum.conf and add the repository URL.
D.Use 'yum-config-manager --add-repo' without any further steps.
AnswerB

Repository definitions are placed in /etc/yum.repos.d/ as .repo files.

Why this answer

On CentOS 7, third-party repositories are added by placing a .repo file in /etc/yum.repos.d/. This file defines the repository ID, name, baseurl, and GPG check settings. Yum reads all .repo files in this directory at runtime, making it the standard and correct first step for adding a repository.

Exam trap

The trap here is that candidates confuse editing /etc/yum.conf (which is for global yum options, not repository definitions) with the correct method of adding a .repo file, or they assume 'yum localinstall' can add a repository when it only installs a single package.

How to eliminate wrong answers

Option A is wrong because 'yum localinstall' installs a local RPM package, not a repository; it does not add a repository URL. Option C is wrong because /etc/yum.conf is the main configuration file for yum, but it is not designed to hold repository definitions—those belong in separate .repo files under /etc/yum.repos.d/. Option D is wrong because 'yum-config-manager --add-repo' is a valid command on CentOS 7, but it requires the repository URL as an argument (e.g., 'yum-config-manager --add-repo http://example.com/repo.repo') and does not work 'without any further steps'; the option incorrectly implies it can be used without specifying the URL.

54
MCQeasy

Refer to the exhibit. Based on the apt-cache showpkg output, which version of vim would be installed if the administrator runs 'apt-get install vim' without specifying a version?

A.2:8.2.3995-1ubuntu1 from focal-updates
B.2:8.2.3995-1ubuntu2.1 from focal
C.2:8.2.3995-1ubuntu1 from focal
D.2:8.2.3995-1ubuntu2.1 from focal-updates
AnswerD

Newest version available.

Why this answer

Option C is correct. APT installs the highest version number, which is 2:8.2.3995-1ubuntu2.1 from the focal-updates repository. The first listed version is usually the candidate.

Option A is incorrect because it is an older version. Option B is incorrect because it is the older version. Option D is incorrect because it is a different package.

55
MCQeasy

On a Fedora system, which command is used to update all installed packages to their latest versions?

A.`dnf upgrade`
B.`dnf check-update`
C.`dnf update all`
D.`dnf install update`
AnswerA

Updates all installed packages to the latest versions.

Why this answer

`dnf upgrade` is the standard command to update all packages on Fedora. `dnf check-update` only checks for updates. `dnf install update` is invalid. `dnf update all` is not a valid syntax.

56
MCQhard

A developer downloads the source code for a kernel module and attempts to compile it using `make`. The compilation fails with an error indicating that the kernel header files are missing. Which package should be installed to provide the necessary headers on a Debian system?

A.`linux-headers-$(uname -r)`
B.`kernel-headers-generic`
C.`build-essential`
D.`linux-kernel-headers`
AnswerA

Provides headers for the running kernel.

Why this answer

The `linux-headers-$(uname -r)` package provides headers for the currently running kernel, which are required for compiling kernel modules. The other options are incorrect: `kernel-headers-generic` is not a Debian package name, `linux-kernel-headers` does not exist, and `build-essential` provides compilers but not kernel headers.

57
MCQeasy

Refer to the exhibit. Based on the dpkg output, what is the status of the 'ftp' package?

A.Removed but configuration files remain.
B.Half-configured.
C.Installed and up-to-date.
D.Not installed at all.
AnswerA

The 'rc' status indicates removed with config files.

Why this answer

The 'dpkg' output shows 'rc' in the status field, which stands for 'removed' (the package has been deleted) but 'config-files' remain. This means the package was removed using 'dpkg --purge' or 'apt-get remove' without the '--purge' option, leaving behind configuration files in /etc.

Exam trap

LPI often tests the distinction between 'removed' (package binary gone) and 'purged' (everything gone), where candidates mistakenly think 'rc' means the package is still installed or that config files are automatically removed.

How to eliminate wrong answers

Option B is wrong because 'half-configured' would show 'hc' in the dpkg status, indicating the package was partially configured after unpacking but the configuration script failed. Option C is wrong because 'installed and up-to-date' would show 'ii' (installed and ok) in the status, not 'rc'. Option D is wrong because 'not installed at all' would show 'un' (unknown/not installed) or no entry at all, not the 'rc' status which explicitly indicates the package was once installed and its config files persist.

58
MCQmedium

A system administrator wants to compile and install a program from source. After running './configure --prefix=/opt/myapp', the configure script fails with an error about missing 'libssl-dev'. What should the administrator do to resolve this issue?

A.Install the 'libssl-dev' package using the package manager
B.Manually download and place the missing header files in /usr/include
C.Install the 'libssl' runtime library
D.Add the '--disable-ssl' flag to ./configure
AnswerA

Development packages contain headers required by configure.

Why this answer

The configure script requires the development headers and static libraries for OpenSSL to compile software that uses SSL/TLS. The 'libssl-dev' package provides these headers and the .so symlinks needed during compilation. Installing it via the package manager (e.g., apt, yum) is the correct and standard method to satisfy this build dependency.

Exam trap

The trap here is that candidates confuse runtime libraries (libssl) with development libraries (libssl-dev), or think manually copying headers is a valid workaround, when the package manager's -dev package is the intended solution.

How to eliminate wrong answers

Option B is wrong because manually placing header files in /usr/include is fragile, does not resolve library linking dependencies, and bypasses the package manager's dependency tracking. Option C is wrong because 'libssl' runtime library only provides the shared objects for execution, not the headers or static libraries required during compilation. Option D is wrong because adding '--disable-ssl' would disable SSL support entirely, which may break the program's intended functionality or cause other configure checks to fail if SSL is a hard requirement.

59
MCQeasy

An administrator wants to remove a package 'apache2' but keep its configuration files on the system. Which command should be used?

A.`dpkg --purge apache2`
B.`apt-get purge apache2`
C.`apt-get autoremove apache2`
D.`apt-get remove apache2`
AnswerD

Removes the package but keeps configuration files.

Why this answer

Option D is correct because `apt-get remove apache2` removes the package binaries but leaves the configuration files (under /etc/apache2/) intact. This is the standard behavior of the `remove` subcommand in APT and dpkg, allowing the administrator to reinstall the package later with the same settings.

Exam trap

The trap here is that candidates often confuse `purge` (which removes configs) with `remove` (which keeps configs), or mistakenly think `autoremove` can target a specific package, when it only cleans orphaned dependencies.

How to eliminate wrong answers

Option A is wrong because `dpkg --purge` removes both the package and its configuration files, which contradicts the requirement to keep configs. Option B is wrong because `apt-get purge` also removes configuration files along with the package, just like `dpkg --purge`. Option C is wrong because `apt-get autoremove` is designed to remove packages that were automatically installed as dependencies and are no longer needed; it does not target a specific package like 'apache2' and will not remove it unless it is marked as auto-installed.

60
Multi-Selecthard

Which THREE of the following are valid methods to install a package from a local .deb file?

Select 3 answers
A.alien -i package.deb
B.rpm -i package.deb
C.gdebi package.deb
D.dpkg -i package.deb
E.apt-get install ./package.deb
AnswersC, D, E

gdebi handles dependencies.

Why this answer

C is correct because `gdebi` is a dedicated tool for installing local `.deb` packages while automatically resolving and fetching their dependencies from configured repositories. It provides a safer alternative to `dpkg` when dependency handling is required.

Exam trap

The trap here is that candidates may think `rpm` can handle .deb files due to a superficial similarity in package management commands, or that `alien` is a primary installation tool rather than a format converter.

61
MCQhard

An openSUSE administrator needs to add a new repository from a URL and refresh the package cache. Which command sequence accomplishes this?

A.zypper install --repo url
B.zypper addrepo url; zypper refresh
C.zypper modifyrepo --add url
D.zypper repos --add url
AnswerB

Correct sequence to add and refresh.

Why this answer

Option B is correct because zypper addrepo adds the repo, then zypper refresh updates the cache. Option A is incorrect because zypper modifyrepo modifies existing repos. Option C is incorrect because zypper repos lists repos only.

Option D is incorrect because zypper install does not add repos.

62
Multi-Selectmedium

Which TWO directories are commonly used to store source code before compiling? (Choose two.)

Select 2 answers
A./tmp
B./var/src
C./usr/src
D./usr/local/src
E./opt
AnswersC, D

Standard source directory.

Why this answer

/usr/src is the traditional location for kernel source and other source packages. /usr/local/src is for locally compiled software. /opt is for optional add-on software binaries, not source. /tmp is temporary and not for permanent source code. /var/src is not standard.

63
Multi-Selecthard

An administrator needs to downgrade a package 'apache2' to a specific older version using APT. Which TWO commands can achieve this? (Choose exactly two.)

Select 2 answers
A.apt-get install apache2=2.2.22
B.apt-get upgrade apache2
C.apt-get --reinstall install apache2
D.apt-get -t stable install apache2
E.apt-cache showpkg apache2
AnswersA, D

Installs the specified exact version.

Why this answer

Options A and B are correct. apt-get install apache2=version will install that specific version. apt-get -t stable install apache2 will install the version from the 'stable' release, which may be older if the current repository has a newer version from 'testing'. Option C is incorrect because apt-get upgrade upgrades all packages, not downgrade. Option D is incorrect because apt-cache showpkg shows available versions but does not install.

Option E is incorrect because apt-get --reinstall install only reinstalls the current version.

64
MCQhard

After a failed package upgrade, a Debian system shows 'unmet dependencies' when trying to install any new software. What is the most appropriate command to fix this condition?

A.Edit /var/lib/dpkg/status manually
B.apt-get install -f
C.dpkg --purge $(dpkg -l | grep ^iU | awk '{print $2}')
D.dpkg --force-depends -i *.deb
AnswerB

The -f flag fixes broken dependencies.

Why this answer

apt-get install -f (or apt install -f) attempts to correct broken dependencies. Using dpkg --force-depends bypasses dependency checks but can leave the system in an inconsistent state. Removing all packages is too drastic.

Editing dpkg status file manually is error-prone and not recommended.

65
Multi-Selectmedium

Which TWO characteristics describe the difference between 'apt-get' and 'aptitude'? (Choose two.)

Select 2 answers
A.Aptitude offers a text-based interactive interface (TUI).
B.Aptitude provides a more sophisticated dependency resolution and can mark packages as automatically installed.
C.Apt-get uses a different package format than aptitude.
D.Apt-get can only be used from the command line, while aptitude only has a text-based interface.
E.Aptitude is an older tool and no longer maintained.
AnswersA, B

You can run aptitude without arguments to enter TUI.

Why this answer

Option A is correct because aptitude includes a text-based interactive interface (TUI) that allows users to browse, search, and manage packages in a menu-driven environment, whereas apt-get is strictly command-line only. This TUI provides features like visual dependency trees and interactive conflict resolution, making aptitude more user-friendly for interactive package management.

Exam trap

The trap here is that candidates often assume apt-get and aptitude are interchangeable or that aptitude is obsolete, but the exam tests the specific technical distinction that aptitude has a TUI and superior dependency resolution, while both use the same package format.

66
Matchingmedium

Match each Linux directory to its standard purpose.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

System configuration files

Variable data (logs, databases)

User-installed software and libraries

Temporary files (often cleared on reboot)

Virtual file system for process and kernel info

Why these pairings

Standard directories in the Filesystem Hierarchy Standard (FHS).

67
Multi-Selectmedium

A system administrator needs to install a new kernel on a Debian-based system. Which TWO commands can be used to achieve this? (Choose TWO.)

Select 2 answers
A.apt-cache search linux-image-5.10.0-20-amd64
B.apt-get update
C.apt-get install linux-image-5.10.0-20-amd64
D.make install
E.dpkg -i linux-image-5.10.0-20-amd64.deb
AnswersC, E

apt-get install installs packages from repositories, including kernel images.

Why this answer

Option C is correct because `apt-get install` is the standard command for installing a specific kernel package from the configured repositories on Debian-based systems. The package name `linux-image-5.10.0-20-amd64` corresponds to a precompiled kernel image that APT will download and install, automatically handling dependencies and updating the bootloader configuration.

Exam trap

The trap here is that candidates confuse package management commands (like `apt-cache search` or `apt-get update`) with installation commands, or assume that `make install` is a valid method for installing a precompiled kernel package.

68
MCQhard

A sysadmin wants to prevent an APT package from being upgraded automatically but still allow it to be upgraded manually if needed. Which configuration method best achieves this?

A.Set the package version to a non-existent version in /etc/apt/preferences
B.Use 'apt-mark hold <package>'
C.Add the package to /etc/apt/preferences with Pin-Priority: 1000
D.Remove the package from sources.list
AnswerB

This marks the package as held, preventing automatic upgrades.

Why this answer

The `apt-mark hold <package>` command marks a package as held back, preventing it from being automatically upgraded during `apt upgrade` or `apt dist-upgrade`, while still allowing manual upgrades via `apt install <package>` or `apt-mark unhold`. This directly meets the requirement of blocking automatic upgrades but permitting manual intervention.

Exam trap

The trap here is that candidates confuse `apt-mark hold` with pinning in `/etc/apt/preferences`, assuming a high Pin-Priority (like 1000) prevents upgrades, when in fact it only sets preference order and does not block automatic upgrades.

How to eliminate wrong answers

Option A is wrong because setting a package version to a non-existent version in `/etc/apt/preferences` does not prevent upgrades; APT will simply ignore the invalid version and may still upgrade the package to the next available version. Option C is wrong because a Pin-Priority of 1000 in `/etc/apt/preferences` forces the package to be installed from a specific release, but it does not prevent automatic upgrades—it actually encourages them by making that version the preferred candidate. Option D is wrong because removing the package from `sources.list` would remove the repository entirely, preventing both automatic and manual upgrades of that package (and all other packages from that repository), which is too broad and does not target a single package.

69
MCQhard

A dependency analysis shows that removing package 'libfoo' will also remove 'appA' and 'appB' because they depend on libfoo. The administrator wants to remove libfoo but keep appA and appB. What is the best approach?

A.Force removal of libfoo using `dpkg --force-depends`.
B.Recompile appA and appB without the dependency on libfoo.
C.Check if a compatible alternative package exists and install it, then remove libfoo.
D.Use `apt-get remove libfoo --no-dep`
AnswerC

Allows removal while preserving dependent applications.

Why this answer

The best approach is to find a compatible alternative package that provides the same functionality as libfoo and can satisfy the dependencies of appA and appB, then install it before removing libfoo. The other options are flawed: `--no-dep` option does not exist, recompiling both applications is time-consuming and risky, and force removal would break the dependent applications.

70
Multi-Selecteasy

Which TWO of the following are Debian package management tools?

Select 2 answers
A.yum
B.dpkg
C.rpm
D.apt
E.zypper
AnswersB, D

dpkg is the low-level package manager for Debian-based systems.

Why this answer

B is correct because dpkg is the core low-level package manager for Debian-based systems, handling installation, removal, and querying of .deb packages directly. D is correct because apt (Advanced Package Tool) is the high-level package management tool that resolves dependencies and retrieves packages from repositories, built on top of dpkg.

Exam trap

The trap here is that candidates often confuse package managers by distribution family (e.g., thinking yum or rpm could be Debian tools because they are also 'package managers'), but LPIC-1 tests the specific association of dpkg and apt with Debian-based systems versus rpm-based tools like yum, rpm, and zypper.

71
MCQhard

Based on the exhibit, the 'custom' repository shows 0 packages. What is the most likely cause?

A.The repository is disabled because 'enabled=1' is missing
B.The $releasever or $basearch variables are not expanding correctly, leading to an invalid URL
C.The GPG key is missing, causing yum to ignore the repository
D.The repository metadata is corrupt and needs to be regenerated
AnswerB

Variables may not be set or the repository doesn't exist for that release.

Why this answer

The 'custom' repository shows 0 packages because the $releasever or $basearch variables are not expanding correctly, resulting in an invalid or unreachable repository URL. Yum uses these variables to dynamically construct the baseurl, and if they are undefined or incorrect (e.g., due to a missing or misconfigured /etc/yum/vars/ directory or incorrect release version), the repository metadata cannot be downloaded, so yum reports 0 packages available.

Exam trap

The trap here is that candidates often assume 'enabled=1' is mandatory or that GPG key issues cause repositories to be ignored, but the real culprit is variable expansion failure, which silently yields an empty package list without error messages.

How to eliminate wrong answers

Option A is wrong because 'enabled=1' is not required; the default value for 'enabled' is 1 (enabled) if the directive is omitted, so missing it does not disable the repository. Option C is wrong because a missing GPG key would cause yum to warn or fail on package installation, not ignore the repository entirely or show 0 packages; yum still fetches metadata and lists packages even without a GPG key. Option D is wrong because corrupt repository metadata would typically cause a checksum error or a failure to parse the metadata, not a clean display of 0 packages; yum would report an error rather than silently showing zero packages.

72
MCQeasy

A user downloaded a Debian package file named 'software.deb'. Which command should be used to install it?

A.rpm -ivh software.deb
B.apt install software.deb
C.apt-get install software.deb
D.dpkg -i software.deb
AnswerD

dpkg -i installs a .deb package locally.

Why this answer

The dpkg command with -i option installs a .deb package. apt-get and apt are package management tools that work with repositories, not local .deb files directly (though 'apt install ./software.deb' works in newer versions, dpkg is the standard low-level tool). rpm is for Red Hat packages.

73
MCQhard

Refer to the exhibit. An administrator is trying to install Google Chrome but receives a GPG error. Which command should be run to add the repository's GPG key?

A.`wget -qO- https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -`
B.`gpg --import https://dl.google.com/linux/linux_signing_key.pub`
C.`apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <keyid>`
D.`dpkg --add-key google`
AnswerA

Downloads and adds the key to apt's keyring.

Why this answer

The correct method is to download the signing key from the repository's official source and add it using `apt-key add`. `apt-key adv` requires knowing the key ID, which is not provided. `gpg --import` without apt-key does not integrate with apt. `dpkg --add-key` is not a valid command.

74
MCQhard

A Debian system has a broken package that was partially installed. Which command will attempt to fix dependencies and configure all unpacked but not configured packages?

A.dpkg -i --force-depends
B.apt-get autoremove
C.apt-get clean
D.dpkg --configure -a
AnswerD

This configures all unpacked packages, fixing incomplete installations.

Why this answer

The command `dpkg --configure -a` is the correct choice because it configures all unpacked but not yet configured packages, and also attempts to fix dependency issues by re-running the configuration scripts. This is the standard way to recover from a partially installed package on Debian systems, as it ensures all packages in the 'unpacked' or 'half-configured' state are fully processed.

Exam trap

The trap here is that candidates confuse `dpkg --configure -a` with `apt-get install -f` (which fixes broken dependencies by installing missing packages), but the question specifically asks for configuring unpacked packages, not just fixing dependencies.

How to eliminate wrong answers

Option A is wrong because `dpkg -i --force-depends` forces installation of a package even if dependencies are unmet, which can break the system further and does not specifically target unpacked but not configured packages. Option B is wrong because `apt-get autoremove` removes packages that were automatically installed as dependencies and are no longer needed, not fixing partially installed packages. Option C is wrong because `apt-get clean` clears the local repository of retrieved package files (.deb) from the cache, which has no effect on package configuration or dependency resolution.

75
MCQmedium

During boot, a server loads the wrong kernel. Which file should the administrator modify to change the default kernel in a standard GRUB 2 configuration?

A./boot/grub/grub.conf
B./etc/grub.d/
C./etc/default/grub
D./boot/grub/grub.cfg
AnswerC

Edit GRUB_DEFAULT in this file and run update-grub.

Why this answer

The file /etc/default/grub contains the GRUB_DEFAULT variable to set the default menu entry. /boot/grub/grub.cfg is generated automatically and should not be edited manually. /etc/grub.d/ contains scripts that generate the config. /boot/grub/grub.conf is for GRUB 1.

Page 1 of 2 · 82 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Linux Installation and Package Management questions.