Chủ Nhật, 15 tháng 10, 2017

yum, rpm and duplicate versions

Apparently, when doing "yum update", and it fails miserably, you can end up with duplicate versions of packages in the RPM database. This seems harmless, but is annoying. yum provides a tool to check for this, but I was not able to find anything that would automatically repair it. So here's a little tip:
$ yum check duplicates | awk '/is a duplicate/ {print $6}' > /tmp/DUPES
$ yum remove `cat /tmp/DUPES`
 Of course, before you remove the dupes, make sure to examine the tmp file (/tmp/DUPES) and make sure it looks ok.
Update:
There seems to be a command to do this, package-cleanup has an option for it. E.g.
$ package-cleanup --cleandupes
However, testing this command on a second box having the same problem gave bad results, it seems to have uninstalled the "real" packages too.



Fix Yum Duplicate Packages or Broken Dependencies

Step 1. Install a package called ‘yum-utils’ as root:
Step 2. Then run the command:
yum-complete-transaction is a program which finds incomplete or aborted yum transactions on a system and attempts to complete them. It looks at the transaction-all* and transaction-done* files which can normally be found in /var/lib/yum if a yum transaction aborted in the middle of execution.
Several common commands I usually use:
Now yum commands can be run without the unfinished transactions warning. I hope it will solve your problem also.

Không có nhận xét nào:

Đăng nhận xét