Question 250
Several compatible Java executables are installed; the default /usr/bin/java target must be selected by managed alternatives. Which mechanism fits?
- cargo build
- dpkg -S /usr/bin/ssh
- update-alternatives --config java
- dpkg -l
Explanation
Correct Answer
C:The alternatives system selects among registered implementations through managed symbolic links. The available command name varies by distribution family.
Incorrect Answers
A:Cargo manages Rust package dependencies and compilation using Cargo.toml and a lockfile; it will not provide switching an alternative implementation of a command under these conditions.
B:dpkg -S queries the installed package database to find packages that claim a particular path; using it would leave switching an alternative implementation of a command unresolved.
D:dpkg -l queries installed package statuses and version records in the local dpkg database; it does not deliver switching an alternative implementation of a command, which is decisive in this scenario.
Question 251
A third-party repository has been removed but package-manager metadata still references it. Which management task is most suitable?
- enabled=0 in the repository definition
- Unresolved package dependencies
- apt update
- Remove the repository configuration entry
Explanation
Correct Answer
D:Package managers consult configured repository definitions for updates. Deleting obsolete entries avoids failed metadata fetches and accidental use of untrusted sources.
Incorrect Answers
A:A disabled DNF repository is excluded from normal transactions until selected; the task involves removing a defunct package source definition, whereas this addresses another subsystem.
B:Low-level package operations can fail or leave required libraries unavailable if dependencies are not provided; its scope differs from removing a defunct package source definition, so it cannot meet the stated requirement.
C:apt update fetches current indexes from configured apt sources and refreshes the local package cache; that is not equivalent to removing a defunct package source definition.
Question 252
An engineer needs to determine which package owns /usr/bin/ssh on a Debian-family host. Which command queries the local package database?
- cargo build
- dpkg -S /usr/bin/ssh
- dnf upgrade openssh-server
- npm ci
- dpkg -l
Explanation
Correct Answer
B:dpkg -S queries the installed package database to find packages that claim a particular path. It does not search files available only in uninstalled repository packages.
Incorrect Answers
A:Cargo manages Rust package dependencies and compilation using Cargo.toml and a lockfile; that changes a different part of the system; the requested outcome is finding the installed Debian package owning a path.
C:dnf resolves RPM dependencies and updates the named package from enabled repositories; it will not provide finding the installed Debian package owning a path under these conditions.
D:npm ci installs dependencies according to a lockfile and refuses inconsistencies instead of rewriting it; using it would leave finding the installed Debian package owning a path unresolved.
E:dpkg -l queries installed package statuses and version records in the local dpkg database; the requirement is finding the installed Debian package owning a path, outside the effect of this choice.
Question 253
An Ubuntu administrator just added an approved package repository and now must refresh package metadata and install nginx with dependencies. Which TWO commands accomplish those separate steps? Choose TWO.
- enabled=0 in the repository definition
- Remove the repository configuration entry
- GPG signature checking for repository packages
- apt update
- apt install nginx
Explanation
Correct Answers
D:apt update fetches current indexes from configured apt sources and refreshes the local package cache. Existing installed package versions remain unchanged until a later transaction.
E:apt install nginx resolves dependencies and installs the named package from the available repository indexes. After adding a repository, apt update should refresh those indexes before an install relies on the new source.
Incorrect Answers
A:A disabled DNF repository is excluded from normal transactions until selected; it does not deliver refreshing the repository index and installing a package with dependencies, which is decisive in this scenario.
B:Package managers consult configured repository definitions for updates; the evidence calls for refreshing the repository index and installing a package with dependencies, not merely this separate operation.
C:RPM-family tools can verify trusted signatures on packages to help detect tampering; the task involves refreshing the repository index and installing a package with dependencies, whereas this addresses another subsystem.
Question 254
A host must serve HTTP traffic on port 80 using a conventional Linux web server. Which application is commonly appropriate?
- Isolate dependencies inside a container image
- Apache httpd
- Nginx web server
- Authoritative DNS server
Explanation
Correct Answer
C:Nginx can terminate HTTP requests and serve static content or reverse-proxy backends. Listening ports and firewall rules must be configured separately.
Incorrect Answers
A:A container image bundles application dependencies into a deployable filesystem; the administrator instead needs providing an HTTP web-serving daemon; this option serves a different purpose.
B:Apache HTTP Server provides HTTP service with modules and site configuration; it answers a neighboring question rather than providing an HTTP web-serving daemon.
D:An authoritative DNS service publishes zone records to querying resolvers; this does not achieve providing an HTTP web-serving daemon on the system described.
Question 255
A new version of a Python library should be installed into the activated project virtual environment. Which package installer fits?
- update-alternatives --config java
- npm ci
- rpm -V package_name
- python -m pip install requests
Explanation
Correct Answer
D:pip installs Python distributions into the interpreter environment invoked by python. Using a virtual environment avoids changing system-managed Python packages.
Incorrect Answers
A:The alternatives system selects among registered implementations through managed symbolic links; using it would leave installing a project-scoped Python dependency unresolved.
B:npm ci installs dependencies according to a lockfile and refuses inconsistencies instead of rewriting it; the requirement is installing a project-scoped Python dependency, outside the effect of this choice.
C:rpm -V compares installed package metadata such as file sizes, hashes and modes against recorded values; it does not deliver installing a project-scoped Python dependency, which is decisive in this scenario.
Question 256
Network clients require dynamic IP address leases from the server. Which service category is needed?
- Authoritative DNS server
- Nginx web server
- NTP synchronization service
- DHCP server
Explanation
Correct Answer
D:A DHCP service grants leases and associated network parameters to clients. DNS name resolution is a different function even though both may share infrastructure.
Incorrect Answers
A:An authoritative DNS service publishes zone records to querying resolvers; its scope differs from assigning network addresses dynamically, so it cannot meet the stated requirement.
B:Nginx can terminate HTTP requests and serve static content or reverse-proxy backends; that is not equivalent to assigning network addresses dynamically.
C:NTP clients such as chronyd discipline host clocks against reference sources; the administrator instead needs assigning network addresses dynamically; this option serves a different purpose.
Question 257
A Node.js project's declared dependencies must be installed from its lockfile reproducibly. Which command is designed for CI?
- npm ci
- dpkg -S /usr/bin/ssh
- update-alternatives --config java
- python -m pip install requests
Explanation
Correct Answer
A:npm ci installs dependencies according to a lockfile and refuses inconsistencies instead of rewriting it. It is particularly useful in repeatable pipeline builds.
Incorrect Answers
B:dpkg -S queries the installed package database to find packages that claim a particular path; it will not provide reproducibly installing Node dependencies from lock data under these conditions.
C:The alternatives system selects among registered implementations through managed symbolic links; using it would leave reproducibly installing Node dependencies from lock data unresolved.
D:pip installs Python distributions into the interpreter environment invoked by python; the requirement is reproducibly installing Node dependencies from lock data, outside the effect of this choice.
Question 258
Several services need to be grouped under a boot synchronization point without spawning a program directly. Which unit type serves this?
- .timer unit
- network-online.target
- .target unit
- Requires=database.service
- WantedBy=multi-user.target
Explanation
Correct Answer
C:A target groups and synchronizes systemd units to express boot states. It is not an executable process itself.
Incorrect Answers
A:A timer unit activates an associated service on its configured schedule; the evidence calls for representing a collection of systemd units, not merely this separate operation.
B:When supported by a wait-online provider, network-online.target can synchronize units after the network is deemed usable. network.target alone does not promise usable connectivity; the task involves representing a collection of systemd units, whereas this addresses another subsystem.
D:Requires adds a strong dependency on the named unit, with failure propagation under the applicable startup conditions; that is not equivalent to representing a collection of systemd units.
E:An install directive such as WantedBy defines the target's enablement symlink; the administrator instead needs representing a collection of systemd units; this option serves a different purpose.
Question 259
An admin needs to change the persistent hostname through a systemd-aware command. Which command is intended?
- hostnamectl set-hostname app01
- systemd-analyze time
- systemd-analyze blame
- timedatectl status
Explanation
Correct Answer
A:hostnamectl configures host naming through systemd-hostnamed on supported systems. It is distinct from making an authoritative DNS entry.
Incorrect Answers
B:systemd-analyze time reports time spent in firmware, loader, kernel and userspace where available; that changes a different part of the system; the requested outcome is setting the system hostname persistently.
C:systemd-analyze blame ranks unit activation durations; this does not achieve setting the system hostname persistently on the system described.
D:timedatectl reports local time, time zone and synchronization indicators under systemd; it will not provide setting the system hostname persistently under these conditions.
Question 260
An application unit already orders startup with After=database.service. Which additional directive pulls the database unit into the transaction and makes the application depend on successful database activation?
- .target unit
- ExecStart=/usr/local/bin/worker
- Requires=database.service
- data.mount
- .timer unit
- Wants=logger.service
Explanation
Correct Answer
C:Requires adds a strong dependency on the named unit, with failure propagation under the applicable startup conditions. Ordering may separately require After.
Incorrect Answers
A:A target groups and synchronizes systemd units to express boot states; the requirement is expressing a mandatory unit dependency, outside the effect of this choice.
B:ExecStart defines the command systemd launches for a service; it does not deliver expressing a mandatory unit dependency, which is decisive in this scenario.
D:systemd converts mount-point paths into unit names such as data.mount; the task involves expressing a mandatory unit dependency, whereas this addresses another subsystem.
E:A timer unit activates an associated service on its configured schedule; its scope differs from expressing a mandatory unit dependency, so it cannot meet the stated requirement.
F:Wants is a weaker activation dependency than Requires; that is not equivalent to expressing a mandatory unit dependency.