Chapter 8. Removing RHEL 8 content
In the following sections, learn how to remove content in Red Hat Enterprise Linux 8 by using YUM.
8.1. Removing installed packages Copy linkLink copied to clipboard!
You can use YUM to remove a single package or multiple packages installed on your system. If any of the packages you choose to remove have unused dependencies, YUM uninstalls these dependencies as well.
Procedure
Remove particular packages:
yum remove <package_name_1> <package_name_2> ...
# yum remove <package_name_1> <package_name_2> ...
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2. Removing package groups Copy linkLink copied to clipboard!
Package groups bundle multiple packages. You can use package groups to remove all packages assigned to a group in a single step.
Procedure
Use one of the following methods to install a package group:
To remove a package group by a group name, enter one of the following commands::
yum group remove <group_name> yum remove @<group_name>
# yum group remove <group_name> # yum remove @<group_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To remove a package group by the groupID, enter:
yum group remove <group_ID>
# yum group remove <group_ID>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
8.3. Removing installed modular content Copy linkLink copied to clipboard!
When removing installed modular content, you can remove packages from either a selected profile or from the whole stream.
YUM tries to remove all packages with a name corresponding to the packages installed with a profile or a stream, including their dependent packages. Always check the list of packages to be removed before you proceed, especially if you have enabled custom repositories on your system.
8.3.1. Removing packages from an installed profile Copy linkLink copied to clipboard!
When you remove packages installed with a profile, all packages with a name corresponding to the packages installed by the profile are removed. This includes their dependencies, with the exception of packages required by a different profile.
To remove all packages from a selected stream, complete the steps in Removing all packages from a module stream.
Prerequisites
-
The selected profile is installed by using the
yum module install module_name:stream/profile
command or as a default profile by using theyum install module_name:stream
command.
Procedure
Uninstall packages that belong to the selected profile:
yum module remove <module_name>:<stream>/<profile>
# yum module remove <module_name>:<stream>/<profile>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to remove packages from the
devel
profile of thephp:7.3
module stream, enter:Copy to Clipboard Copied! Toggle word wrap Toggle overflow WarningCheck the list of packages under
Removing:
andRemoving unused dependencies:
before you proceed with the removal transaction. This transaction removes requested packages, unused dependencies, and dependent packages, which might result in the system failure.Alternatively, uninstall packages from all installed profiles within a stream:
yum module remove <module_name>:<stream>
# yum module remove <module_name>:<stream>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThese operations will not remove packages from the stream that do not belong to any of the profiles.
Verification
Verify that the correct profile was removed:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow All profiles except
devel
are currently installed ([i]
).
8.3.2. Removing all packages from a module stream Copy linkLink copied to clipboard!
When you remove packages installed with a module stream, all packages with a name corresponding to the packages installed by the stream are removed. This includes their dependencies, with the exception of packages required by other modules.
To remove only packages from a selected profile, complete the steps in Removing packages from an installed profile.
Prerequisites
- The module stream is enabled and at least some packages from the stream are installed.
Procedure
Remove all packages from a selected stream:
yum module remove --all <module_name>:<stream>
# yum module remove --all <module_name>:<stream>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to remove all packages from the
php:7.3
module stream, enter:Copy to Clipboard Copied! Toggle word wrap Toggle overflow WarningCheck the list of packages under
Removing:
andRemoving unused dependencies:
before you proceed with the removal transaction. This transaction removes requested packages, unused dependencies, and dependent packages, which might result in the system failure.Optional: Reset or disable the stream by entering one of the following commands:
yum module reset <module_name> yum module disable <module_name>
# yum module reset <module_name> # yum module disable <module_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that all packages from the selected module stream were removed:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
7.3
stream of thephp
module is currently enabled ([e]
) but no packages from this stream are installed ([i]
).
8.4. Specifying package details for removal Copy linkLink copied to clipboard!
You can specify package details for a precise package removal process. To do so, append the following suffixes to the yum remove
command to explicitly define how to parse an argument:
-
Use
-n
to specify the exact name of the package. -
Use
-na
to specify the exact package name and architecture. -
Use
-nevra
to specify the exact package name, epoch, version, release, and architecture.
Procedure
Depending on your scenario, use one of the following options to optimize the package removal process:
To remove a package by using its exact name, enter:
yum remove-n <package_name>
# yum remove-n <package_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To remove a package by using its exact name and architecture, enter:
yum remove-na <package_name>.<architecture>
# yum remove-na <package_name>.<architecture>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To remove a package by using its exact name, epoch, version, release, and architecture, enter:
yum remove-nevra <package_name>-<epoch>:<version>-<release>.<architecture>
# yum remove-nevra <package_name>-<epoch>:<version>-<release>.<architecture>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow