Check the Deleting packages with yum section in the HOW TO

There says:

In any event, the command syntax for package removal is:

   # yum remove package1 [package2 package3...]

As noted above, it removes package1 and all packages in the dependency tree that depend on package1, possibly irreversibly as far as configuration data is concerned.

As a quick way you can try:

yum remove package
yum install package

Also here is an interesting for. And the question can help you.

The one that keeps configs in a backup is rpm -e

What you can do is find out what is in a rpm using:

 rpm -ql packagename

or

rpm -qlp packagename if the package is not yet installed.

then, you can manually make the modifications you want.

Hope this helps!

Answer from AAlvz on Stack Exchange
๐ŸŒ
Red Hat
docs.redhat.com โ€บ en โ€บ documentation โ€บ red_hat_enterprise_linux โ€บ 6 โ€บ html โ€บ deployment_guide โ€บ sec-removing
8.2.5. Removing Packages | Deployment Guide | Red Hat Enterprise Linux | 6 | Red Hat Documentation
Similarly to package installation, Yum allows you to uninstall (remove in RPM and Yum terminology) both individual packages and a package group. To uninstall a particular package, as well as any packages that depend on it, run the following command as root:
Discussions

how to remove packages from yum list result? - Stack Overflow
probably a quick question for experts. on linux(Centso) I did something like $ yum list | grep cdh which returns a bunch of items(I was search to remove cloudera packages) I know that I can rem... More on stackoverflow.com
๐ŸŒ stackoverflow.com
with yum how can you remove a package but not remove its dependencies at the same time? - Unix & Linux Stack Exchange
Today if I do $ yum remove packageA I am greeted with: Removing: packageA noarch 3.5.1.b37-15 @yumFS 293 k Re... More on unix.stackexchange.com
๐ŸŒ unix.stackexchange.com
June 21, 2017
For yum/dnf - What is the difference/relation between `remove` and `erase`?
For yum/dnf - What is the difference/relation between remove and erase ? When is mandatory use one approach over the other? In many tutorials available in the web I found mostly for remove but almost nothing about erase - but the latter exists for some reason, right?. More on discussion.fedoraproject.org
๐ŸŒ discussion.fedoraproject.org
1
0
May 26, 2022
linux - Remove completely all packages I installed? - Unix & Linux Stack Exchange
I was using one Linux server with CentOS7 installed for testing and installing some tools. And now I don't remember how many packages I installed. I want to remove all that packages so my server ... More on unix.stackexchange.com
๐ŸŒ unix.stackexchange.com
May 11, 2016
๐ŸŒ
PhoenixNAP
phoenixnap.com โ€บ home โ€บ kb โ€บ sysadmin โ€บ how to uninstall or remove packages from centos
How to Uninstall or Remove Packages from CentOS
December 17, 2025 - 1. Open the yum.conf file with a text editor of your choice: ... Save and exit the file. In case you need to delete a package but are unsure of its exact file name, use the following command: ... The output will list all installed packages whose file names contain the specified phrase. As you can see in the image below, httpd appears in the following packages (and dependencies): Once you have the exact name of the package you want to uninstall, you can remove it from your CentOS system.
๐ŸŒ
Wikihow
wikihow.com โ€บ computers and electronics โ€บ software โ€บ install & uninstall software โ€บ how to uninstall yum packages: centos, fedora, red hat linux
How to Uninstall Yum Packages: CentOS, Fedora, Red Hat Linux
December 11, 2025 - Use yum autoremove packagename to uninstall a package and its dependencies. This command not only uninstalls the package, but also deletes any dependencies you'll no longer need once the package is removed.
Find elsewhere
๐ŸŒ
RedSwitches
redswitches.com โ€บ home โ€บ operating systems โ€บ how to uninstall or remove packages from centos
How To Yum Uninstall Or Yum Remove Packages From CentOS
September 10, 2025 - Yes, removing packages affects the system globally; therefore, root or sudo privileges are required to execute the yum remove package command. Q. Will yum remove package also deletes the dependencies of the package being removed? yum remove ...
๐ŸŒ
Fedora Discussion
discussion.fedoraproject.org โ€บ ask fedora
For yum/dnf - What is the difference/relation between `remove` and `erase`? - Fedora Discussion
May 26, 2022 - For yum/dnf - What is the difference/relation between remove and erase ? When is mandatory use one approach over the other? In many tutorials available in the web I found mostly for remove but almost nothing about erase - but the latter exists for some reason, right?.
๐ŸŒ
Seiden Group
seidengroup.com โ€บ home โ€บ be careful when using yum remove
Be Careful When Using Yum Remove - Seiden Group
November 15, 2022 - In addition to removing Python3, the command above would attempt to remove nodejs14 and other dependent packages. Yum knows that those packages could not function without Python3.
๐ŸŒ
Kernel Talks
kerneltalks.com โ€บ home โ€บ software & tools โ€บ package removal in linux (yum & apt)
Package removal in Linux (YUM & APT) - Kernel Talks
June 29, 2020 - Package removal also knows as an erasing package from the system. On YUM based system like Red Hat or CentOS, the package can be removed by supplying erase or remove argument to yum command along with package name.
๐ŸŒ
Hosting Ultra So
hostingultraso.com โ€บ help โ€บ centos โ€บ using-yum-remove-packages-centos
Using YUM to remove packages in CentOS
For example, if we wanted to remove a package called wget, we would begin by issuing the remove command like so: yum remove wget. YUM, in turn, would then locate the package details from your system and obtain a transaction summary that may include any necessary dependencies that are no longer ...
๐ŸŒ
Quora
quora.com โ€บ How-do-we-uninstall-an-rpm-file-installed-in-Red-Hat-Enterprise-Linux-RHEL
How do we uninstall an rpm file installed in Red Hat Enterprise Linux (RHEL)? - Quora
Use the yum or dnf command (depending on RHEL version) with remove or erase, eg: yum remove <Some Package> yum erase <Some Package> The remove and erase sub-commands are equivalent, see the man page for yum or dnf.
๐ŸŒ
LinuxSimply
linuxsimply.com โ€บ home โ€บ learn linux basics โ€บ package management in linux โ€บ uninstall packages in linux โ€บ how to uninstall a yum package [2 user-friendly cases]
How to Uninstall a YUM Package [2 User-Friendly Cases] - LinuxSimply
March 31, 2024 - In Red-hat-based Linux systems, ... that those are no longer required and occupy your storage space. In that case, uninstalling that undesired software is crucial. You can use the yum command to do this task....
๐ŸŒ
Linux Tips
linux-tips.us โ€บ home โ€บ how to: remove a package with yum
How To: Remove A Package With YUM โ€ข Linux Tips
June 21, 2023 - Those commands will only remove the package you named. So, if you removed a program like Thunderbird, your configuration files and any dependencies will (should) remain on the system. This is useful for when you need to reinstall an application but want to try keeping your existing configuration. If you want to also remove your configuration files and any dependencies, YUM will happily allow you to do that.
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ how to uninstall packages from linux?
How to Uninstall Packages from Linux? - Scaler Topics
April 3, 2024 - Replace "package_name" with the actual name of the package you want to uninstall. The sudo command is used to run the uninstallation process with administrative privileges. ... After entering the command, Yum will prompt you to confirm the ...