RHCSA Software Package Management Flashcards
6 cards from real RHCSA practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 RHCSA Software Package Management flashcards as text
A script is failing because it cannot find the command `/usr/sbin/semanage`. A system administrator needs to determine which package provides this file so it can be installed. Which of the following commands will accomplish this?
Answer: dnf whatprovides /usr/sbin/semanage
The `dnf whatprovides` (or its alias `dnf provides`) command is used to query repositories to find out which package owns a specific file or capability, even if the package is not currently installed. `dnf search` only searches package names and summaries. `rpm -qf` only works if the package providing the file is already installed. `dnf find-file` is not a valid dnf command.
A system administrator needs to install the `nginx` package specifically from the 'epel' repository, which is configured but currently disabled. Which command should be used to perform the installation in a single step?
Answer: dnf install nginx --enablerepo=epel
The `--enablerepo` option tells dnf to temporarily enable the specified repository for the current transaction. This is the standard method for installing a package from a repository that is configured but not enabled by default. The other options use incorrect syntax for this operation.
A system administrator recently ran several `dnf` updates and installations. To troubleshoot a new issue, they need to see a detailed list of what packages were installed, updated, or removed in the most recent transaction. Which command provides this specific information?
Answer: dnf history info last
`dnf history` by itself lists all transactions with their IDs. To see the specific details of a transaction, such as which packages were altered, you use `dnf history info `. The keyword `last` is a convenient alias for the most recent transaction ID.
After installing the `httpd` package, a system administrator wants to list all the files that were placed on the system as part of that specific package. Which of the following commands is used for this purpose?
Answer: rpm -ql httpd
The `rpm` command is the underlying package manager and is ideal for querying the local RPM database about installed packages. The `-q` flag is for query, and `-l` lists the files owned by the specified package. The other commands are either syntactically incorrect or perform different functions.
A system administrator is setting up a new server and needs to install all the packages required for a graphical administration interface. Which command is the most appropriate for installing the "Server with GUI" environment group?
Answer: dnf groupinstall "Server with GUI"
The `dnf groupinstall` command is used to install all the packages that are part of a predefined package group or environment. "Server with GUI" is a standard environment group in Red Hat Enterprise Linux and its derivatives. While `dnf install @'Server with GUI'` also works, `dnf groupinstall` is the explicit and traditional command for this action. The other options use incorrect dnf subcommands or syntax.
A system administrator has a third-party repository configured in `/etc/yum.repos.d/external.repo` with a repository ID of `external-repo`. To perform a system-wide update while temporarily preventing any packages from being installed or updated from this repository, which is the most effective command?
Answer: dnf update --disablerepo=external-repo
The `--disablerepo` flag is used to temporarily disable a specific repository for a single dnf transaction. This is the most direct and non-permanent way to exclude a repository for a specific command. Using `dnf config-manager` would permanently disable the repository until it is re-enabled. Removing the file is a destructive action. `--excluderepo` is not a valid dnf flag; the correct flag for excluding packages is `--exclude`.