LFCS · Question #707
Which command will list all the files installed from the RPM package file named, vorbis-tools- 1.1 .i386.rpm?
The correct answer is E. rpm-qlp vorbis-tools-1.1.1386.rpm. To list the files contained within an uninstalled RPM package file, the rpm command requires query (-q), list files (-l), and package file (-p) options.
Question
Options
- Arpm-qfvorbis-tools-1.1 .i386.rpm
- Brpm -F vorbis-tools-1.1 .i386.rpm
- Crpm -pf vorbis-tools-1.1 .i386.rpm
- Drpm -ql vorbis-tools-1.1.1386.rpm
- Erpm-qlp vorbis-tools-1.1.1386.rpm
How the community answered
(39 responses)- B5% (2)
- D3% (1)
- E92% (36)
Why each option
To list the files contained within an uninstalled RPM package file, the `rpm` command requires query (`-q`), list files (`-l`), and package file (`-p`) options.
`rpm -qf` is used to query which package *owns* a specific file, not to list files within a package file.
`rpm -F` (freshen) is used to update installed packages, not to list files within a package file.
`rpm -pf` is an invalid combination of options; `-p` is for package file, and `-f` is for querying files, but not in this structure to list contents.
`rpm -ql vorbis-tools-1.1.i386.rpm` would attempt to query an *installed* package named "vorbis-tools-1.1.i386.rpm", which is unlikely to be its actual installed name, and it lacks the `-p` option to specify it's a file on disk.
The `rpm -qlp vorbis-tools-1.1.i386.rpm` command uses `-q` for query, `-l` to list files, and `-p` to specify that the query should be performed on an uninstalled *package file* (as opposed to an installed package name). This combination correctly displays all files that would be installed by the specified RPM package file.
Concept tested: RPM package file content listing
Source: https://man7.org/linux/man-pages/man8/rpm.8.html
Topics
Community Discussion
No community discussion yet for this question.