Remove the installed package named example.
Specify the package name rather than an RPM archive path.
Which command is appropriate?
rpm -e PACKAGE erases an installed package from the RPM database and filesystem, subject to dependency checks.
Detailed explanation
rpm -r exampleIncorrect. -r is not the standard RPM erase option.
Incorrect. -r is not the standard RPM erase option.
rpm -d exampleIncorrect. -d is not the package-removal operation.
Incorrect. -d is not the package-removal operation.
rpm -e exampleCorrect. rpm -e example removes the installed package named example.
Correct. rpm -e example removes the installed package named example.
rpm -p exampleIncorrect. -p selects an RPM file for a query; it does not remove a package.
Incorrect. -p selects an RPM file for a query; it does not remove a package.
Try it yourself
An example you can run in a temporary verification environment.
rpm --help | grep -E -- '--erase|-e'Expected result
erase操作の説明。実際の削除は行わないKey points
- -e means erase
- Use a package name
- Check dependency errors
Notes
- Environment: RPM 4.19〜6.x公式仕様
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.