Monday, August 2, 2021

Interruption in the up2date or yum update process caused the installation of multiple versions of the same package.

 

##RPM Build issue


Interruption in the up2date or yum update process caused the installation of multiple versions of the same package.


Resolution

If the system is Red Hat Enterprise Linux 5 or later, the package-cleanup command can be used:


$ package-cleanup --dupes
$ package-cleanup --cleandupes

The --dupes command will list the duplicate packages installed on the machine, while the --cleandupes switch will remove the older versions. package-cleanup command is provided by the yum-utils package.
 

 the approach that worked for me:

        sudo package-cleanup --dupes

        sudo package-cleanup --cleandupes

        sudo package-cleanup --cleandupes --removenewestdupes

        sudo yum update

if the the yum update still fails - continue as follows:

check the installed versions of the offending library with yum search for example: if the problem is with libselinux

        sudo yum list --showduplicates libselinux

    in the results you'll probably see library versions ending with x86_64 or i686 for example : libselinux.i686 libselinux.x86_64

now- we need to find out which one of these to get rid of, so we run:

 

 How to backup the OS mount point in Linux

 

#!/bin/sh
####################################
#
# Backup to /backup mount script.
#
####################################

# List of files to backup.
backup_files="/home /var /etc /root /boot /opt /bin /lib64 /lib /sbin /tftpboot /usr"

# Backup location.
dest="/u00/backup/appl/OSBKP/"

find $dest -mtime +8 -type f -exec rm -rf {} \;

# Archive Name.
day=$(date +%Y%m%d.%H%M)
hostname=$(hostname -s)
archive_file="$hostname-$day.tgz"
Log_file="/u00/backup/appl/OSBKP/$hostname-$day.txt"

# Print start status message.
echo "Backing up $backup_files to $dest/$archive_file" >> ${Log_file}
date  >> ${Log_file}
echo  >> ${Log_file}

# Backup the files using tar.
tar czf $dest/$archive_file $backup_files

# Print end status message.
echo
echo "Backup finished" >> ${Log_file}
date  >> ${Log_file}

# Long listing of files in $dest to check file sizes.
ls -lh $dest  >> ${Log_file}