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 ExchangeCheck 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!
rpm -e xxx.rpm && rpm -ivh --replacefiles xxx.rpm
This in effect replaces the old configs kept after "erasing" Must be a way to do this with yum and dnf
how to remove packages from yum list result? - Stack Overflow
with yum how can you remove a package but not remove its dependencies at the same time? - Unix & Linux Stack Exchange
For yum/dnf - What is the difference/relation between `remove` and `erase`?
linux - Remove completely all packages I installed? - Unix & Linux Stack Exchange
Videos
yum remove '*cdh*' will do what you want. Though be careful to check the list of packages it wants to remove to make sure the pattern didn't catch too much.
You can remove in bulk by using a wildcard.
yum remove 'cdh*'
There is more information here rpm - erase multiple packages
Do
yum remove package
yum install package
on command line. If there is any config file which is not replaced during installation then message will be printed on screen that the file has been saved with different name. Move new file to old file.
This is hoping there are very less configuration files of package which you are trying to re-install.
Not terribly elegant, but it works:
for package in package1 package2 package3
do
echo "removing config files for $package"
for file in $(rpm -q --configfiles $package)
do
echo " removing $file"
rm -f $file
done
rpm -e $package
done
Appears possible, by using rpm:
$ rpm -e --nodeps packageA
though obviously be very careful, since if you remove a dependency package and don't put it back that could lead to unexpected results for the packages still installed that depend on it and anticipate it being present...
I found it was possible to do this with yum like so:
sudo yum remove --noautoremove <package name>
List all the files in the reverse order of their installation date into a file:
rpm -qa --last >list
You'll get lines like
atop-2.1-1.fc22.x86_64 Wed Apr 13 07:35:27 2016
telnet-server-0.17-60.fc22.x86_64 Mon Apr 11 20:10:43 2016
mhddfs-0.1.39-3.fc22.x86_64 Sat Apr 9 21:26:06 2016
libpcap-devel-1.7.3-1.fc22.x86_64 Fri Apr 8 09:40:43 2016
Choose the cutoff date that applies to you and delete all the lines that follow it. Give the remaining lines to yum to remove, after removing the date part. Eg
sudo yum remove $(awk '{print $1}' <list)
You can also try with yum history and usually you get a numbered list of what has been installed, like :
[root@localhost ~]# yum history
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
ID | Login user | Date and time | Action(s) | Altered
3 | root <root> | 2011-09-14 14:36 | Install | 1
2 | root <root> | 2011-09-12 15:48 | I, U | 80
1 | System <unset> | 2011-09-12 14:57 | Install | 1025
and you can use afterwards yum history undo 3 for example.
More details about yum history here.