Courseiva

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

The correct command is `update-grub` (or its equivalent `grub-mkconfig -o /boot/grub/grub.cfg`). After modifying `/etc/default/grub`, you must regenerate the GRUB configuration file (`grub.cfg`) to incorporate the new serial console settings. `update-grub` is a wrapper that runs `grub-mkconfig` and writes the output to the correct location, applying the changes.

Exam trap

The trap here is that candidates confuse commands that modify GRUB's runtime behavior (like `grub-set-default` or `grub-editenv`) with the command that regenerates the static configuration file from the template, leading them to pick a wrong option that does not actually apply changes from `/etc/default/grub`.

How to eliminate wrong answers

Option A is wrong because `grub-editenv` is used to edit the GRUB environment block (e.g., saved default entry or boot counter), not to regenerate the main configuration file from `/etc/default/grub`. Option B is wrong because `grub-install` installs GRUB to a disk or partition (e.g., MBR or EFI system partition) and does not read or apply changes from `/etc/default/grub`. Option C is wrong because `grub-set-default` sets the default boot entry in the GRUB environment block, but it does not regenerate `grub.cfg` from the configuration template.

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

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

It uses the standard 'deb' prefix for binary packages, points to the official Debian repository at http://deb.debian.org/debian, specifies the release codename 'buster', and includes the required component 'main'. This is the exact format required by APT to fetch packages for the Debian buster release.

Exam trap

The trap here is that candidates may confuse the 'deb' and 'deb-src' prefixes, or mistakenly add '-updates' thinking it is required for the base release, when the question specifically asks for the repository line for the 'buster' release itself, not its updates.

How to eliminate wrong answers

Option A is wrong because it appends '-updates' to the release name, which would configure the buster-updates repository (for package updates after the initial release) rather than the main buster repository. Option B is wrong because it uses 'deb-src' prefix, which is for source packages, not binary packages; the question asks for the repository line to add, and while deb-src is valid for source code, the standard binary repository uses 'deb'. Option C is wrong because it uses 'rpm' prefix, which is the package format for Red Hat-based distributions (like Fedora, CentOS), not for Debian-based systems; APT expects 'deb' or 'deb-src' lines.

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

The `rpm -qf /usr/bin/foo` command queries the RPM database to determine which installed package owns the specified file. The `-f` (or `--file`) option tells RPM to search for the package that provided that file path, making it the correct choice for this task on a Red Hat system.

Exam trap

The trap here is confusing the direction of the query: candidates often pick `rpm -ql` (list files in a package) instead of `rpm -qf` (find package owning a file), because they misremember which option performs the reverse lookup.

How to eliminate wrong answers

Option A is wrong because `rpm -qa` lists all installed packages, and appending a file path like `/usr/bin/foo` is invalid syntax; it does not query which package owns the file. Option B is wrong because `rpm -qi` displays detailed information about a specified package (e.g., `rpm -qi bash`), not about a file; passing a file path to `-qi` will result in an error or unintended behavior. Option C is wrong because `rpm -ql` lists all files installed by a specified package, not the reverse lookup of which package owns a given file.

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

`rpm -e` (erase) removes the package but, by default, leaves configuration files (usually marked as %config in the RPM spec) intact on the filesystem. This behavior is specific to RPM: when erasing a package, RPM renames modified config files with a `.rpmsave` extension rather than deleting them, preserving administrator customizations.

Exam trap

The trap here is that candidates confuse `yum remove`/`yum erase` (which remove config files by default) with `rpm -e` (which preserves them), or they mistakenly think `rpm -F` is a removal command when it actually performs an upgrade operation.

How to eliminate wrong answers

Option A is wrong because `yum erase` is a valid command, but it is not the correct answer for Red Hat Enterprise Linux (RHEL) — the question asks for a command that removes the package while leaving configuration files intact, and `yum erase` actually removes both the package and its configuration files by default (unless the `--keepconf` option is used, which is not mentioned). Option B is wrong because `yum remove` is synonymous with `yum erase` and also removes configuration files by default, failing the requirement to leave config files intact. Option D is wrong because `rpm -F` (freshen) upgrades an existing package only if an older version is installed; it does not remove packages at all.

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

It allows you to install OpenSSL 1.0.1 in a separate path (/usr/local/lib) while keeping the legacy 0.9.8 in /usr/lib. By rebuilding the application with an RPATH pointing to /usr/local/lib/openssl0.9.8, you force the dynamic linker to load the old OpenSSL library only for that application, satisfying the security audit for the rest of the system while keeping the unmodifiable application operational.

Exam trap

The trap here is that candidates often think 'LD_PRELOAD' is a universal solution for library version conflicts, but it applies globally to the process and does not isolate the old library from the system, whereas RPATH provides per-binary library path control without modifying system-wide library search order.

How to eliminate wrong answers

Option A is wrong because you stated you cannot modify the application source code, and even if you could, recompiling may introduce new bugs or dependencies. Option B is wrong because using 'LD_PRELOAD' to load the old library would override the new system-wide OpenSSL for the application, but it does not address the security requirement to update OpenSSL system-wide; the old library would still be present and could be loaded by other processes, and the application would still use the insecure version. Option C is wrong because keeping OpenSSL 0.9.8 and accepting the risk violates the security audit requirement and is not a valid long-term solution for a production server.

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

'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

Using `dpkg -i` to install the pre-built .deb package directly places libfoo 1.2 into the system's package database, ensuring it is tracked and can be managed by dpkg/APT. Running `apt-get install -f` afterward resolves any missing dependencies by automatically installing or upgrading required packages from the internal repository, maintaining system consistency without breaking existing packages.

Exam trap

The trap here is that candidates may think compiling from source (Option D) is safer because it avoids package manager conflicts, but they overlook that a .deb package provides proper integration with dpkg/APT, making it the recommended method for installing software on Debian-based systems when a pre-built package is available.

How to eliminate wrong answers

Option B is wrong because creating a chroot environment is overly complex for this scenario; the application needs to be compiled on the host system, and a chroot would isolate the library but require additional configuration to make it accessible to the compilation process, which is unnecessary when a .deb package is available. Option C is wrong because using `dpkg --force-depends -i` bypasses dependency checks, which can leave the system with unmet dependencies and potentially break other packages that rely on libfoo 1.0, leading to an inconsistent package state. Option D is wrong because compiling from source with a custom prefix and setting LD_LIBRARY_PATH does not register the library with the package manager, so it won't be tracked for updates or removals, and LD_LIBRARY_PATH can cause conflicts with system libraries if not managed carefully; this approach is less reliable than using a .deb package.

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

`apt list --installed '*kernel*'` uses the APT package manager to list all installed packages whose names match the glob pattern `*kernel*`. Option B is correct because `dpkg -l '*kernel*'` uses the dpkg low-level tool with the `-l` (list) flag and a glob pattern to display all packages whose names contain 'kernel'. Both commands directly filter by package name on a Debian system.

Exam trap

The trap here is that candidates often confuse `dpkg --get-selections` (which lists all packages with their selection state, not just installed ones) with `dpkg -l` (which lists installed packages with a glob filter), or they mistakenly apply RPM-based commands like `rpm -qa` to a Debian system.

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

The `apt-get -f install` command (option A) is specifically designed to fix broken dependencies by attempting to correct a system with unsatisfied dependencies, often by installing missing packages or removing partially installed ones. The `dpkg --configure -a` command (option D) reconfigures any unpacked but not yet configured packages, which is a common state after a failed installation, and can resolve dependency issues by completing the configuration of partially installed packages.

Exam trap

The trap here is that candidates often confuse `apt-get upgrade` or `dist-upgrade` with dependency repair, but only `-f install` and `dpkg --configure -a` are the correct tools for fixing broken dependencies from a failed installation.

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

`rpm -qi` (query info) displays detailed metadata for the specified package, including the installation date in a human-readable format. The `-i` flag retrieves information such as the installation date, build date, and other package metadata, converting Unix timestamps to a readable date string.

Exam trap

The trap here is that candidates may confuse `--dump` or `--scripts` with displaying metadata, but only `-i` (info) provides the installation date in a human-readable format, while the other options show different types of package data.

How to eliminate wrong answers

Option A is wrong because `rpm -q --dump` outputs file-level metadata (such as size, permissions, and MD5 digests) for each file in the package, not the package installation date. Option B is wrong because `rpm -q --changelog` displays the changelog entries for the package, which list historical changes and dates, but not the installation date of the package itself. Option D is wrong because `rpm -q --scripts` shows the pre-install, post-install, pre-uninstall, and post-uninstall scripts associated with the package, not the installation date.

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

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

In SELinux, the context format is user:role:type:level. User identifies the SELinux user, role defines accessible roles, type defines domain/object type, and level defines sensitivity/categories. Common confusions include swapping user/role or role/type.

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

`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

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
1Step 1
2Step 2
3Step 3
4Step 4

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

apt-get is the primary command-line tool for handling Debian packages, handling dependency resolution and retrieval from repositories. dpkg is the low-level tool that directly installs, removes, and queries .deb package files without automatic dependency management. Both are essential for Debian-based package management.

Exam trap

The trap here is that candidates often confuse low-level package tools (dpkg, rpm) with high-level ones (apt-get, yum, zypper), or incorrectly associate a tool with the wrong distribution family, especially when multiple package managers are listed.

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 -i` does not resolve dependencies from repositories; it only installs the local .deb file and checks dependencies against the local dpkg database. Using `apt install ./package.deb` leverages APT's dependency resolution, which will fetch `python3-requests 2.0` from the local mirror after `apt-get update` has refreshed the package index. This ensures unmet dependencies are automatically satisfied from the configured sources.

Exam trap

The trap here is that candidates assume `dpkg -i` will automatically resolve dependencies from repositories, but LPIC-1 tests the distinction that `dpkg` is a low-level tool with no network or repository awareness, while `apt` handles dependency resolution from configured sources.

How to eliminate wrong answers

Option A is wrong because `--force-depends` bypasses dependency checks entirely, which would allow installation but leave the system with broken dependencies, not resolve them. Option C is wrong because the question states the mirror is correctly listed and `apt-get update` is run before building; if it had failed, the engineer would likely see errors, and the issue is specifically about dependency resolution, not index freshness. Option D is wrong because the mirror is correctly listed and `apt-get update` ran, so the package is assumed present; the failure is due to using `dpkg -i` which does not consult the mirror at all.

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 /etc/passwd` queries the dpkg database to find which installed package owns the specified file. This is the standard Debian/Ubuntu command to map an absolute path to its originating package, making it the most appropriate choice for the administrator's goal.

Exam trap

The trap here is that candidates confuse `dpkg -S` (search for file) with `dpkg -L` (list files of a known package), or they incorrectly use `apt-cache` or `apt-file` which operate on repository data rather than the installed package database.

How to eliminate wrong answers

Option A is wrong because `dpkg -L base-passwd` lists all files installed by the `base-passwd` package, but it does not search for which package provides `/etc/passwd`; it assumes the package is already known. Option B is wrong because `apt-file search /etc/passwd` searches the package repository metadata (not the installed package database) for files, which is useful for finding packages that provide a file not yet installed, but the question asks about an installed file. Option D is wrong because `apt-cache show /etc/passwd` is invalid syntax; `apt-cache show` is used to display metadata about a package name, not to search for a file path.

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

`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

`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

When a .deb package fails to install due to unmet dependencies, `dpkg -i package.deb` installs the package but leaves dependencies unresolved. Running `apt-get install -f` (or `apt install -f`) then fixes broken dependencies by downloading and installing any missing packages from the configured repositories. This two-step sequence is the standard method for resolving dependency issues after a direct dpkg installation.

Exam trap

The trap here is that candidates assume `apt-get install -f` alone can install the .deb package, but it only fixes dependencies and does not process the original .deb file, so the package must first be installed (even partially) with `dpkg -i`.

How to eliminate wrong answers

Option A is wrong because `apt-get install -f` alone only fixes broken dependencies; it does not install the original .deb package, so the package remains uninstalled. Option C is wrong because `dpkg --configure -a` only reconfigures partially installed or unpacked packages, but it does not download or install missing dependencies from repositories. Option D is wrong because `apt-get upgrade` upgrades all installed packages to their latest versions and does not address unmet dependencies for a specific .deb package that was never fully installed.

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

After adding a new APT repository to sources.list, you must run 'apt update' (or 'apt-get update') to refresh the local package index from all configured repositories. This command downloads the latest package lists from the repository's Release and Packages files, making the system aware of available packages and their versions. Without this step, APT will not know about the new repository's packages, and subsequent install or upgrade commands will fail to find them.

Exam trap

The trap here is that candidates confuse 'update' (refreshing package lists) with 'upgrade' (installing newer versions of installed packages), leading them to choose 'apt upgrade' or 'apt-get upgrade' thinking it will also fetch new repository data.

How to eliminate wrong answers

Option A is wrong because 'apt-get upgrade' installs newer versions of already-installed packages based on the current package index; it does not refresh the index itself, so it cannot make the system aware of new repository packages. Option B is wrong because 'apt upgrade' is functionally identical to 'apt-get upgrade' (it upgrades installed packages) and does not update the package cache from repositories. Option C is wrong because 'apt-cache search' queries the local package index for package names or descriptions; it does not update the index, so it will not find packages from a newly added repository until the index is refreshed.

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
1Step 1
2Step 2
3Step 3
4Step 4

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

The vendor's custom .deb package is specifically built for the database and its required library versions, ensuring compatibility. Installing it with 'dpkg -i' after removing the old database package avoids conflicts with the newer shared library that other packages depend on, restoring functionality without breaking the system.

Exam trap

The trap here is that candidates may choose to downgrade the library (option C) thinking it's a quick fix, without realizing that apt's dependency resolution will prevent the downgrade if other packages require the newer version, or that it could break those packages, whereas the vendor's custom package is the intended solution for unsupported software.

How to eliminate wrong answers

Option A is wrong because restoring the entire system from a backup is overly drastic and time-consuming; it would revert all changes, including potentially losing other updates, and does not address the targeted library version mismatch. Option C is wrong because downgrading the library with 'apt-get install <package>=<oldversion>' could break other packages that now depend on the newer library, as apt's dependency resolution would not allow a partial downgrade without risking system instability. Option D is wrong because using 'dpkg --force-depends -i' to force installation of the old database binary against the new library ignores the actual library version mismatch; the binary will still fail to run due to unresolved symbol or ABI incompatibilities, and this approach can corrupt the package database.

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/zypp/repos.d/ is the directory where SUSE's Zypper package manager stores repository configuration files (each .repo file defines a repository's URL, GPG keys, and other settings). This is the standard location for configuring repositories on openSUSE and SUSE Linux Enterprise systems.

Exam trap

The trap here is that candidates confuse the configuration directory for APT (/etc/apt.conf.d/) with the actual repository source location (/etc/apt/sources.list), or assume that all package managers use a repos.d subdirectory pattern, when in fact pacman uses a single configuration file.

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

The `apt show curl` command displays detailed information about the curl package, including its dependencies, from the APT repository metadata. This is a standard way to view dependency information on Debian-based systems.

Exam trap

The trap here is that candidates may think `dpkg --info` or `apt-get check` are appropriate for displaying dependencies, but `dpkg --info` works on .deb files and `apt-get check` only verifies the database integrity, not specific package dependencies.

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

`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 scenario states the repository is set up as an internal YUM repository with compiled RPMs, but yum requires the repository to be accessible via HTTP, FTP, or a local file:// path. If the repository is only available as a local file path on the server and not served via a web server (e.g., Apache or Nginx) or FTP, yum will fail to find the package unless the .repo file explicitly uses a file:// URL. Since the question implies a central repository accessed by multiple servers, a local file path without proper serving would not be reachable by yum over the network.

Exam trap

The trap here is that candidates assume running createrepo is sufficient for yum to find packages, overlooking that yum must be able to access the repository metadata over a network protocol, not just have the files present locally.

How to eliminate wrong answers

Option A is wrong because a missing GPG key would cause a signature verification warning or error, not a 'package not found' message; yum would still locate the package but refuse to install it due to missing key. Option B is wrong because an architecture mismatch would produce a specific error about incompatible architecture, not a generic 'package not found' message; yum would still see the package but reject it. Option C is wrong because a wrong baseurl hostname would cause a connection error (e.g., 'Cannot find a valid baseurl for repo') rather than a 'package not found' message; the repository would be unreachable entirely.

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

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

`/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

dpkg is the core low-level package manager for Debian-based distributions, handling the installation, removal, and querying of .deb packages directly. It does not resolve dependencies automatically, making it the foundational tool upon which higher-level tools like APT are built.

Exam trap

The trap here is that candidates often confuse high-level package managers across distributions, mistakenly thinking that tools like yum or rpm are universal, when in fact they are specific to Red Hat-based systems, while Debian-based systems exclusively use dpkg and APT-family tools.

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

The `rpm -V` (verify) command checks the integrity of installed package files by comparing their current attributes (size, MD5 checksum, permissions, etc.) against the original metadata stored in the RPM database. This directly answers the question of whether files belonging to the 'openssh-server' package have been modified since installation.

Exam trap

The trap here is confusing `rpm -K` (key/signature verification of a package file) with `rpm -V` (verification of installed files against the database), as both involve 'verification' but serve entirely different purposes.

How to eliminate wrong answers

Option A is wrong because `rpm -K` verifies the cryptographic signature of an RPM package file (e.g., GPG key), not the integrity of already installed files. Option B is wrong because `rpm -qa | grep openssh` simply lists all installed packages whose names contain 'openssh', performing no integrity check. Option C is wrong because `rpm -q openssh-server` only queries whether the package is installed and displays its version/release, without verifying file integrity.

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

`apt-get install -f` (or `apt --fix-broken install`) attempts to correct a system with broken dependencies by installing missing packages or removing conflicting ones. In this scenario, the unmet dependency is `libbar.so.2`, and running this command will automatically resolve the dependency chain by installing the required library package, assuming it is available in the configured repositories.

Exam trap

The trap here is that candidates often confuse `apt-get update` (which only refreshes package lists) with `apt-get install -f` (which actually repairs broken dependencies), leading them to choose option C as a first troubleshooting step when the real issue is a missing dependency, not an outdated index.

How to eliminate wrong answers

Option B is wrong because `dpkg --force-depends -i foo.deb` bypasses dependency checks entirely, which can leave the system in a broken state where `foo` is installed but `libbar.so.2` is missing, potentially causing runtime failures and making future package management difficult. Option C is wrong because `apt-get update` only refreshes the local package index from repositories; it does not install missing dependencies or fix broken packages, so retrying the installation would still fail if the dependency is not already resolved. Option D is wrong because manually downloading a shared library file (`.so`) and installing it with `dpkg -i` is not a standard package management workflow; `dpkg` expects `.deb` packages, not raw library files, and this approach would not properly register the library with the package manager, leading to unresolved dependencies and potential system instability.

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

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

`yum history undo 123` reverts the specific transaction identified by ID 123, reversing all changes (installs, upgrades, removals) made in that transaction while preserving the current state of other packages. This is the intended command for rolling back a single transaction without affecting subsequent transactions.

Exam trap

The trap here is confusing `undo` (revert a single transaction) with `rollback` (revert all transactions after a given point), leading candidates to choose option C when they only want to reverse one transaction.

How to eliminate wrong answers

Option A is wrong because `yum history redo 123` repeats the actions of transaction 123, which would reapply the same changes that broke the service, not revert them. Option B is wrong because `yum remove <packages>` manually removes specific packages without using the transaction ID, and it cannot revert the entire transaction's set of changes (including upgrades) in one step. Option C is wrong because `yum history rollback 123` reverts all transactions after ID 123, returning the system to the state at the end of transaction 123, which is too aggressive if only that transaction needs to be undone and later transactions should be preserved.

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

In dpkg, the 'rc' status means the package has been removed (the 'r' flag) but its configuration files remain on the system (the 'c' flag). This occurs when you use 'apt-get remove' or 'dpkg -r' without the --purge option, leaving behind files like /etc/apache2/*. The 'c' indicates that the package's conffiles (as listed in its control data) have not been deleted, allowing for potential reinstallation with previous settings preserved.

Exam trap

The trap here is that candidates confuse 'rc' with a fully removed or purged state, not realizing that the 'c' flag specifically means configuration files persist, which is a common oversight when interpreting dpkg status output.

How to eliminate wrong answers

Option B is wrong because 'unpacked but not configured' is represented by 'iU' (intended to be unpacked) or 'u' (unpacked) in dpkg status, not 'rc'. Option C is wrong because 'installed and configured' is shown as 'ii' (both flags set to 'i' for installed and configured), not 'rc'. Option D is wrong because 'completely purged' would show a blank status or 'pn' (purged and not installed), meaning no package files or configuration files remain; 'rc' explicitly indicates configuration files are still present.

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

APT's pinning mechanism, configured via files in /etc/apt/preferences.d/, allows an administrator to assign a high Pin-Priority to a specific package from a particular origin (repository). This ensures that version is always preferred during dependency resolution and upgrades, overriding the default version comparison logic.

Exam trap

The trap here is that candidates confuse apt-mark hold (which only freezes the installed version) with APT pinning (which controls version selection from repositories), leading them to choose option B instead of the correct pinning configuration.

How to eliminate wrong answers

Option A is wrong because editing /etc/apt/sources.list to set the release only controls which distribution release is used for all packages, not pinning a specific package from a specific repository. Option B is wrong because apt-mark hold prevents the package from being upgraded or changed, but it does not enforce a preference for a particular repository's version; it simply locks the current installed version. Option D is wrong because apt-get install -t release package temporarily targets a specific release for installation, but it does not create a persistent preference for that repository's version over others in future operations.

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

The correct command is `apt-get install package=1.9` because in APT, the `install` command is used not only to install new packages but also to downgrade an existing package to a specific version by appending `=version` to the package name. This instructs APT to resolve dependencies and perform the downgrade, overriding the currently installed version.

Exam trap

The trap here is that candidates often assume a dedicated `downgrade` command exists (Option A) or confuse `upgrade`/`dist-upgrade` with the ability to specify a version, when in fact `apt-get install` is the universal command for installing, upgrading, or downgrading a package to a specific version.

How to eliminate wrong answers

Option A is wrong because `apt-get downgrade` is not a valid APT command; APT does not have a dedicated `downgrade` subcommand. Option B is wrong because `apt-get upgrade` only upgrades packages to the latest version available in the repository and does not accept a version specifier; it cannot be used to downgrade. Option C is wrong because `apt-get dist-upgrade` (now `full-upgrade`) handles dependency changes during major upgrades but does not accept a version specifier and is not intended for downgrading a single package to a specific version.

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

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

When no version is specified, apt-get install selects the highest version number from the highest-priority repository. Here, version 2:8.2.3995-1ubuntu2.1 is higher than 2:8.2.3995-1ubuntu1, and focal-updates typically has a higher priority than focal (unless overridden by pinning). Therefore, the candidate version from focal-updates (option D) is installed.

Exam trap

The trap here is that candidates often assume the repository with the highest priority (e.g., focal-updates) always wins, but APT actually selects the highest version number first, and only uses priority as a tiebreaker when versions are equal.

How to eliminate wrong answers

Option A is wrong because version 2:8.2.3995-1ubuntu1 from focal-updates is lower than 2:8.2.3995-1ubuntu2.1, so apt would prefer the higher version. Option B is wrong because version 2:8.2.3995-1ubuntu2.1 from focal is the same version as the correct answer but from the wrong repository (focal instead of focal-updates); apt selects the highest version from the highest-priority repository, and focal-updates typically has higher priority than focal. Option C is wrong because version 2:8.2.3995-1ubuntu1 from focal is both a lower version and from a lower-priority repository compared to the correct answer.

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

On Fedora, `dnf upgrade` is the correct command to update all installed packages to their latest versions. It synchronizes the local package database with the repositories and upgrades every installed package that has a newer version available, handling dependencies automatically.

Exam trap

The trap here is that candidates may confuse `dnf check-update` (which only checks for updates) with the actual update command, or assume that `dnf update all` is valid syntax based on a literal reading of 'update all packages'.

How to eliminate wrong answers

Option B is wrong because `dnf check-update` only lists available updates without performing any upgrades; it is used for informational purposes. Option C is wrong because `dnf update all` is not a valid DNF command; the correct syntax is `dnf upgrade` (or `dnf update`, which is an alias for `upgrade`). Option D is wrong because `dnf install update` attempts to install a package named 'update' rather than upgrading existing packages; it does not perform a system-wide update.

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 correct package is `linux-headers-$(uname -r)` because kernel modules must be compiled against headers that match the exact running kernel version. The `$(uname -r)` command substitution dynamically inserts the current kernel release string (e.g., `5.10.0-28-amd64`), ensuring the headers correspond to the active kernel. On Debian, these headers are provided by the `linux-headers-<version>` package, which includes the necessary `Kbuild`, `Kconfig`, and header files under `/usr/src/linux-headers-<version>`.

Exam trap

The trap here is that candidates confuse the generic 'build-essential' meta-package (which is needed for compiling any C code) with the kernel-specific headers package, or they assume a generic package name like 'kernel-headers-generic' exists on Debian, when in fact Debian uses version-specific `linux-headers-*` packages and the `-generic` flavor is Ubuntu-specific.

How to eliminate wrong answers

Option B is wrong because `kernel-headers-generic` is not a valid Debian package name; Debian uses `linux-headers-<flavor>` (e.g., `linux-headers-amd64`) and the `-generic` suffix is specific to Ubuntu kernels. Option C is wrong because `build-essential` provides compilers (gcc, make) and libraries (libc6-dev) but does not include kernel headers; it is a prerequisite for compiling any C program but not sufficient for kernel module compilation. Option D is wrong because `linux-kernel-headers` is not a real Debian package; the correct naming convention is `linux-headers-*` (e.g., `linux-headers-5.10.0-28-amd64`), and the package `linux-kernel-headers` does not exist in Debian repositories.

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

`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

`zypper addrepo url` adds a new repository from the specified URL, and `zypper refresh` updates the package cache to include metadata from all configured repositories. This two-step sequence is the standard method in openSUSE for adding a remote repository and making its packages available for installation.

Exam trap

The trap here is that candidates confuse `zypper` with `apt` or `yum` commands, where `add-apt-repository` or `yum-config-manager --add-repo` combine adding and refreshing in one step, but `zypper` requires two separate commands.

How to eliminate wrong answers

Option A is wrong because `zypper install --repo url` attempts to install a package directly from a repository specified by URL, but it does not add the repository permanently; it only uses it for a single installation and does not refresh the cache. Option C is wrong because `zypper modifyrepo --add url` is not a valid command; `zypper modifyrepo` is used to change properties of existing repositories, not to add new ones. Option D is wrong because `zypper repos --add url` is not a valid syntax; `zypper repos` lists repositories, and adding a repository requires the `addrepo` subcommand.

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

In Linux, source code for compiling software is conventionally stored in /usr/src (for kernel sources or distribution-provided source packages) and /usr/local/src (for locally compiled software not managed by the package manager). These directories follow the Filesystem Hierarchy Standard (FHS), which designates /usr/src for system-wide source and /usr/local/src for locally installed source code.

Exam trap

The trap here is that candidates may confuse /usr/src with /var/src (which does not exist in the FHS) or assume /tmp is appropriate for source code, overlooking the FHS's explicit design for persistent source storage in /usr/src and /usr/local/src.

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

The `apt-get install apache2=2.2.22` command explicitly specifies the exact version to install, which forces APT to downgrade the package to that version if a newer version is currently installed. APT handles version constraints by comparing version strings using the dpkg version comparison algorithm, allowing precise pinning to an older release.

Exam trap

The trap here is that candidates often confuse `apt-get upgrade` with a version-specific downgrade command, or think that `--reinstall` can change the installed version, when in fact both commands only operate on the currently installed 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

The 'apt-get install -f' command (option B) is the correct fix because it invokes the '--fix-broken' option, which automatically resolves unmet dependencies by either installing missing packages or removing partially installed ones. This is the standard Debian/APT tool for repairing a broken package state after a failed upgrade, as it reads the dpkg database and corrects inconsistencies without manual intervention.

Exam trap

The trap here is that candidates may think manually editing the dpkg database (option A) is a quick fix, but LPIC-1 tests the understanding that APT's built-in repair mechanism is the correct and safe approach, not low-level manual manipulation.

How to eliminate wrong answers

Option A is wrong because manually editing /var/lib/dpkg/status is dangerous and error-prone; it can corrupt the package database and lead to system instability, and it bypasses APT's dependency resolution logic. Option C is wrong because 'dpkg --purge' with a grep for 'iU' (unpacked but not configured) would remove all packages in that state, which is too aggressive and may delete critical system packages that only need reconfiguration, not removal. Option D is wrong because 'dpkg --force-depends -i *.deb' forces installation of all .deb files in the current directory while ignoring dependency checks, which does not fix the underlying broken state and can introduce further inconsistencies.

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

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

Correct matches: /bin holds essential binaries, /etc stores system configuration, /var contains variable data. Common confusions arise from swapping purposes: /bin is not for variable data, /etc is not for temporary files, and /var does not hold binaries.

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

`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 correct command is `dpkg -i software.deb` because `dpkg` is the low-level package manager for Debian-based systems that directly installs `.deb` files. The `-i` flag tells `dpkg` to install the specified package file from the local filesystem, which is exactly what is needed when you have a downloaded `.deb` file.

Exam trap

The trap here is that candidates confuse `apt`/`apt-get` (which manage packages from repositories) with `dpkg` (which handles local `.deb` files), leading them to incorrectly assume `apt install` can accept a filename directly.

How to eliminate wrong answers

Option A is wrong because `rpm` is the package manager for Red Hat-based systems (e.g., Fedora, CentOS) and cannot install Debian `.deb` packages; it expects `.rpm` files. Option B is wrong because `apt install` expects a package name from a configured repository, not a local `.deb` filename; it will fail with an 'unable to locate package' error. Option C is wrong because `apt-get install` also expects a repository package name, not a local file path; it does not accept `.deb` filenames directly.

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

It downloads the Google Linux signing key from the official URL and pipes it directly into `apt-key add`, which imports the key into APT's trusted keyring. This resolves the GPG error by allowing APT to verify the authenticity of packages from the Google Chrome repository.

Exam trap

The trap here is that candidates may confuse `gpg --import` (which affects the user's personal GPG keyring) with `apt-key add` (which affects the system-wide APT trusted keyring), or assume that any keyserver-based retrieval will work for all repositories.

How to eliminate wrong answers

Option B is wrong because `gpg --import` is used to import keys into the local GPG keyring, not into APT's trusted keyring; APT requires keys to be added via `apt-key` or placed in `/etc/apt/trusted.gpg.d/`. Option C is wrong because it assumes the key is available on a keyserver, but Google's signing key is not published on the Ubuntu keyserver; the command would fail to retrieve the key. Option D is wrong because `dpkg --add-key` is not a valid dpkg command; dpkg does not manage GPG keys for APT repositories.

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

In a standard GRUB 2 configuration, the default kernel is selected by setting the GRUB_DEFAULT variable in /etc/default/grub. After modifying this file, the administrator must run update-grub (or grub-mkconfig) to regenerate the /boot/grub/grub.cfg file, which is the actual configuration read by the bootloader. This two-step process separates user-facing settings from the bootloader's runtime configuration.

Exam trap

The trap here is that candidates confuse the GRUB 2 configuration file (/etc/default/grub) with the GRUB Legacy file (/boot/grub/grub.conf) or the auto-generated runtime file (/boot/grub/grub.cfg), leading them to pick an option that either belongs to an older bootloader version or is not meant for direct editing.

How to eliminate wrong answers

Option A is wrong because /boot/grub/grub.conf is the configuration file for GRUB Legacy, not GRUB 2; GRUB 2 uses /boot/grub/grub.cfg. Option B is wrong because /etc/grub.d/ is a directory containing scripts that generate parts of the GRUB 2 configuration, but editing these scripts directly is not the standard way to change the default kernel; the correct approach is to set GRUB_DEFAULT in /etc/default/grub. Option D is wrong because /boot/grub/grub.cfg is the auto-generated runtime configuration file; manually editing it is discouraged as changes will be overwritten by update-grub, and the proper method is to modify /etc/default/grub and regenerate the file.

Page 1 of 2 · 82 questions totalNext →

Ready to test yourself?

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