Linux Professional Institute Certification Level 1 LPIC-1 (LPIC-1) — Questions 175

522 questions total · 7pages · All types, answers revealed

Page 1 of 7

Page 2
1
MCQmedium

Refer to the exhibit. How many physical disks are detected by the kernel, and what are their sizes?

A.Two disks: sda 10.0 GiB, sdb 2.00 GiB
B.Two disks: sda 10.7 GB, sdb 2.15 GB
C.Three disks: sda, sdb, and an unknown device
D.One disk: sda 10.7 GB
AnswerA

Correctly matches the output sizes in GiB.

Why this answer

The output shows two disks: sda with 20971520 logical blocks of 512 bytes = 10737418240 bytes = 10.0 GiB, and sdb with 4194304 blocks = 2147483648 bytes = 2.00 GiB. The sizes are given in GiB in the output.

2
MCQmedium

A senior administrator runs a script that processes a CSV file. The script contains the following snippet: 'for field in $(cat data.csv); do ...'. The data.csv file contains lines like: 'John Doe, 123 Main St, Springfield'. The script fails to process correctly, splitting fields incorrectly and causing errors. Which of the following is the most appropriate fix?

A.Use xargs to process each line
B.Use 'for field in $(<data.csv)' with proper quoting
C.Use 'for field in "$(cat data.csv)"' with double quotes around the substitution
D.Use a while loop with read: 'while IFS= read -r line; do ... done < data.csv'
AnswerD

Reads each line correctly with IFS= to preserve whitespace.

Why this answer

Option A is correct: using a while loop with read -r processes each line correctly, preserving whitespace. Option B treats the entire file as one string. Option C still uses command substitution which splits on whitespace.

Option D xargs by default splits on whitespace and is not designed for line-by-line processing of CSV.

3
MCQmedium

You manage a CentOS 7 server that runs a critical application storing data on an XFS filesystem mounted at /data. The server experiences an unexpected power outage. After rebooting, the application fails to start, and you suspect filesystem corruption. You boot into single-user mode and attempt to mount /data, but the mount fails with an error: 'mount: /dev/sdb1: can't read superblock'. You run 'xfs_repair -n /dev/sdb1' and it reports the log is dirty and must be replayed or the filesystem repaired with the -L option (force log zeroing). You want to recover the filesystem with minimal data loss. Which action should you take?

A.Run 'xfs_repair -L /dev/sdb1' to force log replay and repair.
B.Mount the filesystem with the 'norecovery' option to bypass the log and then attempt to repair.
C.Run 'fsck -y /dev/sdb1' to automatically repair.
D.Run 'xfs_admin -U generate /dev/sdb1' to generate a new UUID and then mount.
AnswerA

-L zeros the log and forces a replay, which is necessary when the log is corrupt.

Why this answer

The correct answer is A because xfs_repair -L /dev/sdb1 forces the log to be zeroed (cleared) and then performs a full filesystem check and repair. This is necessary when the log is dirty and cannot be replayed normally due to corruption, such as after an unclean shutdown. The -L option is the standard recovery method for XFS when the log is damaged, and it minimizes data loss by only discarding the log (which contains metadata changes that were not yet written to disk) while preserving the rest of the filesystem data.

Exam trap

The trap here is that candidates familiar with ext4 may instinctively choose fsck (Option C), not realizing that XFS has its own repair tool (xfs_repair) and that fsck is incompatible with XFS filesystems.

How to eliminate wrong answers

Option B is wrong because mounting with 'norecovery' bypasses log replay entirely, leaving the filesystem in an inconsistent state and preventing any repair; it is used for read-only access to salvage data, not for recovery. Option C is wrong because fsck is designed for ext2/ext3/ext4 filesystems, not XFS; running fsck on an XFS filesystem can cause further damage or fail to recognize the filesystem type. Option D is wrong because xfs_admin -U generate changes the UUID of the filesystem, which does not address superblock corruption or dirty log issues; it is used for UUID management, not repair.

4
MCQmedium

A DHCP server assigns IP addresses to clients, but some clients are not receiving the correct gateway. Which configuration file should be checked on the DHCP server?

A./etc/dhcpd.conf
B./etc/dhcp/dhclient.conf
C./etc/dhcp/dhcpd.conf
D./etc/resolv.conf
AnswerC

Standard configuration file for DHCP server.

Why this answer

Option A is correct because the DHCP daemon configuration file is typically /etc/dhcp/dhcpd.conf. Option B is wrong because that path is not standard. Option C is wrong because that file configures the DHCP client if using dhclient.

Option D is wrong because it is the default gateway file for the system, not DHCP config.

5
MCQeasy

Which command shows the amount of free and used memory in the system, including swap?

A.top
B.free -h
C.df -h
D.vmstat
AnswerB

free -h specifically shows memory usage with swap.

Why this answer

free -h displays memory and swap usage in human-readable format. It shows total, used, free, and buffers/cache.

6
MCQmedium

A Linux system has multiple disk partitions. The administrator wants to view the UUID of a specific partition for use in /etc/fstab. Which command will display the UUID?

A.blkid /dev/sda1
B.fdisk -l /dev/sda1
C.lsblk -f
D.cat /proc/partitions
AnswerA

blkid displays UUID and other attributes of the specified device.

Why this answer

The `blkid` command queries the libblkid library to display block device attributes, including the UUID and filesystem type. Running `blkid /dev/sda1` outputs the UUID for that specific partition, which can be directly copied into /etc/fstab for persistent mounting.

Exam trap

The trap here is that candidates may confuse `lsblk -f` (which shows all UUIDs in a tree format) as the command for a specific partition, or think `fdisk -l` displays UUIDs, when in fact `blkid` is the dedicated tool for querying a single partition's UUID.

How to eliminate wrong answers

Option B is wrong because `fdisk -l /dev/sda1` is invalid syntax; `fdisk -l` lists partition tables for a whole disk (e.g., /dev/sda), not a single partition, and it does not display UUIDs. Option C is wrong because `lsblk -f` shows UUIDs for all block devices, not just a specific partition, and the question asks for a command that displays the UUID of a specific partition, making it less direct. Option D is wrong because `cat /proc/partitions` only lists partition major/minor numbers and block counts, not UUIDs or filesystem attributes.

7
MCQeasy

A small office server running Ubuntu 20.04 experiences a gradual time drift. The system clock loses about 2 minutes per week. The hardware clock (RTC) is maintained by the motherboard battery and appears accurate when checked manually. The sysadmin wants to ensure the system clock stays synchronized automatically. Which single action should be taken? Options: A) Run 'timedatectl set-ntp true' to enable systemd-timesyncd, B) Add 'hwclock --hctosys' to /etc/rc.local, C) Install and configure the ntp package with a pool server, D) Use 'cron' to run ntpdate every minute.

A.Install and configure the ntp package with a pool server
B.Add 'hwclock --hctosys' to /etc/rc.local
C.Use 'cron' to run ntpdate every minute
D.Run 'timedatectl set-ntp true' to enable systemd-timesyncd
AnswerD

Enables a lightweight SNTP client that keeps time synchronized.

Why this answer

Option A enables the integrated SNTP client in systemd, which is the simplest solution for most desktops/servers. Option B only syncs at boot, not continuously. Option C is valid but overkill for 2 minutes/week drift; the simpler solution works.

Option D is inefficient and may cause rapid clock adjustments. Thus A is best.

8
MCQhard

A system is experiencing frequent crashes. Investigation shows that the root filesystem is mounted with 'errors=remount-ro'. The admin wants to prevent data loss by mounting with 'errors=panic' in /etc/fstab. Which change is correct?

A.Add 'errors=panic' as an additional option
B.Change the mount point to /panic
C.Use 'defaults,errors=panic'
D.Replace 'errors=remount-ro' with 'errors=panic'
AnswerD

Directly changes the error handling behavior.

Why this answer

Option D is correct because the admin wants to change the error behavior from remounting the filesystem read-only to panicking the kernel. In /etc/fstab, each mount option is a comma-separated list; to change the error handling, you must replace the existing 'errors=remount-ro' with 'errors=panic' in the options field. Adding an additional 'errors=panic' would create a conflict (the last one parsed typically wins, but it's ambiguous and not the intended clean configuration).

Exam trap

The trap here is that candidates think they can simply add 'errors=panic' as an extra option (Option A) without removing the existing 'errors=remount-ro', not realizing that duplicate 'errors=' directives create ambiguity and are not the intended way to change the error handling policy.

How to eliminate wrong answers

Option A is wrong because adding 'errors=panic' as an additional option alongside 'errors=remount-ro' would create duplicate 'errors=' directives; the kernel's mount parser may use the last one, but this is ambiguous and not a reliable or clean configuration. Option B is wrong because changing the mount point to '/panic' is nonsensical—it does not affect error handling and would break the root filesystem mount location. Option C is wrong because 'defaults,errors=panic' would replace all existing options with defaults plus the panic behavior, which would remove other necessary options (like 'rw') and could cause the root filesystem to mount incorrectly or lose required settings.

9
MCQhard

Refer to the exhibit. The process with PID 1234 is in state 'Z'. What is the most likely cause and appropriate action?

A.The process is stopped; use kill -CONT to continue.
B.The process is a daemon; it should be restarted.
C.The process is sleeping; wait for it to become ready.
D.The process is a zombie; the parent process must be killed or wait for it to be reaped.
AnswerD

Zombies require the parent to reap them; if parent is not waiting, it may need to be terminated.

Why this answer

In Linux process states, 'Z' indicates a zombie process, which is a child process that has terminated but whose exit status has not yet been read by its parent process via the wait() system call. The correct action is to either kill the parent process (so that the zombie is reaped by init) or ensure the parent calls wait() to reap the child. Option D correctly identifies this.

Exam trap

The trap here is that candidates confuse zombie ('Z') with stopped ('T') or sleeping ('S') states, leading them to choose a recovery action like sending SIGCONT or simply waiting, rather than recognizing that a zombie requires the parent to reap it or be terminated.

How to eliminate wrong answers

Option A is wrong because a stopped process is indicated by state 'T' (or 't'), not 'Z', and kill -CONT is used to resume a stopped process, not handle a zombie. Option B is wrong because a daemon process typically runs in the background with state 'S' (sleeping) or 'R' (running), and restarting a daemon does not address a zombie; zombies are already dead and waiting to be reaped. Option C is wrong because a sleeping process is indicated by state 'S' or 'D' (uninterruptible sleep), not 'Z', and waiting will not resolve a zombie—the zombie persists until the parent reaps it.

10
Matchingmedium

Match each device file naming pattern to its device type.

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

Concepts
Matches

First SCSI/SATA disk

First NVMe SSD

First serial port (COM1)

First loopback device

First software RAID device

Why these pairings

Common Linux device naming conventions.

11
MCQmedium

A system administrator wants to configure log rotation to compress log files daily and keep 30 days of logs. Which of the following configurations achieves this goal?

A.Set the 'maxlogsize' parameter in /etc/rsyslog.conf
B.Add a configuration file in /etc/logrotate.d/ with the contents: '/var/log/mylog { daily rotate 30 compress }'
C.Create a cron job that runs 'gzip /var/log/mylog.*' daily
D.Edit /etc/logrotate.conf to set 'rotate 30 weekly'
AnswerB

This is the correct logrotate syntax for daily rotation, 30 rotations, and compression.

Why this answer

Option B is correct because logrotate is the standard Linux utility for log rotation, compression, and retention. The configuration directive 'daily rotate 30 compress' in a file under /etc/logrotate.d/ instructs logrotate to rotate logs daily, keep 30 rotated copies, and compress old logs with gzip. This directly meets the requirement of daily compression and 30-day retention.

Exam trap

The trap here is that candidates may confuse logrotate's 'rotate' count with a time-based retention period, or assume that rsyslog or a simple cron+gzip approach can handle rotation and retention, when in fact logrotate is the dedicated tool that manages both rotation and compression with precise control over file naming and retention limits.

How to eliminate wrong answers

Option A is wrong because /etc/rsyslog.conf is the configuration file for rsyslog, the system logging daemon, and it does not have a 'maxlogsize' parameter for log rotation; log rotation is handled by logrotate, not rsyslog. Option C is wrong because a cron job running 'gzip /var/log/mylog.*' would compress all matching files daily but would not perform rotation (renaming the active log) or enforce a retention limit of 30 days, leading to uncontrolled accumulation of compressed files. Option D is wrong because editing /etc/logrotate.conf to set 'rotate 30 weekly' would keep 30 weeks of logs, not 30 days, and the 'weekly' directive contradicts the requirement for daily rotation.

12
MCQeasy

Which hardware component uses a unique address to identify itself on the network at the data link layer?

A.IP address
B.MAC address
C.Hostname
D.Port number
AnswerB

MAC addresses are used for communication within a local network segment.

Why this answer

The MAC address (Media Access Control) is a unique 48-bit identifier burned into the network interface controller (NIC) by the manufacturer. It operates at Layer 2 (data link layer) of the OSI model, enabling devices on the same local network segment to communicate directly using protocols like Ethernet or Wi-Fi.

Exam trap

The trap here is that candidates often confuse the MAC address with the IP address because both are used for network identification, but the question specifically asks for the data link layer, where only the MAC address (not the IP address) operates.

How to eliminate wrong answers

Option A is wrong because an IP address operates at Layer 3 (network layer) and is used for logical addressing and routing across networks, not for hardware identification at the data link layer. Option C is wrong because a hostname is a human-readable alias resolved to an IP address via DNS or local hosts files, and it has no role in data link layer addressing. Option D is wrong because a port number is a Layer 4 (transport layer) identifier used by TCP or UDP to distinguish application services on a host, not for hardware-level network identification.

13
MCQmedium

An administrator wants systemd-journald logs to persist across reboots. What must be created?

A.The directory /run/log/journal
B.The file /etc/journald.conf
C.The directory /var/log/journal
D.The directory /var/spool/journal
AnswerC

If this directory exists and has correct ownership, journald stores logs persistently.

Why this answer

Option D is correct because creating /var/log/journal with appropriate permissions (owned by root:systemd-journal) makes logs persistent. Option A is the volatile location, Option B is a spool directory not used by journald, and Option C is not a standard path.

14
MCQmedium

A systems administrator needs to change the permissions of the file /home/user/script.sh so that the owner can read, write, and execute; the group can read and execute; and others have no access. Which command accomplishes this?

A.chmod 755 /home/user/script.sh
B.chmod 750 /home/user/script.sh
C.chmod 770 /home/user/script.sh
D.chmod 741 /home/user/script.sh
AnswerB

750 gives rwx for owner, r-x for group, and --- for others, matching the requirement.

Why this answer

Option B is correct because chmod 750 sets the permissions to rwxr-x---, which gives the owner read, write, and execute (7), the group read and execute (5), and others no access (0). This matches the requirement exactly.

Exam trap

The trap here is that candidates often confuse the octal values, especially mistaking 755 (which grants others read/execute) for the correct setting, or they forget that 750 denies others access while 755 does not.

How to eliminate wrong answers

Option A is wrong because chmod 755 sets permissions to rwxr-xr-x, which gives others read and execute access, violating the requirement that others have no access. Option C is wrong because chmod 770 sets permissions to rwxrwx---, which gives the group write access in addition to read and execute, exceeding the required group permissions. Option D is wrong because chmod 741 sets permissions to rwxr----x, which gives others only execute access (1) instead of no access, and the group has only read access (4) instead of read and execute.

15
MCQmedium

On a systemd-based system, which file is NOT used for system initialization?

A./etc/fstab
B./etc/systemd/system/default.target
C./etc/inittab
D./lib/systemd/system/sysinit.target
AnswerC

Inittab is for SysV init, not systemd.

Why this answer

The correct option is D: /etc/inittab is used by SysV init, not systemd. Option A (/etc/systemd/system/default.target) is a symlink to the default target. Option B (/lib/systemd/system/sysinit.target) is a systemd target used early in boot.

Option C (/etc/fstab) is used by systemd to mount filesystems.

16
MCQmedium

An Ubuntu 20.04 server needs a static IP address. The administrator has created a netplan YAML file at /etc/netplan/01-netcfg.yaml. What is the next step to apply the configuration?

A.netplan apply
B.ifconfig eth0 down; ifconfig eth0 up
C.service network-manager restart
D.systemctl restart networking
AnswerA

netplan apply parses YAML and configures network interfaces accordingly.

Why this answer

The netplan apply command reads the YAML configuration and applies it to the system, typically by configuring systemd-networkd. Restarting the networking service is for legacy systems. ifconfig commands are deprecated. NetworkManager is usually not used on servers.

17
Multi-Selecteasy

Which THREE of the following are correct features of the 'grep' command? (Choose three.)

Select 3 answers
A.-i makes the search case-insensitive
B.-v inverts the match
C.-c counts matching lines
D.-l prints line numbers of matches
E.-r enables regular expression matching
AnswersA, B, C

Correct: --ignore-case.

Why this answer

Option A is correct because the `-i` flag in `grep` performs case-insensitive matching, so patterns like 'error' will match 'Error', 'ERROR', etc. This is a common requirement when searching log files where case may vary.

Exam trap

The trap here is that candidates confuse `-l` (list filenames) with `-n` (show line numbers) and assume `-r` enables regex, when in fact `-r` is for recursive directory traversal and regex is the default behavior.

18
MCQhard

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

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

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

Why this answer

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

19
MCQhard

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

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

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

Why this answer

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

Exam trap

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

How to eliminate wrong answers

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

20
MCQhard

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

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

This identifies the exact package name in the repository.

Why this answer

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

Exam trap

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

How to eliminate wrong answers

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

21
MCQhard

After a system upgrade, the server fails to boot with the error: 'ERROR: Failed to mount the real root device.' The root filesystem is on an LVM logical volume. Which recovery step is most appropriate?

A.Boot from a live CD, chroot, and run 'update-initramfs -u -k all' to regenerate the initramfs with lvm2 support
B.Run 'lvchange -ay' to activate all LVs
C.Reinstall GRUB to the MBR
D.Use 'fsck' on the root LV
AnswerA

This rebuilds the initramfs including necessary LVM modules.

Why this answer

Option A (reinstall GRUB) does not address missing LVM modules. Option B (regenerate initramfs with lvm2 hook) ensures the initramfs contains LVM tools and modules. Option C (check LVM metadata) is a later step.

Option D (use fsck) may corrupt LVM if run on an LV. Thus B is correct.

22
MCQmedium

Refer to the exhibit. Which filesystem will be checked last during system boot by fsck?

A./dev/sda3
B./dev/sda2
C./dev/sda1
D./dev/sdb1
AnswerA

Pass 2, checked after pass 1 filesystems and before any higher pass numbers.

Why this answer

The /etc/fstab file defines the order in which filesystems are checked by fsck during boot, based on the sixth field (pass number). A pass number of 1 is checked first (typically the root filesystem), 2 is checked next (other filesystems), and 0 means no check. In the exhibit, /dev/sda3 has a pass number of 2, but since it is listed last among the entries with pass number 2, it will be checked after all other pass-2 filesystems, making it the last one checked overall.

Exam trap

The trap here is that candidates assume the pass number alone determines the order, ignoring that filesystems with the same pass number are checked sequentially based on their listing order in /etc/fstab.

How to eliminate wrong answers

Option B is wrong because /dev/sda2 has a pass number of 1, which is checked first during boot. Option C is wrong because /dev/sda1 has a pass number of 2 but appears earlier in /etc/fstab than /dev/sda3, so it is checked before /dev/sda3. Option D is wrong because /dev/sdb1 has a pass number of 0, meaning it is never checked by fsck during boot.

23
MCQeasy

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

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

Standard format for binary package repository.

Why this answer

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

24
Multi-Selectmedium

Which TWO commands can be used to display the current runlevel of a system?

Select 2 answers
A.telinit q
B.systemctl get-default
C.init 3
D.runlevel
E.who -r
AnswersD, E

Displays previous and current runlevel.

Why this answer

The `runlevel` command displays the previous and current runlevel of a SysV init system. The `who -r` command also shows the current runlevel along with the process ID of the init daemon. Both are standard tools for querying runlevel information on systems using SysV init.

Exam trap

The trap here is that candidates may confuse commands that change the runlevel (like `init 3`) with commands that display it, or assume `systemctl get-default` shows the current runlevel when it actually shows the default target for the next boot.

25
MCQhard

A sysadmin wants to ensure a specific kernel module is automatically loaded at boot. Which method is considered best practice?

A.Use systemd-modules-load.service
B.All of the above are valid methods
C.Add module name to /etc/modules
D.Add a line to /etc/modprobe.d/
AnswerB

All three are valid and best practices for loading modules at boot.

Why this answer

Correct: D. All three methods (adding a line to /etc/modprobe.d/, using systemd-modules-load.service, or adding the module name to /etc/modules) are valid ways to load a module at boot. Options A, B, C are each correct individually, but D encompasses all.

26
MCQeasy

A system administrator is troubleshooting a Linux server that fails to boot. The server has a software RAID 1 configuration using mdadm, with the root filesystem located on /dev/md0. During boot, the system halts with the following error: 'VFS: Unable to mount root fs on unknown-block(0,0)'. The admin verifies that the BIOS recognizes all disks and that the RAID array was properly assembled prior to the last shutdown. The system was working after a recent kernel update, but now fails. Which of the following actions is the most likely solution?

A.Use a live CD to run fsck on /dev/md0.
B.Rebuild the initramfs to include the mdadm module and the RAID metadata.
C.Check the /etc/fstab file for incorrect root device.
D.Reinstall the bootloader on the MBR.
AnswerB

Rebuilding the initramfs adds the necessary RAID support, allowing the kernel to assemble and mount /dev/md0.

Why this answer

Option D is correct because the error indicates the kernel cannot find the root filesystem device. After a kernel update, the initramfs may not contain the necessary mdadm modules and RAID metadata support. Rebuilding the initramfs with mdadm support (e.g., using mkinitramfs or dracut) includes the required modules and fixes the boot issue.

Option A is incorrect because the bootloader already loads the kernel; the problem occurs after that. Option B is incorrect because /etc/fstab is read after the root filesystem is mounted. Option C is incorrect because /dev/md0 is not available at the point of the error, so fsck cannot be run.

27
MCQhard

A company manages a cluster of 50 web servers running Ubuntu 20.04. The servers are configured to synchronize time with an internal NTP server at 10.0.0.100 using the default ntpd. The NTP server itself syncs with external stratum 2 servers. Recently, the security team implemented a restrictive iptables firewall on all servers, allowing only essential services. Several servers in the 10.0.1.0/24 network now report time drift and ntpq -p shows all peers with '?' status. A network engineer runs tcpdump on one affected server and sees no NTP replies from 10.0.0.100. The NTP server's firewall is configured to allow inbound NTP from 10.0.0.0/24 only. The engineer also notes that the server's /etc/ntp.conf contains the line 'restrict 10.0.0.100' (which is incorrect) and that ntpq -crv shows 'sync target not reachable'. Which single action will most directly resolve the synchronization issue for the affected servers?

A.Add an iptables rule on the affected server to accept outbound UDP packets to 10.0.0.100 port 123.
B.Remove the line 'restrict 10.0.0.100' from /etc/ntp.conf.
C.Modify the NTP server's firewall to allow inbound NTP from 10.0.1.0/24.
D.Add a static route on the affected server for 10.0.0.100 via a different gateway.
AnswerA

Correct: The client's firewall is dropping outbound NTP packets; allowing them enables the client to reach the server and receive time synchronization.

Why this answer

The problem is that the NTP client's firewall on the affected servers (10.0.1.0/24) is blocking outbound NTP traffic, and the server's firewall is correctly blocking inbound from non-10.0.0.0/24. The incorrect 'restrict 10.0.0.100' line in ntp.conf is irrelevant because it only restricts the role of that IP (as a client) and does not block traffic. Adding an ACCEPT rule for outbound UDP 123 to the NTP server on the client's iptables will allow the client to send requests and receive replies.

Changing the NTP server's firewall to allow 10.0.1.0/24 is a longer-term fix but not a direct action on the affected server. Modifying ntp.conf to remove the restrict line won't help with the firewall block. Adding a static route is irrelevant.

28
MCQmedium

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

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

Queries the package that owns the file.

Why this answer

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

29
MCQhard

Refer to the exhibit. A user tries to execute a script on a mounted filesystem but gets a permission denied error. The script has execute permissions. What is the most likely cause?

A.The script is not executable for the user.
B.The user does not have read permission on the script.
C.The filesystem is mounted with the 'noexec' option.
D.The filesystem is full.
AnswerC

The 'noexec' mount option disables execution of binaries/scripts on that filesystem.

Why this answer

The mount options include 'noexec', which prevents execution of binaries or scripts on that filesystem regardless of file permissions.

30
MCQmedium

Refer to the exhibit. An administrator wants to add a new partition that uses the remaining space on /dev/sda (total 40GB). What is the next free sector for the start of the new partition?

A.83886080
B.83886079
C.83886078
D.0
AnswerA

The next free sector after the last used sector.

Why this answer

The correct next free sector is 83886080 because the existing partition(s) on /dev/sda end at sector 83886079, and the next sector after that is 83886080. Since the disk has a total of 40 GB (which is 40 × 1024 × 1024 × 1024 / 512 = 83886080 sectors), sector 83886080 is also the last sector on the disk, meaning the new partition would start at the very end of the available space. This aligns with the standard practice of starting a partition at the next free sector after the last used one.

Exam trap

The trap here is that candidates often confuse the last sector number (83886079) with the next free sector, forgetting that sectors are zero-indexed and the next free sector is one greater than the last used sector, which in this case equals the total sector count and indicates no space remains.

How to eliminate wrong answers

Option B (83886079) is wrong because that is the last sector of the existing partition, not the next free sector; starting a partition there would overlap with the existing data. Option C (83886078) is wrong because it is two sectors before the end of the existing partition, causing an even larger overlap. Option D (0) is wrong because sector 0 is the Master Boot Record (MBR) and is already occupied by the partition table and boot code; it cannot be used as the start of a new partition.

31
Matchingmedium

Match each networking tool to its primary use.

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

Concepts
Matches

Test network connectivity to a host

Display network connections, routing tables, etc.

Capture and analyze network packets

Query DNS for domain name or IP

Configure network interfaces and routing

Why these pairings

Common network troubleshooting and configuration tools.

32
Multi-Selectmedium

On a modern Linux system using systemd-networkd for interface management and systemd-resolved for DNS, which THREE files are typically involved in network configuration and DNS resolution?

Select 3 answers
A./etc/systemd/network/10-static.network
B./etc/network/interfaces
C./etc/resolv.conf
D./etc/hosts
E./etc/sysconfig/network-scripts/ifcfg-eth0
AnswersA, C, D

systemd-networkd uses .network files in this directory.

Why this answer

/etc/systemd/network/ files define network interfaces. /etc/resolv.conf is a symlink managed by systemd-resolved and contains DNS server addresses. /etc/hosts provides local hostname resolution. /etc/network/interfaces is used by ifupdown (Debian legacy). /etc/sysconfig/network-scripts/ is used by Red Hat legacy ifcfg files.

33
MCQmedium

A Linux administrator is troubleshooting a server that fails to boot with the error 'Give root password for maintenance (or press Control-D to continue)'. The root filesystem is on /dev/sda2, formatted as ext4. The administrator suspects a filesystem inconsistency. The server is in a remote data center and the administrator has console access via IPMI. Which of the following is the safest procedure to repair the filesystem?

A.At the maintenance prompt, run 'mount -o remount,ro /dev/sda2 /' then 'fsck -f /dev/sda2' and then 'reboot'.
B.At the maintenance prompt, run 'fsck /dev/sda2' and answer yes to all prompts.
C.At the maintenance prompt, run 'fsck -y /dev/sda2' to force repair.
D.At the maintenance prompt, run 'fsck -a /dev/sda2' to automatically repair.
AnswerA

Correct: remount read-only, then fsck, then reboot.

Why this answer

Option A is correct because it first remounts the root filesystem as read-only to prevent any writes during the repair, which is essential for a consistent fsck run on an ext4 filesystem. Then it uses 'fsck -f' to force a check even if the filesystem appears clean, followed by a reboot to exit maintenance mode. This is the safest procedure as it avoids the risk of the filesystem being mounted read-write during repair, which could cause further corruption.

Exam trap

The trap here is that candidates often choose 'fsck -y' or '-a' thinking they are the safest automated options, but they fail to recognize that these options can automatically apply destructive repairs (like truncating corrupt files) without administrator review, whereas the correct procedure ensures the filesystem is read-only and forces a check with the '-f' flag.

How to eliminate wrong answers

Option B is wrong because running 'fsck' without the '-f' flag may skip the check if the filesystem is marked clean, and answering 'yes' to all prompts interactively is not suitable for remote console access where automation is preferred. Option C is wrong because 'fsck -y' automatically answers 'yes' to all prompts, including potentially dangerous actions like discarding data or truncating files, which could lead to data loss without administrator oversight. Option D is wrong because 'fsck -a' is a legacy option for ext2/ext3 that attempts automatic repair but may not be fully supported on ext4 and can be less safe than '-f' with manual confirmation.

34
MCQeasy

Refer to the exhibit. The administrator wants to ensure that SSH service starts automatically after a system reboot. Based on the output, what is the current status of this setting?

A.The service is enabled and will start at boot.
B.The service is disabled and will not start at boot.
C.The service is static and cannot be enabled.
D.The service is not running.
AnswerA

'enabled' indicates it will start at boot.

Why this answer

The `systemctl is-enabled sshd` command returns 'enabled', which means the SSH service is configured to start automatically at boot. This is confirmed by the output in the exhibit, showing that the service is enabled and will start during system initialization.

Exam trap

The trap here is that candidates may confuse the 'enabled' status with the 'active' (running) status, or misinterpret 'static' as a valid state for this service, when the output clearly shows 'enabled'.

How to eliminate wrong answers

Option B is wrong because the output explicitly shows 'enabled', not 'disabled', so the service will start at boot. Option C is wrong because 'static' is a possible systemd unit state that means the unit cannot be manually enabled or disabled but can be started by other units; however, the output shows 'enabled', not 'static'. Option D is wrong because the question asks about the status of automatic start at boot, not whether the service is currently running; the `is-enabled` command does not indicate the current runtime state.

35
Multi-Selecteasy

Which TWO commands can be used to display the current routing table on a Linux system?

Select 2 answers
A.ss -r
B.route -n
C.iptables -L
D.ifconfig -r
E.ip route show
AnswersB, E

Correct: route -n displays the routing table in numeric format.

Why this answer

The 'route -n' and 'ip route show' commands both display the kernel routing table. 'ifconfig -r' is invalid (ifconfig does not have a -r option). 'netstat -r' also displays routing tables, but it is deprecated and not listed as an option (here we used it as a distractor). 'ss -r' does not show routing; it shows socket statistics. 'iptables -L' shows firewall rules.

36
MCQmedium

Refer to the exhibit. A user gets this error when running a script. What is the most likely cause?

A.The script is missing a shebang line.
B.The script has Windows-style line endings (CRLF).
C.The script does not have execute permission.
D.The script contains a syntax error in line 3.
AnswerB

The carriage return character (CR) is interpreted as a command, indicating CRLF line endings.

Why this answer

The error indicates that the shell encountered a carriage return character interpreted as a command, which happens when the script uses Windows line endings (CRLF). Options B, C, and D are less likely.

37
MCQeasy

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

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

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

Why this answer

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

Exam trap

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

How to eliminate wrong answers

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

38
MCQeasy

A system administrator notices that after updating the kernel, the system fails to boot. The administrator wants to boot the previous kernel. Which GRUB menu option should be selected?

A.Memory test
B.Advanced options for Ubuntu
C.Recovery mode
D.Boot from first hard disk
AnswerB

This option often lists previous kernel versions.

Why this answer

The correct option is A: 'Advanced options for Ubuntu' typically lists older kernels available for boot. Option B (Recovery mode) is for recovery, not selecting a different kernel. Option C (Memory test) is unrelated.

Option D (Boot from first hard disk) boots the default entry, not a specific kernel.

39
MCQmedium

A system fails to mount an XFS filesystem with the entry in /etc/fstab. The entry looks correct. Which fstab field might be missing or incorrect?

A.The device field
B.The options field
C.The mountpoint field
D.The filesystem type field
AnswerD

Correct: If the type is omitted or incorrect (e.g., ext4 instead of xfs), mount may fail.

Why this answer

The XFS filesystem requires the filesystem type field in /etc/fstab to be explicitly set to 'xfs'. If this field is missing or incorrect (e.g., left blank, set to 'auto', or mistyped as 'ext4'), the mount command will fail because it cannot determine the correct filesystem driver to use. Even if the device, mountpoint, and options appear correct, an incorrect or missing type field prevents the kernel from loading the XFS module and mounting the filesystem.

Exam trap

LPI often tests the misconception that the filesystem type field is optional or can be left as 'auto' for all filesystems, but for XFS (and other non-default filesystems), the type must be explicitly specified because auto-detection may fail or the required kernel module may not be loaded automatically.

How to eliminate wrong answers

Option A is wrong because the device field (e.g., /dev/sda1 or UUID=...) must be correct for the system to identify the block device; if it were missing or incorrect, the error would be about a missing device, not a filesystem type mismatch. Option B is wrong because the options field (e.g., defaults, noatime) controls mount behavior but does not affect the kernel's ability to identify the filesystem type; incorrect options would cause mount to succeed with different parameters or fail with a specific option error. Option C is wrong because the mountpoint field (e.g., /mnt/data) must exist and be correct; if missing or incorrect, the error would be 'mount point does not exist' or 'not a directory', not a filesystem type failure.

40
MCQhard

A kernel module fails to load with the error 'modprobe: FATAL: Module xyz not found in directory /lib/modules/$(uname -r)'. What is the most likely cause?

A.The module is blacklisted in /etc/modprobe.d/.
B.The kernel version has changed and modules need to be rebuilt.
C.The module has dependencies that are missing.
D.The module is not installed on the system.
AnswerB

After a kernel update, modules for the new kernel may not be present; they need to be rebuilt or reinstalled.

Why this answer

The error indicates that the module is not present for the currently running kernel version. This often happens after a kernel update without rebuilding the modules.

41
MCQmedium

Which command is used to compress a file with the highest compression ratio?

A.gzip -9
B.xz -9
C.bzip2 -9
D.compress
AnswerB

xz offers the highest compression ratio among these tools, especially with -9.

Why this answer

Option B is correct because `xz -9` uses the LZMA2 compression algorithm, which typically achieves a higher compression ratio than gzip (DEFLATE) or bzip2 (Burrows-Wheeler transform) at the cost of slower speed and higher memory usage. The `-9` flag sets the highest compression level, maximizing the ratio.

Exam trap

The trap here is that candidates often assume gzip or bzip2 with `-9` offers the highest compression ratio because they are more common, but xz is the correct answer due to its superior LZMA2 algorithm.

How to eliminate wrong answers

Option A is wrong because gzip uses the DEFLATE algorithm, which generally provides lower compression ratios than xz, especially at level 9. Option C is wrong because bzip2 uses the Burrows-Wheeler transform and Huffman coding, which can achieve good ratios but is typically outperformed by xz's LZMA2 in terms of compression ratio. Option D is wrong because `compress` uses the LZW algorithm, which is outdated and offers significantly lower compression ratios than modern tools like xz.

42
MCQeasy

Which FHS directory contains essential binaries needed for booting and repairing the system, even before /usr is mounted?

A./boot
B./usr/bin
C./sbin
D./bin
AnswerD

Contains essential binaries like ls, mount, etc.

Why this answer

Option D is correct because the /bin directory contains essential user binaries (e.g., ls, cp, mount, bash) required for booting, repairing, and single-user mode, even when /usr is not mounted. The Filesystem Hierarchy Standard (FHS) mandates that /bin must be available before /usr is mounted, ensuring critical commands are accessible during early boot stages or recovery scenarios.

Exam trap

The trap here is that candidates often confuse /sbin with /bin, assuming that system repair binaries are exclusively in /sbin, but the FHS explicitly designates /bin for essential user binaries required before /usr is mounted, while /sbin is for system administration tools that may also be needed but are not the primary answer for 'essential binaries' in this context.

How to eliminate wrong answers

Option A is wrong because /boot contains the kernel and bootloader files (e.g., vmlinuz, initramfs), not the essential user binaries needed for system repair after booting. Option B is wrong because /usr/bin holds non-essential user binaries that are typically mounted later in the boot process (often on a separate partition) and may not be available when /usr is unmounted. Option C is wrong because /sbin contains system administration binaries (e.g., fdisk, mkfs) intended for system maintenance, but the FHS specifies /bin as the directory for essential user binaries required for booting and repair; /sbin is also critical but the question specifically asks for 'essential binaries' that include user commands, not just system administration tools.

43
Drag & Dropmedium

Order the steps to recover a forgotten root password on a Linux system.

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

Steps
Order

Why this order

Recovery involves booting into a shell with root access, remounting read-write, and changing the password.

44
MCQhard

A script reads a CSV file where fields may contain commas within quoted strings. Which approach correctly parses such fields?

A.Using 'cut -d',' -f1,2 file'
B.Using 'while IFS= read -r line; do ... done < file' and parsing manually
C.Using 'while IFS=',' read -r f1 f2; do ... done < file'
D.Using awk or a dedicated tool like csvkit
AnswerD

awk can handle quoted fields with FPAT; csvkit is purpose-built.

Why this answer

Option C is correct because awk with FPAT or dedicated tools can handle quoted commas properly.

45
Multi-Selecteasy

Which THREE of the following are valid runlevels in a traditional SysV init system? (Choose three.)

Select 3 answers
A.9
B.6
C.7
D.1
E.0
AnswersB, D, E

Runlevel 6 is reboot.

Why this answer

Standard runlevels are 0 (halt), 1 (single-user), 2 (multi-user without NFS), 3 (full multi-user), 4 (unused), 5 (graphical), 6 (reboot). Options 7 and 9 are not standard runlevels.

46
MCQeasy

A cron job is configured to run a script every day at 2:30 AM. The sysadmin notices the job runs but produces no output. Which is the most likely reason?

A.The cron daemon is not running.
B.The script requires a terminal to run.
C.The MAILTO environment variable is not set, and the output is not redirected.
D.Cron automatically suppresses all output.
AnswerC

Cron emails output only if MAILTO is set; otherwise, output is lost.

Why this answer

Option C is correct because cron jobs run in a non-interactive, non-terminal environment. By default, cron captures any output (stdout/stderr) from the job and attempts to email it to the user. If the MAILTO variable is not set and the output is not redirected to a file or /dev/null, the output is simply discarded, resulting in no visible output.

The job still runs successfully, but the output is lost.

Exam trap

The trap here is that candidates often assume cron silently discards all output by default, when in fact cron attempts to mail it, and the 'no output' symptom is due to the output being sent to an unmonitored mailbox or not redirected.

How to eliminate wrong answers

Option A is wrong because if the cron daemon were not running, the job would not run at all, but the question states the job runs. Option B is wrong because cron jobs do not require a terminal; they run in a minimal environment without a controlling terminal, and scripts that need a terminal would typically fail or hang, not produce no output. Option D is wrong because cron does not automatically suppress all output; it captures output and either mails it or discards it based on configuration.

47
MCQeasy

A developer asks the system administrator to configure a local web server for testing using Apache. The server should serve files from /var/www/test. Which directive must be set in the Apache configuration to set this document root?

A.Alias /test /var/www/test
B.ServerRoot /var/www/test
C.DocumentRoot /var/www/test
D.DirectoryIndex /var/www/test
AnswerC

DocumentRoot defines the root directory for HTTP requests.

Why this answer

Option C is correct: DocumentRoot directive sets the directory from which Apache serves files. Option A (ServerRoot) sets config directory. Option B (DirectoryIndex) sets default file.

Option D (Alias) maps URL paths to directories.

48
MCQhard

A production server running CentOS 7 has multiple SCSI disks (sda, sdb, sdc) configured in a RAID5 array managed by mdadm (md0). The root filesystem is on md0. After a power failure, the server boots but drops into a rescue shell with the error: 'md: md0: cannot run array. Not enough devices online.' The admin checks with 'cat /proc/mdstat' and sees that only sda and sdb are spares (marked as (S)), sdc is missing. Which sequence of commands should the admin use to attempt recovery and bring the system to a functional state? Options: A) First run 'mdadm --manage /dev/md0 --add /dev/sdc', then 'mdadm --run /dev/md0'. B) Boot from a live CD, then run 'mdadm --assemble --scan' to reassemble. C) Run 'mdadm --stop /dev/md0', then 'mdadm --assemble /dev/md0 /dev/sda /dev/sdb /dev/sdc'. D) Run 'mdadm --run /dev/md0' to force start the array in degraded mode, then add sdc with 'mdadm --add' after system is up.

A.Run 'mdadm --run /dev/md0' to force start the array in degraded mode, then add sdc with 'mdadm --add' after system is up
B.Boot from a live CD, then run 'mdadm --assemble --scan' to reassemble
C.Run 'mdadm --manage /dev/md0 --add /dev/sdc', then 'mdadm --run /dev/md0'
D.Run 'mdadm --stop /dev/md0', then 'mdadm --assemble /dev/md0 /dev/sda /dev/sdb /dev/sdc'
AnswerA

Starts the array with 2 devices (degraded), then adds the missing disk for rebuild.

Why this answer

Option D is correct: the array is not started because not enough devices are online. Forcing start (--run) activates the array in degraded mode (with two devices, RAID5 needs at least 3? Actually RAID5 with 3 devices can tolerate 1 missing disk, so 2 devices online is enough for degraded mode). Then adding the missing disk rebuilds.

Option A attempts add before array is running; --add only works on active arrays. Option B is possible but unnecessary if rescue shell has mdadm. Option C is correct if the disks are present but not assembled; however, the missing disk sdc is not present, so assembly will fail.

The best immediate step is to start the array in degraded mode. So D is correct.

49
MCQmedium

Refer to the exhibit. The root partition is at 80% usage. Which action would reduce usage the most?

A.Increase the size of /dev/sda1
B.Delete unused files in /tmp
C.Run 'du -sh /home' to find large files
D.Move some files from /home to /
AnswerB

If /tmp is on root, this directly frees space.

Why this answer

Option B is correct because the /tmp directory typically contains temporary files that can be safely deleted without affecting system operation. Since the root partition is at 80% usage, clearing out /tmp can reclaim significant space, especially on systems where applications or users have left large temporary files. The 'rm -rf /tmp/*' command or using tmpwatch/systemd-tmpfiles can free up space immediately.

Exam trap

The trap here is that candidates often choose option C (running 'du -sh /home') because they think identifying large files is the same as freeing space, but the question asks for an action that reduces usage, not just reports it.

How to eliminate wrong answers

Option A is wrong because increasing the size of /dev/sda1 (the root partition) does not reduce usage; it only expands the available capacity, leaving the same amount of data on the partition. Option C is wrong because running 'du -sh /home' only identifies large files in /home, which is typically a separate partition or mount point and does not directly reduce usage on the root partition. Option D is wrong because moving files from /home to / would increase usage on the root partition, making the problem worse.

50
MCQhard

A company runs a web server using Apache with multiple virtual hosts. The administrator needs to restrict access to a specific virtual host based on the client IP address. Which configuration directive should be placed inside the <VirtualHost> block to deny IP 192.168.1.100?

A.Require host 192.168.1.100
B.Require not ip 192.168.1.100
C.Deny from 192.168.1.100
D.Require valid-user
AnswerB

New syntax: Require not ip denies the specific IP.

Why this answer

Option B is correct because `Require not ip` is the Apache 2.4 syntax for access control. Option A is old syntax (Allow/Deny). Option C is for host-based.

Option D is for valid-user.

51
MCQeasy

An administrator adds the line 'DenyUsers john' to /etc/ssh/sshd_config and restarts the SSH service. What is the effect?

A.User john cannot log in via SSH.
B.User john can still log in but his commands are logged.
C.User john is denied all shell access, including local and console logins.
D.All users except john cannot log in via SSH.
AnswerA

This is the intended behavior of the DenyUsers directive.

Why this answer

The 'DenyUsers' directive in /etc/ssh/sshd_config explicitly blocks the specified user(s) from authenticating via SSH. When the SSH service is restarted, the configuration is reloaded, and user 'john' will be denied SSH login attempts at the authentication layer, before any shell or command execution occurs.

Exam trap

The trap here is that candidates often confuse 'DenyUsers' with broader access restrictions like PAM-based account denial or shell-level bans, but 'DenyUsers' is SSH-specific and only affects SSH logins, not console or other remote access methods.

How to eliminate wrong answers

Option B is wrong because 'DenyUsers' does not enable logging of commands; logging of SSH sessions is controlled by directives like 'LogLevel' or 'ForceCommand' with logging wrappers, not by 'DenyUsers'. Option C is wrong because 'DenyUsers' only affects SSH access, not local console logins or other non-SSH shell access; local authentication is handled by PAM or /etc/nologin, not by sshd_config. Option D is wrong because 'DenyUsers' denies only the specified user(s), not all users except that user; the inverse behavior would require 'AllowUsers' with all other users listed.

52
Multi-Selectmedium

Which TWO commands can be used to display information about the CPU(s) in a Linux system? (Choose two.)

Select 2 answers
A.uname -m
B.lsusb
C.cpufreq-info
D.cat /proc/cpuinfo
E.lscpu
AnswersD, E

cat /proc/cpuinfo shows detailed per-CPU information.

Why this answer

lscpu and cat /proc/cpuinfo both provide comprehensive CPU information. lsusb shows USB devices, cpufreq-info shows CPU frequency scaling, and uname -m shows machine hardware architecture.

53
MCQeasy

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

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

Removes package but preserves configuration files.

Why this answer

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

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

54
MCQhard

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

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

Keeps both versions, application uses old one via RPATH.

Why this answer

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

Option D requires source modification, which is not allowed.

55
MCQhard

Refer to the exhibit. An admin attempts to execute a shell script located in /tmp but gets 'Permission denied'. Which mount option is most likely causing this?

A.relatime
B.noexec
C.nodev
D.nosuid
AnswerB

Prevents execution of any files on the filesystem.

Why this answer

The 'noexec' mount option prevents execution of any binary or script directly from the filesystem, regardless of file permissions. Since the script is in /tmp and the admin gets 'Permission denied' despite correct execute bits, the /tmp partition is likely mounted with noexec, which is a common security hardening practice.

Exam trap

The trap here is that candidates assume 'Permission denied' always means missing execute bits (chmod +x), when in fact the noexec mount option silently blocks execution even with correct permissions.

How to eliminate wrong answers

Option A (relatime) is wrong because it only controls how access timestamps are updated on the filesystem, not execution permissions. Option C (nodev) is wrong because it prevents block or character special devices from being interpreted, not script execution. Option D (nosuid) is wrong because it ignores setuid/setgid bits on executables, but does not block execution itself.

56
MCQhard

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

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

yum update updates the specified package from the repository.

Why this answer

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

Exam trap

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

How to eliminate wrong answers

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

57
MCQhard

A server configured with UEFI firmware and GPT partitioning fails to boot after a GRUB package update. The administrator suspects the bootloader is not correctly installed. Which command should be used to reinstall GRUB to the EFI system partition?

A.grub2-install /dev/sda1
B.grub-mkconfig -o /boot/grub/grub.cfg
C.grub-install /dev/sda
D.grub-install --target=x86_64-efi --efi-directory=/boot/efi
AnswerD

Correctly installs GRUB for UEFI, targeting the EFI system partition mounted at /boot/efi.

Why this answer

For UEFI systems, grub-install must include the target and efi-directory. Option B specifies x86_64-efi target and the EFI directory /boot/efi, which is correct.

58
MCQhard

A script starts multiple background processes. An administrator wants to wait for all background jobs to complete before proceeding. Which command should be used?

A.jobs -l
B.wait %1
C.wait
D.sleep 5
AnswerC

Waits for all background jobs to complete.

Why this answer

Option C is correct. The wait command with no arguments waits for all background jobs to finish. Option A only waits for job 1.

Option B sleeps a fixed time. Option D lists jobs but does not wait.

59
Multi-Selecthard

When writing a Bash script, which two constructs can be used to safely iterate over a list of filenames that may contain spaces or special characters? (Choose TWO)

Select 2 answers
A.for file in *.txt; do ... done
B.find . -name '*.txt' -exec echo {} \;
C.for file in $(find . -name '*.txt'); do ... done
D.while IFS= read -r file; do ... done < <(find . -name '*.txt' -print0)
E.for file in "*.txt"; do ... done
AnswersB, D

Executes a command per file without shell word splitting.

Why this answer

Options C and D are correct. The while-read loop with NUL delimiter (C) safely handles any filename. The find -exec (D) processes each file separately without word splitting.

Options A and E are unsafe due to word splitting. Option B expands to a single literal asterisk.

60
MCQmedium

A Linux system using systemd fails to reach the default target after a recent change. The administrator wants to boot into a minimal environment to troubleshoot. Which kernel parameter should be added at the GRUB prompt?

A.single
B.systemd.unit=rescue.target
C.init=/bin/bash
D.systemd.unit=emergency.target
AnswerB

Rescue target provides a minimal environment with root read-write and basic services.

Why this answer

The correct option is C: systemd.unit=rescue.target boots into a minimal environment with basic services. Option A (systemd.unit=emergency.target) is even more minimal but does not mount filesystems read-write. Option B (init=/bin/bash) bypasses systemd entirely.

Option D (single) is a SysV init parameter, not systemd.

61
MCQeasy

Based on the lsblk output, which of the following is true?

A.The disk /dev/sdb has an extended partition.
B.The root filesystem is mounted from /dev/sda5.
C.The partition /dev/sda2 is an extended partition.
D.The disk /dev/sda has a primary partition sda5.
AnswerC

Size 1K and no mount point indicate extended partition.

Why this answer

Option C is correct because in the lsblk output, /dev/sda2 is listed as a partition of type 'Extended' (typically shown as 'Extended' or with a partition type ID of 5 in fdisk). Extended partitions cannot be directly formatted or mounted; they serve as containers for logical partitions (e.g., sda5). The lsblk output would show sda2 with no filesystem or mount point, and sda5 would appear as a child of sda2, confirming sda2 is extended.

Exam trap

The trap here is that candidates often confuse partition numbering with partition type, assuming that any partition numbered 5 or higher is automatically a primary partition, when in fact on MBR disks, partitions 5+ are always logical partitions inside an extended partition.

How to eliminate wrong answers

Option A is wrong because the lsblk output does not show /dev/sdb having an extended partition; /dev/sdb would need a partition listed as 'Extended' or with logical partitions nested under it, which is not indicated. Option B is wrong because the root filesystem is typically mounted from a primary or logical partition with a filesystem (e.g., ext4), and lsblk would show a mount point of '/' for that partition; if /dev/sda5 is a logical partition inside an extended partition, it could be root, but the question states 'based on the lsblk output' and without seeing the actual output, the statement is not universally true—it depends on the specific output. Option D is wrong because /dev/sda5, if it exists, is a logical partition (numbered 5 or higher) inside an extended partition, not a primary partition; primary partitions on MBR disks are numbered 1-4.

62
MCQhard

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

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

This option replaces files from other packages.

Why this answer

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

Exam trap

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

How to eliminate wrong answers

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

63
MCQmedium

A Linux system administrator is tasked with setting up a new server that will host multiple virtual machines using KVM. The server has 64 GB of RAM and two physical CPUs, each with 8 cores (16 threads). The administrator needs to allocate resources efficiently. The VMs will have varying workloads. The administrator wants to ensure that the host system has enough resources for itself and that VMs can use all available CPU cores. Which approach should the administrator take to configure CPU allocation for the host and VMs?

A.Use QEMU emulation instead of KVM to reduce CPU overhead.
B.Pin all physical CPU cores to the VMs using virsh vcpupin, and leave no cores for the host.
C.Use CPU pinning to reserve two physical cores for the host and distribute the remaining cores among VMs using host-passthrough mode.
D.Overcommit CPU resources by assigning 32 vCPUs to each VM, relying on the hypervisor to schedule.
AnswerC

This ensures host responsiveness and allows VMs to use all available CPU features.

Why this answer

Option C is correct because it reserves two physical cores for the host system to ensure its stability and performance, while distributing the remaining cores among VMs using CPU pinning and host-passthrough mode. This approach allows VMs to access the full CPU feature set and all available cores efficiently, balancing host overhead with VM resource needs in a KVM environment.

Exam trap

The trap here is that candidates may assume overcommitting CPU resources is always safe (Option D) or that QEMU emulation is a performance improvement (Option A), when in fact KVM's hardware acceleration and proper pinning are critical for efficient virtualization.

How to eliminate wrong answers

Option A is wrong because QEMU emulation adds significant CPU overhead compared to KVM's hardware-assisted virtualization, which would degrade performance rather than reduce it. Option B is wrong because pinning all physical cores to VMs leaves no CPU resources for the host, causing the host to starve and potentially crash or become unresponsive. Option D is wrong because overcommitting CPU resources by assigning 32 vCPUs per VM (exceeding the total 32 threads) can lead to severe contention and performance degradation, as the hypervisor cannot efficiently schedule such an extreme overcommitment without proper resource limits.

64
MCQmedium

A system administrator wants to monitor a log file in real-time for lines containing 'ERROR' and write them to a separate file. Which command combination is most appropriate?

A.less logfile
B.tail -f logfile | grep 'ERROR' > error.log
C.vi logfile
D.cat logfile | grep 'ERROR' > error.log
AnswerB

tail -f provides real-time output, grep filters.

Why this answer

Option A is correct: tail -f follows the file and grep filters lines. Option B uses cat which does not monitor live. Option C is a pager.

Option D is a text editor.

65
Multi-Selecteasy

Which two commands can be used to display the amount of free and used memory in the system?

Select 2 answers
A.free
B.uptime
C.ps
D.top
E.vmstat
AnswersA, D

Displays amount of free and used memory in the system.

Why this answer

The `free` command displays the total amount of free and used physical memory and swap space in the system, along with buffers and cache. The `top` command provides a real-time, dynamic view of running processes and includes a summary of memory usage (both physical and swap) at the top of its output. Both commands are standard Linux utilities for monitoring memory consumption.

Exam trap

LPI often tests the distinction between commands that show system-wide memory summary (`free`, `top`) versus those that show per-process memory usage (`ps`) or system load/uptime (`uptime`), leading candidates to mistakenly select `ps` because it shows a %MEM column.

66
MCQmedium

Refer to the exhibit. The system has two network interfaces: eth0 and eth1. Which interface will be used to reach a host at IP address 10.10.10.10?

A.eth1 via gateway 10.0.0.1.
B.eth0 via gateway 192.168.1.1.
C.eth0 via the default gateway.
D.eth0 directly.
AnswerA

10.10.10.10 falls within 10.0.0.0/8.

Why this answer

The routing table determines that the destination IP 10.10.10.10 is not within any directly connected subnet (eth0: 192.168.1.0/24, eth1: 10.0.0.0/24). The most specific matching route is the static route to 10.0.0.0/8 via gateway 10.0.0.1 on eth1, which covers the 10.10.10.10 address. Therefore, eth1 is used to reach the host.

Exam trap

The trap here is that candidates often assume the default gateway is always used for non-local traffic, forgetting that a more specific static route (like 10.0.0.0/8) takes precedence over the default route.

How to eliminate wrong answers

Option B is wrong because the route via gateway 192.168.1.1 on eth0 is for the 192.168.1.0/24 subnet, which does not include 10.10.10.10. Option C is wrong because the default gateway (0.0.0.0/0) is only used when no more specific route matches; here, the 10.0.0.0/8 route is more specific and takes precedence. Option D is wrong because 10.10.10.10 is not on the directly connected subnet of eth0 (192.168.1.0/24), so it cannot be reached directly without a gateway.

67
MCQmedium

A Linux administrator is responsible for a server that runs a critical database application. The server uses SysV init and the current runlevel is 3. The administrator needs to schedule a maintenance window for next Sunday at 2:00 AM to apply security patches that require a reboot. The administrator wants to ensure that after the reboot, the system returns to runlevel 3 and the database service (db_service) starts automatically. The administrator also wants to log the maintenance actions to /var/log/maintenance.log. Which of the following is the BEST approach to accomplish these tasks?

A.Edit /etc/rc.d/rc.local to start db_service and set runlevel via 'init 3' in the script. Then use 'at 02:00 shutdown -r now' to schedule reboot and redirect output to /var/log/maintenance.log.
B.Edit /etc/inittab to change the initdefault line to 'id:3:initdefault:' and create an init script for db_service with appropriate symlinks in /etc/rc.d/rc3.d/. Schedule the reboot using 'shutdown -r 02:00' and configure syslog to capture messages to /var/log/maintenance.log.
C.Use 'systemctl set-default runlevel3.target' and 'systemctl enable db_service' then schedule reboot with 'shutdown -r 02:00' and log with 'logger' to /var/log/maintenance.log.
D.Use 'telinit 3' and 'service db_service start' then run 'reboot' at 2:00 AM. Log actions by appending to /var/log/maintenance.log manually.
AnswerB

This correctly sets default runlevel, ensures service starts, schedules reboot, and logs actions via syslog.

Why this answer

Option B is correct because it properly configures SysV init by setting the default runlevel to 3 in /etc/inittab and ensures the database service starts automatically via init scripts with symlinks in /etc/rc.d/rc3.d/. Scheduling the reboot with 'shutdown -r 02:00' (which uses 24-hour format) and configuring syslog to capture messages to /var/log/maintenance.log provides reliable logging without manual intervention.

Exam trap

The trap here is that candidates may confuse SysV init commands with systemd commands (like systemctl) or assume that manually running init scripts or using rc.local is sufficient for persistent service management, when in fact proper init script symlinks and inittab configuration are required for SysV.

How to eliminate wrong answers

Option A is wrong because editing /etc/rc.d/rc.local to start db_service and run 'init 3' is not the standard SysV method for persistent runlevel or service management; rc.local runs after init scripts and may not execute on all reboots, and redirecting output with '>' in an 'at' job does not capture all boot messages. Option C is wrong because it uses systemctl commands (systemctl set-default, systemctl enable) which are for systemd systems, not SysV init; the server uses SysV init, so these commands are invalid. Option D is wrong because 'telinit 3' and 'service db_service start' only affect the current session and do not persist after reboot; manually appending to the log is error-prone and does not capture system boot messages.

68
Multi-Selectmedium

Which THREE of the following commands can be used to display information about block devices?

Select 3 answers
A.lsblk
B.free
C.fdisk -l
D.blkid
E.ip link
AnswersA, C, D

Lists block devices.

Why this answer

A is correct because `lsblk` lists all block devices (e.g., hard drives, SSDs, partitions) by reading the sysfs filesystem and the udev database, displaying their names, sizes, and mount points. It is the primary command for viewing block device topology.

Exam trap

The trap here is that candidates may confuse `free` (memory) or `ip link` (network) with block device commands, or forget that `fdisk -l` and `blkid` also display block device information, not just `lsblk`.

69
Multi-Selecthard

Which TWO utilities can be used to check and repair an XFS filesystem?

Select 2 answers
A.e2fsck
B.fsck
C.xfs_repair
D.xfs_check
E.btrfs check
AnswersC, D

xfs_repair is the primary tool for checking and repairing XFS filesystems.

Why this answer

C is correct because `xfs_repair` is the primary utility for checking and repairing XFS filesystems, designed to handle metadata corruption and ensure consistency. It is the recommended tool for XFS, similar to how `fsck` works for other filesystems but with XFS-specific optimizations.

Exam trap

The trap here is that candidates may confuse `xfs_check` as a repair tool when it is actually read-only, or mistakenly think `fsck` is a direct XFS repair utility rather than a wrapper that delegates to `xfs_repair`.

70
MCQmedium

Based on the exhibit, what is the most likely cause of the SSH service failure?

A.The sshd service is disabled.
B.The firewall is blocking port 22.
C.Another service is already listening on port 22.
D.The SSH configuration file has a syntax error.
AnswerC

Address already in use error.

Why this answer

Option A is correct. The error 'Address already in use' indicates port 22 is already occupied by another process. Option B is wrong because the process exited successfully but was killed due to start limit.

Option C is wrong because there's no firewall mention. Option D is wrong because the service is enabled.

71
MCQmedium

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

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

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

Why this answer

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

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

72
Multi-Selecteasy

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

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

Lists installed packages matching the pattern.

Why this answer

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

73
Multi-Selecthard

Which THREE of the following are true regarding the use of systemd-networkd for network configuration? (Choose three.)

Select 3 answers
A.It can assign static IP addresses using .network files.
B.It can be used to configure network bridges.
C.It supports DHCP for dynamic IP assignment.
D.Configuration files are stored in /etc/network/.
E.It supports bonding of multiple interfaces.
AnswersA, B, C

Static IP via .network files.

Why this answer

Option A is correct because systemd-networkd uses .network files (e.g., /etc/systemd/network/10-static.network) to assign static IP addresses via the [Address] section. This allows precise control over IPv4/IPv6 addresses, subnet masks, and gateways without relying on DHCP.

Exam trap

The trap here is that candidates confuse the configuration directory /etc/systemd/network/ with the legacy /etc/network/ used by ifupdown, or assume systemd-networkd supports bonding natively when it actually requires additional kernel modules or external tools.

74
MCQeasy

Refer to the exhibit. An administrator notices that /proc is mounted with 'noexec'. What is the impact of this mount option?

A.Device files are not interpreted.
B.Setuid programs do not work.
C.No binaries can be executed directly from /proc.
D.The filesystem cannot be written to.
AnswerC

noexec prevents execution of binaries on the filesystem.

Why this answer

The 'noexec' mount option prevents the direct execution of any binary files located on the mounted filesystem. Since /proc is a virtual filesystem that contains runtime system information and process data, mounting it with 'noexec' means that no binaries can be executed directly from /proc. This is a security measure to prevent malicious code from being run from procfs, as /proc should never contain executable programs in normal operation.

Exam trap

The trap here is that candidates often confuse 'noexec' with 'nosuid' or 'nodev', thinking it affects setuid binaries or device files, when in fact 'noexec' strictly controls whether binary executables can be run directly from the filesystem.

How to eliminate wrong answers

Option A is wrong because device files are not interpreted by the 'noexec' option; device file handling is governed by the 'nodev' mount option, which prevents the interpretation of device files. Option B is wrong because setuid programs are affected by the 'nosuid' mount option, not 'noexec'; 'noexec' only prevents direct execution of binaries, while setuid behavior is controlled separately. Option D is wrong because the ability to write to a filesystem is controlled by the 'ro' (read-only) or 'rw' (read-write) mount options, not by 'noexec', which only affects execution permissions.

75
Multi-Selectmedium

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

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

Fixes broken dependencies.

Why this answer

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

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

Page 1 of 7

Page 2

All pages