Chapter 8. Removing RHEL 9 content

The following sections describe how to remove content in Red Hat Enterprise Linux 9:

8.1. Removing installed packages

The following procedure describes how to remove packages using yum.

Procedure

  • To remove a particular package and all unused dependent packages, use:

    # yum remove package-name

    Replace package-name with the name of the package.

    Note that the package is removed together with any other dependent packages.

  • To remove multiple packages and their unused dependencies simultaneously, use:

    # yum remove package-name-1 package-name-2

    Replace package-name-1 and package-name-2 with the names of the packages.

Note

yum is not able to remove a package without removing dependent packages.

8.2. Removing package groups

The following procedure describes how to remove a package either by the group name or the groupID.

Procedure

  • To remove a package group by the group name, use:

    # yum group remove group-name

    Replace group-name with the full name of the group.

  • To remove a package group by the groupID, use:

    # yum group remove groupID

    Replace groupID with the ID of the group.

8.3. Removing installed modular content

When removing installed modular content, you can remove packages from either a selected profile or the whole stream.

Important

YUM will try 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

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.

Prerequisites

  • The selected profile has been installed using the yum module install module-name:stream/profile command or as a default profile using the yum install module-name:stream command.
  • You understand modular dependency resolution.

Procedure

  1. Uninstall packages belonging to the selected profile:

    # yum module remove module-name:stream/profile

    Replace module-name, stream, and profile with the module, stream, and profile you wish to uninstall.

    Alternatively, uninstall packages from all installed profiles within a stream:

    # yum module remove module-name:stream

    These operations will not remove packages from the stream that do not belong to any of the profiles.

  2. Check the list of packages under Removing: and Removing unused dependencies: before you proceed with the removal transaction.

To remove all packages from a selected stream, follow instructions in Section 8.3.2 "Removing all packages from a module stream".

8.3.2. Removing all packages from a module stream

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.

Prerequisites

  • The module stream has been enabled and at least some packages from the stream have been installed.
  • You understand modular dependency resolution.

Procedure

  1. Remove all packages from a selected stream:

    # yum module remove --all module-name:stream

    Replace module-name and stream with the module and stream you wish to uninstall.

  2. Check the list of packages under Removing: and Removing unused dependencies: before you proceed with the removal transaction.
  3. Optionally, reset or disable the stream.

If you want to remove only packages from a selected profile, follow instructions in Section 8.3.1. "Removing packages from an installed profile".

8.4. Additional resources