Courseiva

CCNA Linux Installation and Package Management Questions

69 questions · Linux Installation and Package Management · All types, 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

Running `update-grub` regenerates `/boot/grub/grub.cfg` from `/etc/default/grub` and the scripts in `/etc/grub.d/`, so the serial console parameters take effect on the next boot. On Debian-based systems this wrapper invokes `grub-mkconfig -o /boot/grub/grub.cfg`, satisfying the stem's requirement to apply the edits.

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

Naming the suite as 'buster' pins APT to that Debian release's package index, while the 'main' component restricts retrieval to officially supported free software. The deb URL form and single-line syntax match /etc/apt/sources.list requirements, satisfying the need to add the official buster 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.

3
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

On Red Hat systems the RPM database records which package owns each installed file. The query flag -f accepts a file path and returns its owning package, directly answering which package installed /usr/bin/foo without scanning the filesystem manually.

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.

4
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 is Debian's low-level package manager, and the -i flag installs a local .deb archive directly from the filesystem. It satisfies the requirement to install the specified local file without fetching from a repository, unlike apt, which resolves dependencies remotely.

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.

5
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 example resolves the installed package to the newest available version in enabled repositories, upgrading example-1.0 to example-2.0 while handling dependencies. This satisfies the upgrade constraint, unlike yum install, which would report the package already installed.

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.

6
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

The --replacefiles option instructs rpm to overwrite files owned by other installed packages, resolving the conflict and allowing installation to proceed. Without it, rpm aborts to protect the existing package's files, so the conflict blocks the transaction.

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.

7
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

`apt-get -f install` triggers APT's dependency repair routine, scanning the dpkg database for packages left in a half-configured or unpacked state and attempting to fix broken dependencies by installing missing prerequisites or removing offending packages. This directly satisfies the stem's constraint: a Debian system with partially installed packages after a failed installation.

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.

8
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

`rpm -qi openssh-server` queries the installed package's metadata, and its output includes the "Install Date" field already rendered in human-readable form, satisfying the stem's requirement to convert the Unix timestamp. The `-q` query mode with `-i` information selector reads from the local RPM database, so no timestamp arithmetic is needed.

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.

9
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

`apt-get purge apache2` removes both the package and its configuration files, satisfying the stem's explicit requirement to delete configuration alongside the package. Unlike `remove`, which leaves conffiles on disk, `purge` deletes them, so no residual settings remain on the Debian system.

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.

10
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.

11
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

Cached metadata is the culprit: YUM stores repository metadata locally and only refreshes it when the expiry window lapses, so freshly regenerated repodata stays invisible until then. Running 'yum clean all' forces a metadata re-download, immediately exposing the new RPM to 'yum update'.

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.

12
MCQmedium

An administrator needs to install a Debian package file named custom-app.deb that was downloaded from a vendor website. The package has dependencies that are available in the configured repositories. Which command will install the package along with its dependencies?

A.dpkg --install --resolve custom-app.deb
B.dpkg -i custom-app.deb
C.apt-get install custom-app
D.apt install ./custom-app.deb
AnswerD

The apt command can install local .deb files if the path includes a slash or ./ prefix. When given a local package file, apt will resolve and download any missing dependencies from the configured repositories, then install both the package and its dependencies. This is the recommended method for installing a local .deb with dependency resolution.

Why this answer

The apt command, when given a local .deb file path (e.g., ./custom-app.deb), will install the package and automatically download and install any missing dependencies from configured repositories. This is the preferred method for installing local Debian packages that have dependencies available in repositories. dpkg alone does not handle dependencies.

Exam trap

The trap here is assuming that dpkg can resolve dependencies, or that apt can install a local file without specifying the path.

13
Drag & Dropmedium

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

Drag or tap steps into the slots.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

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

14
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 resolves dependencies and installs, upgrades or removes .deb packages from configured repositories, satisfying the stem's requirement for Debian package management. Unlike dpkg, which handles local archives without dependency resolution, apt-get retrieves dependencies automatically, making it a standard tool for managing Debian systems.

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.

15
MCQmedium

A Linux administrator is preparing a new server and needs to install a package group called 'Development Tools' on a CentOS 8 system. The administrator wants to see which packages are included in this group before installing. Which command should be used?

A.dnf group info "Development Tools"
B.yum groupinstall "Development Tools"
C.dnf list groups
D.rpm -q --group "Development Tools"
AnswerA

dnf group info displays detailed information about a package group, including the list of mandatory, default, and optional packages. This allows the administrator to see exactly what will be installed. It is the correct command for inspecting a group's contents on CentOS 8.

Why this answer

dnf group info provides a detailed breakdown of a package group, listing the packages that are part of it. This allows the administrator to review the contents before deciding to install. It is the standard way to inspect groups on CentOS 8 and other dnf-based distributions.

Exam trap

The trap here is confusing commands that list all groups or install groups with the command that shows the specific packages within a group.

16
MCQmedium

A Debian-based server has a custom application installed from a local .deb file that was built in-house. The administrator wants to verify the package's metadata (version, dependencies, and maintainer scripts) before installing it on a production system, but does not want to actually install it. Which command should the administrator use?

A.dpkg --contents application.deb
B.apt-cache show application
C.dpkg --info application.deb
D.dpkg-deb --extract application.deb /tmp/app
AnswerC

The --info (or -I) option to dpkg displays detailed metadata from a .deb archive, including package name, version, architecture, dependencies, and the maintainer scripts, without installing it. This is exactly what the administrator needs to inspect the package before deployment, making it the correct tool for a pre-installation review of an in-house .deb file.

Why this answer

The dpkg --info command reads the control information embedded in a .deb archive, showing the package name, version, architecture, dependencies, and maintainer scripts. It is the standard way to inspect a local package's metadata before installation, which is precisely what the administrator needs to verify the in-house application without modifying the production system.

Exam trap

The trap here is confusing the options that list files inside a package with the option that displays the package's control metadata.

17
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

On Debian-based systems, dpkg -S searches the installed package database for the package owning a given file path, returning the package name directly. The exhibit shows a dpkg-managed system, so this queries the correct local database rather than an RPM or repository index.

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.

18
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

yum update -y resolves and installs all available package updates, including security errata, without interactive prompts, so running it from a first-boot startup script satisfies the requirement for unattended patching on the CentOS 7 image.

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).

19
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

`dpkg --get-selections` reads the local dpkg status database directly, printing every package with its selection state (install, hold, deinstall). This satisfies the stem's requirement to list all installed packages by querying dpkg, unlike `apt list --installed`, which consults APT's extended states rather than the dpkg database itself.

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.

20
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 local .deb but leaves dependencies unresolved, so `apt-get install -f` then reads the package database, fetches the missing dependencies from configured repositories and configures everything. This two-step sequence satisfies the stem's unmet-dependency constraint, which `dpkg` alone cannot fix.

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.

21
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` refreshes the local package index from all configured sources, including the newly added APT repository in sources.list. This satisfies the stem's requirement to make the system aware of the repository's available packages. Without this index refresh, `apt install` cannot see or resolve packages from that source.

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.

22
Drag & Dropmedium

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

Drag or tap steps into the slots.

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.

23
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.

24
MCQeasy

A system administrator needs to determine which package owns the file /usr/bin/htop on a Debian-based server. Which command should the administrator use?

A.apt-file search /usr/bin/htop
B.dpkg -L htop
C.dpkg -S /usr/bin/htop
D.rpm -qf /usr/bin/htop
AnswerC

dpkg -S (or --search) searches the installed packages database for the package that owns the specified file. It directly answers the question by returning the package name that contains /usr/bin/htop, making it the correct and efficient tool for this task.

Why this answer

The correct command is dpkg -S, which searches the dpkg database for the package that owns a given file. This is the standard method on Debian-based systems to map a file to its package. The other options either list files from a known package, search repository indexes, or are for a different package management system.

Exam trap

The trap here is confusing dpkg -L (list files of a package) with dpkg -S (search for package owning a file), as both deal with file-package relationships but in opposite directions.

25
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.

26
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.

27
Multi-Selecthard

A Linux administrator is configuring a CentOS 7 server and needs to manage software packages using the native RPM toolset. The administrator wants to perform two tasks: (1) verify the integrity of an installed package against its original metadata, and (2) list all files installed by a specific package. Which TWO commands should the administrator use? (Choose two.)

Select 2 answers
A.rpm -q --changelog package_name
B.rpm -qi package_name
C.rpm -ql package_name
D.rpm -qf /path/to/file
E.rpm -V package_name
AnswersC, E

rpm -ql (or --query --list) lists all files that are installed by the specified package. This directly satisfies the second requirement to enumerate package contents. It queries the RPM database and outputs the full file paths.

Why this answer

The correct commands are rpm -V for verifying package integrity and rpm -ql for listing installed files. These directly address the two tasks: verification checks file attributes against the RPM database, and query list enumerates all files from a package. The other options provide different types of package information and do not fulfill the requirements.

Exam trap

The trap here is mixing up rpm query options: -V verifies, -ql lists files, -qi gives info, and -qf finds owner. Confusing these can lead to selecting commands that do not perform the needed tasks.

28
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

apt-get install retrieves packages and their dependencies from configured Debian repositories, then invokes dpkg to unpack and configure them. It satisfies the stem's requirement for a Debian-based installation command, handling dependency resolution that the lower-level dpkg tool leaves to the administrator.

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.

29
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

The missing dependency is a shared library file, not a package name, so the package manager cannot resolve it directly. Querying which package provides libbar.so.2 identifies the correct RPM or DEB to install, satisfying the dependency.

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.

30
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

The -qf flag queries the RPM database for the package owning a specified file path, directly satisfying the need to identify the provider of /etc/ssh/sshd_config. Unlike -ql, which lists files within a named package, -qf works backwards from the file to its owning package.

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.

31
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.

32
MCQeasy

A Linux administrator is preparing a new Ubuntu 22.04 server and needs to ensure that the package lists are up to date before installing software. Which command should be used to refresh the package index from all configured repositories?

A.apt-get install --refresh
B.apt update
C.apt upgrade
D.apt dist-upgrade
AnswerB

apt update downloads the latest package metadata from all repositories listed in /etc/apt/sources.list and /etc/apt/sources.list.d/. It refreshes the local cache of available packages and their versions but does not install or upgrade any packages. This is the correct first step before installing software to ensure the system is aware of the newest available versions and dependencies.

Why this answer

The apt update command synchronizes the local package index with the repositories, ensuring that subsequent install or upgrade commands operate on the latest metadata. It is a prerequisite for installing new software or applying updates. The other commands either perform upgrades based on stale data or are invalid.

Refreshing the index is a routine maintenance task on Debian-based systems.

Exam trap

The trap here is confusing updating the package index (apt update) with upgrading installed packages (apt upgrade), which are separate operations.

33
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

`rpm -V openssh-server` compares each installed file's size, MD5 checksum, permissions, type, owner and group against the values recorded in the RPM database at installation, flagging any mismatch. This directly satisfies the stem's requirement to detect post-installation modification of package files.

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.

34
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

Running apt update refreshes the local package index from every repository listed in sources.list, satisfying the requirement to update metadata without installing anything. The related apt upgrade command installs newer package versions, so it does not meet the stated goal of refreshing the index alone.

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.

35
MCQmedium

A junior administrator needs to install the package 'nginx' on a Debian 12 server, but the required package file is not available in any configured APT repository. The administrator has downloaded the file 'nginx_1.22.1-9_amd64.deb' to the current directory. Which command should be used to install this local package file while automatically resolving and installing any missing dependencies from the configured repositories?

A.apt install ./nginx_1.22.1-9_amd64.deb
B.apt-get install nginx_1.22.1-9_amd64.deb
C.dpkg -i nginx_1.22.1-9_amd64.deb
D.dpkg --install --force-depends nginx_1.22.1-9_amd64.deb
AnswerA

On Debian 12, apt accepts a local .deb file path (with ./ to distinguish it from a package name) and installs it while automatically resolving and downloading any missing dependencies from the configured repositories. This is the modern replacement for the older gdebi or dpkg followed by apt-get install -f approach, and it performs the entire operation in one step as required.

Why this answer

The apt command can install a local .deb file when given a path that includes a slash (such as ./filename.deb), and it automatically resolves and installs dependencies from configured repositories. This combines the local installation capability of dpkg with the dependency resolution of APT in a single step. The other commands either fail to resolve dependencies, misinterpret the filename as a package name, or force installation while leaving dependencies broken.

Exam trap

The trap here is assuming that dpkg -i is the standard way to install local .deb files, when in fact modern APT can handle local files directly with automatic dependency resolution.

36
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

Chaining apt-get update with apt-get install refreshes the package lists from all configured sources, including the newly added third-party repository, then installs webapp in a single command. Without the update step, apt-get install would use stale metadata and fail to locate the latest version.

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.

37
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

apt-cache policy queries the APT cache and prints, for each configured repository, the installed version and the candidate version that would be selected for installation, letting the administrator confirm which version the repositories currently offer.

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.

38
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

`yum history undo 123` reverses every package installation, upgrade and downgrade recorded under transaction ID 123, restoring the exact prior versions in one operation. This directly satisfies the stem's requirement to revert the entire transaction by its ID, rather than selectively removing individual packages.

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.

39
MCQmedium

A system administrator is preparing a custom RPM package for internal distribution. The package must be built from source code and a spec file. Which command should be used to build the binary RPM from the spec file?

A.rpm -bb package.spec
B.rpmbuild -ba package.spec
C.rpmbuild -bb package.spec
D.rpmbuild -bs package.spec
AnswerC

The -bb option tells rpmbuild to build only the binary package from the specified spec file. This is the standard way to produce a binary RPM when the source and spec files are already in place. It performs the build steps defined in the spec's %build section and packages the resulting files according to the %files list.

Why this answer

The rpmbuild command with the -bb option compiles the source and creates a binary RPM from the spec file. This is the correct tool for building packages from source on RPM-based systems. The -ba option would also produce a binary RPM but additionally creates a source RPM, which is not required when only the binary package is needed.

Exam trap

The trap here is confusing the rpm command with rpmbuild, or selecting an option that builds source RPMs instead of binary RPMs.

40
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

In dpkg status output, the first letter 'r' means the package was removed, and the second letter 'c' means only its configuration files remain on the system. This matches the 'rc' state shown for apache2.

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.

41
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 uses Pin-Priority values in /etc/apt/preferences.d/ to override version comparison. Assigning a high priority to a specific package and origin forces that repository's version to be selected regardless of whether another repository offers a numerically higher version.

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.

42
MCQeasy

An administrator needs to install a package named 'nginx' on a Debian system, but the package is already installed. The administrator wants to ensure that the latest available version from the configured repository is installed, upgrading if necessary. Which command should be used?

A.dpkg -i nginx
B.apt-get reinstall nginx
C.apt-get install nginx
D.apt-get upgrade nginx
AnswerC

apt-get install will check if nginx is already installed and, if a newer version is available in the repository, it will upgrade to that version. If no newer version exists, it reports that the package is already the newest version. This satisfies the requirement to install or upgrade as needed.

Why this answer

apt-get install nginx will install the package if not present, or upgrade it to the newest version if one is available in the repositories. It automatically handles dependencies and is the standard method for ensuring a package is at the latest available version on Debian systems.

Exam trap

The trap here is assuming that apt-get install will skip an already installed package, when in fact it will upgrade it if a newer version is available.

43
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

`apt-get install package=1.9` pins the exact version by appending `=1.9` to the package name, so APT resolves and installs 1.9 even though 2.0 is already present and newer. This satisfies the downgrade requirement directly, since APT permits installing an older version when the version is explicitly specified.

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.

44
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

CentOS 7 uses YUM/DNF, which reads repository definitions from .repo files under /etc/yum.repos.d/. Creating that file with the repository's baseurl and GPG settings registers the third-party source, making its packages installable. This is the prerequisite before any install command.

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.

45
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.

46
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

On Fedora, dnf is the default package manager, and dnf upgrade resolves dependencies and installs the newest versions of all installed packages. It satisfies the stem's requirement to update everything, unlike dnf install, which targets specified packages only.

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.

47
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

The linux-headers package matching the running kernel via uname -r supplies the exact header files and build scripts the module's make process requires. Installing headers for a different kernel version would not resolve the missing-header compilation failure.

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.

48
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.

49
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

The configure script needs the OpenSSL development headers and libraries to compile against. Installing libssl-dev via the package manager provides those headers and the linker files, allowing ./configure to complete and the build to proceed.

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.

50
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

zypper addrepo registers the URL as a new repository in the openSUSE configuration, then zypper refresh rebuilds the package metadata cache so the new source's packages become installable. Both steps are required to satisfy the stem's add-and-refresh constraint.

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.

51
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

/usr/src is the conventional Linux location for kernel and package source trees awaiting compilation, satisfying the stem's requirement for a directory used to store source code before building. It is distinct from /usr/local/src, which holds locally compiled software sources.

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.

52
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

`apt-get install -f` invokes APT's dependency repair, scanning the dpkg database for broken or unmet dependencies and attempting to configure or remove offending packages. This directly resolves the stem's "unmet dependencies" state, restoring a consistent package set so subsequent installs succeed.

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.

53
MCQeasy

A junior administrator needs to install the package 'nginx' on an Ubuntu 22.04 server. They want to ensure all required dependencies are automatically resolved and installed. Which command should they use?

A.dpkg -i nginx
B.apt-get install nginx
C.yum install nginx
D.rpm -ivh nginx
AnswerB

The apt-get install command automatically resolves and installs dependencies from configured repositories. On Ubuntu, apt-get is the standard tool for package installation and will download and install nginx along with any required libraries, handling dependency resolution without manual intervention.

Why this answer

The correct answer is apt-get install nginx. On Ubuntu, apt-get is the high-level package manager that downloads packages from repositories and resolves dependencies automatically. It ensures nginx and all required libraries are installed and configured properly.

Exam trap

The trap here is confusing apt-get with dpkg; dpkg installs local .deb files but does not handle dependencies, while apt-get does.

54
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.

55
MCQmedium

A junior administrator needs to install the package 'nginx' on an Ubuntu 22.04 server. They download the nginx_1.18.0-6ubuntu14.4_amd64.deb file from a vendor website and run the command 'dpkg -i nginx_1.18.0-6ubuntu14.4_amd64.deb'. The installation fails with an error stating that the package depends on 'libnginx-mod-http-image-filter'. Which command should the administrator run next to resolve the missing dependency?

A.apt-get install -f
B.dpkg -i --force-depends nginx_1.18.0-6ubuntu14.4_amd64.deb
C.apt-get update
D.dpkg --configure -a
AnswerA

Running 'apt-get install -f' (or 'apt --fix-broken install') instructs APT to analyze the package database, identify unmet dependencies like the missing libnginx-mod-http-image-filter, and automatically download and install them from configured repositories. This is the standard method to repair a system left in an inconsistent state by a dpkg installation that failed due to missing dependencies.

Why this answer

When dpkg fails to install a .deb file because of unmet dependencies, the package remains unconfigured and the system package database becomes inconsistent. The recommended fix is to run 'apt-get install -f', which instructs APT to resolve broken dependencies by downloading and installing required packages from the repositories. This restores system consistency and completes the installation.

Exam trap

The trap here is assuming that dpkg can resolve dependencies on its own or that forcing installation will solve the problem, when in fact dpkg only reports dependency errors and requires a higher-level tool like APT to fix them.

56
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.

57
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 linux-image-5.10.0-20-amd64 pulls the prebuilt kernel image package from Debian repositories, installing the kernel and triggering initramfs and bootloader updates. This is the standard package-manager method for adding a new kernel on Debian-based systems.

Why this answer

Option C is correct because apt-get install linux-image-5.10.0-20-amd64 uses APT to resolve dependencies and install the specified kernel package from the configured Debian repositories, which is the standard way to install a new kernel on a Debian-based system. Option E is correct because dpkg -i linux-image-5.10.0-20-amd64.deb installs a locally downloaded kernel .deb package directly, which is a valid method when the package file is already present on the system. Option A is incorrect because apt-cache search only queries the package cache for available packages and does not install anything.

Option B is incorrect because apt-get update merely refreshes the package index metadata from repositories and does not install a kernel. Option D is incorrect because make install is used to install software compiled from source, not to install a prebuilt Debian kernel package.

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.

58
MCQmedium

A Linux administrator needs to install a single Debian package file named 'custom-tool_2.1.0_amd64.deb' that was downloaded from a vendor's website. The package has several dependencies that are not currently installed, and the administrator wants the package manager to automatically resolve and install those dependencies from the configured repositories. Which command should the administrator use?

A.dpkg --install --force-depends custom-tool_2.1.0_amd64.deb
B.apt-get install custom-tool
C.apt install ./custom-tool_2.1.0_amd64.deb
D.dpkg -i custom-tool_2.1.0_amd64.deb
AnswerC

apt install with a local .deb file path (prefixed with ./) will install the package and automatically resolve and install its dependencies from configured repositories. This is the modern method that combines local installation with dependency resolution, satisfying the administrator's need.

Why this answer

The correct approach is to use apt install with the local .deb file path, as apt can handle both local package installation and dependency resolution from repositories. Using dpkg alone would install the package but leave dependencies unresolved, while forcing installation ignores the problem. Using apt-get with just the package name would fail because the package is not in a repository.

Exam trap

The trap here is assuming that dpkg -i automatically resolves dependencies from repositories, when it only installs the local package and reports missing dependencies.

59
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

`apt-mark hold` pins the package at its installed version, so `apt upgrade` and `apt-get dist-upgrade` skip it during routine runs. The hold persists until explicitly released, letting the sysadmin run `apt-mark unhold` followed by a manual `apt install` when required — satisfying both the automatic-block and manual-upgrade constraints.

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.

60
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

Installing a compatible alternative satisfies the dependency without removing libfoo's dependants, since the package manager resolves appA and appB against the replacement. This preserves both applications while allowing libfoo's removal, meeting the administrator's stated constraint.

Why this answer

The best approach is to find a compatible alternative package that provides the same functionality as libfoo, install it, and then remove libfoo. This satisfies the dependency requirements of appA and appB through the replacement package, allowing libfoo to be removed without breaking the dependent applications. This is the standard, non-destructive way to resolve dependency conflicts on Debian-based systems.

Exam trap

LPIC-1 often tests the temptation to use --force flags to bypass dependency errors — candidates must recognize that forcing removal breaks dependent applications and that the correct approach preserves functionality via a compatible replacement.

How to eliminate wrong answers

Option A is wrong because dpkg --force-depends bypasses dependency checks and leaves appA and appB with unmet dependencies, causing them to fail at runtime — it does not preserve functionality. Option B is wrong because recompiling appA and appB is a drastic, time-consuming action that requires source code, build environments, and testing, and is not the recommended first step. Option D is wrong because apt-get remove does not support a --no-dep flag; this is a fabricated option, and even if it existed, removing libfoo would break the dependents.

61
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

The low-level tool that installs, removes and queries individual .deb packages directly, satisfying the stem's requirement for a Debian package management tool. Unlike apt, dpkg does not resolve dependencies or fetch packages from repositories, but it remains the foundational utility underlying all higher-level Debian package managers.

Why this answer

Option B, dpkg, is correct because it is the low-level Debian package manager that installs, removes, and queries .deb packages on Debian-based systems. Option D, apt, is correct because it is the high-level Debian package management front end that resolves dependencies and works with repositories, typically invoking dpkg underneath. The unmarked options do not belong: yum (A) and rpm (C) are Red Hat–family tools for RPM-based distributions, and zypper (E) is the package manager for SUSE/openSUSE, not Debian.

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.

62
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

DNF substitutes $releasever and $basearch at runtime when constructing repository URLs. If either variable fails to expand, the resulting baseurl points to a non-existent path, so metadata retrieval returns nothing and the repository reports zero packages despite being enabled.

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.

63
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 local .deb archive and runs its maintainer scripts, operating directly on the downloaded file. The stem specifies a local Debian package, so dpkg is the correct low-level installer rather than apt, which resolves repositories.

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.

64
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

The pipeline downloads Google's signing key and pipes it into apt-key, adding the public key to APT's trusted keyring so the repository's Release signature verifies. This resolves the GPG error caused by the missing key for that repository.

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.

65
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

Editing `/etc/default/grub` sets the `GRUB_DEFAULT` variable, which selects the default menu entry by index, title or saved entry. Regenerating `grub.cfg` with `grub-mkconfig` then applies that choice, satisfying the requirement to change the default kernel persistently in a standard GRUB 2 setup.

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.

66
MCQeasy

Refer to the exhibit. An administrator wants to verify the integrity of the kernel-core package by checking its signature. Which command is used?

A.`rpm -qa kernel-core`
B.`rpm -q --changelog kernel-core`
C.`rpm -K kernel-core`
D.`rpm -V kernel-core`
AnswerC

The -K flag performs a signature and digest verification on the named package, checking its GPG signature against the imported Red Hat keys. This directly satisfies the requirement to verify kernel-core's integrity, unlike -V, which only compares installed file attributes against the RPM database.

Why this answer

`rpm -K` (or `rpm --checksig`) is the command used to verify the GPG signature of an RPM package, ensuring its integrity and authenticity. This checks the package's cryptographic signature against the imported GPG key, confirming it has not been tampered with.

Exam trap

The trap here is confusing `rpm -V` (verify installed files) with `rpm -K` (verify package signature), as both involve 'verification' but operate on different targets and use different mechanisms.

How to eliminate wrong answers

Option A is wrong because `rpm -qa kernel-core` lists all installed packages matching the name 'kernel-core', but does not verify any signature. Option B is wrong because `rpm -q --changelog kernel-core` displays the changelog of the installed package, which is unrelated to signature verification. Option D is wrong because `rpm -V kernel-core` verifies the installed files' attributes (size, permissions, checksums) against the RPM database, but does not check the package's cryptographic signature.

67
MCQmedium

A user compiling software from source successfully runs './configure' and 'make', but the resulting binaries are not in the PATH. Which command should be run to install them system-wide?

A.make
B.make all
C.make clean
D.make install
AnswerD

'make' compiles but does not place binaries in system directories. 'make install' runs the install target defined in the Makefile, copying the built binaries to their configured system-wide locations such as /usr/local/bin, making them available on the PATH.

Why this answer

After './configure' and 'make' compile the source code, the binaries are built but remain in the local build directory. The 'make install' target copies the compiled binaries, libraries, and configuration files to their system-wide destinations (typically /usr/local/bin, /usr/local/lib, etc.) as defined by the Makefile's install prefix. Without running 'make install', the binaries exist only in the source tree and are not accessible via PATH.

Exam trap

LPIC-1 often tests the confusion between the compile stage ('make') and the install stage ('make install'), catching candidates who assume that a successful 'make' automatically places binaries in PATH.

How to eliminate wrong answers

Option A is wrong because 'make' alone (without a target) runs the default target, which is usually 'all' — it compiles the software but does not install it system-wide; the user already ran 'make' successfully. Option B is wrong because 'make all' is typically the same as the default build target, which compiles all components but still does not copy binaries to system directories. Option C is wrong because 'make clean' deletes compiled object files and binaries from the build directory — it is the opposite of installing and would actually remove the compiled output.

68
MCQhard

An administrator suspects that a critical system file has been modified after installation. Which command can be used to verify the integrity of all installed RPM packages on a RHEL system?

A.`rpm -K`
B.`rpm --verify`
C.`rpm -V all`
D.`rpm -Va`
AnswerD

`rpm -Va` verifies every installed package by comparing each file's size, MD5 checksum, permissions, type, owner and group against the RPM database metadata, flagging any discrepancies. This directly satisfies the stem's requirement to check all packages for post-installation modification, rather than querying a single package or file.

Why this answer

(`rpm -Va`) is correct because it verifies all installed RPM packages against their original metadata, checking file sizes, permissions, checksums, and other attributes. The `-V` flag triggers verification, and `-a` applies it to every installed package, making it the proper command to detect modifications to critical system files.

Exam trap

The trap here is that candidates confuse `rpm -K` (key verification of package files) with `rpm -V` (verification of installed packages), or assume `--verify` alone works without the `-a` flag to target all packages.

How to eliminate wrong answers

Option A is wrong because `rpm -K` checks the GPG signature and digest of an RPM package file (not installed packages) to verify its authenticity and integrity before installation, not to detect post-installation modifications. Option B is wrong because `rpm --verify` is a valid syntax but is incomplete; it requires a package name or `-a` to act on all packages, so without `-a` it does not verify all installed packages. Option C is wrong because `rpm -V all` is invalid syntax; `-V` expects a package name or the `-a` flag, and `all` is not a recognized argument, causing an error.

69
MCQeasy

A system administrator needs to determine which package owns the file /usr/bin/htop on a Debian-based system. Which command will provide this information?

A.apt-file search /usr/bin/htop
B.dpkg -L /usr/bin/htop
C.dpkg -S /usr/bin/htop
D.apt-cache search /usr/bin/htop
AnswerC

The dpkg -S command searches for the package that owns a specified file. It queries the dpkg database for installed packages and returns the package name that contains the given file path. This is the correct tool for identifying package ownership on Debian-based systems.

Why this answer

The dpkg -S command is used to find the package that owns a specific file on a Debian-based system. It searches the dpkg database of installed packages. The other commands either list files of a package, search repository contents, or search package descriptions, none of which directly answer the question for an installed file.

Exam trap

The trap here is confusing the -S (search) and -L (list) options of dpkg, or using apt-file which queries repositories rather than installed packages.

Ready to test yourself?

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