Posts Tagged ‘ yum

HOWTO: Convert from RHEL 5.3 to CENTOS 5.3

This is actually a lot more simple than I was expecting. Recently our RHEL subscription for a backup server expired and couldn’t really justify the cost to renew it, so I decided to convert it to a CentOS installation by doing the below:

yum clean all
mkdir /usr/src/centos
cd /usr/src/centos
wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
wget http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-5-3.el5.centos.1.i386.rpm
wget http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-notes-5.3-3.i386.rpm
wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.19-18.el5.centos.noarch.rpm
wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-updatesd-0.9-2.el5.noarch.rpm
wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm
rpm –-import RPM-GPG-KEY-CentOS-5
/bin/rpm -e --nodeps redhat-release
/bin/rpm -e --nodeps rhn-client-tools
/bin/rpm -e --nodeps yum-rhn-plugin
rpm -Uvh --force *.rpm
yum upgrade

How painless was that?!

Yum restore script

Ok, so I’m about to do a reinstallation of Fedora (I made a boo-boo which would be easier to fix by a re-install than go through manually and try to fix). I have backups, but not of the lib folders etc, I do however have backups of the uber important folders e.g. /etc /home /root etc. Anyway, I want to do a minimum-fuss reinstall, and decided to write a wee script which would take a list of all my currently installed packages and make a nice simple exectuable bash script so that once I’ve set up the repos on the new system I can simply execute this script, it’ll install all the packages I have now, then I can just restore my /etc/directory on top and hey-presto, I’ll be back to a nicely functioning system.

So without further ado:

#!/bin/bash

INSTALLED=/tmp/yum-installed

LIST=/tmp/list

EXECUTABLE=/home/rob/yum

USER=rob

GROUP=$USER

UNATTENDED_INSTALL=yes #yes/no

cat /dev/null > $EXECUTABLE

sudo yum clean all;sudo yum list installed | awk -F' ' '{print $1}' | sed 1d | sed 1d | sed s/.i386// &> $INSTALLED

exec 3< $INSTALLED

while read <&3

do

echo -n "$REPLY " >> $LIST

done

exec 3>&-

# Create the yum installation script file

if [ $UNATTENDED_INSTALL = "yes" ]

then

OPTION="-y"

fi

echo "#!/bin/bash" >> $EXECUTABLE

echo -n "$REPLY " >> $LIST

echo "sudo yum clean all;sudo yum install $OPTION `cat $LIST`" >> $EXECUTABLE

# Set correct perms

chmod +x $EXECUTABLE

chown $USER.$GROUP $EXECUTABLE

# Cleanup

rm -f $LIST

rm -f $INSTALLED

Obviously edit the vars at the top to suit your setup etc - then just sudo (or execute as root) the $EXECUTABLE

Fedora 10 clean install – update issue

This evening I installed Fedora 10 onto my desktop so I can use it as my primary OS – I’d had enough of Vista 64 Ultimate to last me a lifetime. Anyway, I didn’t expect the install to go amazingly smoothly, since I’m running relatively new hardware, however I was pleasantly surprised at just how easy the install has become. My only wee gripe is that I had an issue with my standard yum update which I do after I install any Red Hat OS.

This may (or may not) have been caused by an issue with RPMfusion, since I had installed their repo onto my system, regardless, I was presented with the following:

[root@desktop64 src]# yum update
Loaded plugins: refresh-packagekit
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package m17n-contrib-marathi.noarch 0:1.1.8-2.fc10 set to be updated
---> Package m17n-contrib-tamil.noarch 0:1.1.8-2.fc10 set to be updated
---> Package mesa-dri-drivers.i386 0:7.2-0.14.fc10 set to be updated
---> Package m17n-contrib-sinhala.noarch 0:1.1.8-2.fc10 set to be updated

……..

---> Package bind-utils.i386 32:9.5.1-0.9.b3.fc10 set to be updated
--> Finished Dependency Resolution
gnome-packagekit-0.3.9-8.fc10.i386 from installed has depsolving problems
--> Missing Dependency: libpackagekit-glib.so.10 is needed by package gnome-packagekit-0.3.9-8.fc10.i386 (installed)
kpackagekit-0.3.1-4.fc10.i386 from installed has depsolving problems
--> Missing Dependency: libpackagekit-qt.so.10 is needed by package kpackagekit-0.3.1-4.fc10.i386 (installed)
Error: Missing Dependency: libpackagekit-glib.so.10 is needed by package gnome-packagekit-0.3.9-8.fc10.i386 (installed)
Error: Missing Dependency: libpackagekit-qt.so.10 is needed by package kpackagekit-0.3.1-4.fc10.i386 (installed)

This was resolved by simply doing a

[root@desktop64 src]# yum remove gnome-packagekit kpackagekit
since these packages were the only ones causing an issue.

[EDIT: VileGent in #fedora on freenode suggested the following, which would also resolve the issue, without having to remove packagekit yum --skip-broken update ]
In related news, it looks like Fedora was stricken with a rather large bug which caused a log of issues with dbus etc – I think the above problem was strongly related to this bugzilla bug, however I can’t be sure, and I can’t be bothered to to a re-install to find out – besides, I can live without packagekit anyway :)

[UPDATE: Updated packages are available, but haven't been signed and committed to the [fedora-updates] repository yet. If you can’t wait, try the following script:
#!/bin/bash
cd /usr/src
wget http://koji.fedoraproject.org/packages/PackageKit/0.3.12/1.fc10/i386/PackageKit-0.3.12-1.fc10.i386.rpm
wget http://koji.fedoraproject.org/packages/PackageKit/0.3.12/1.fc10/i386/PackageKit-qt-0.3.12-1.fc10.i386.rpm
wget http://koji.fedoraproject.org/packages/PackageKit/0.3.12/1.fc10/i386/PackageKit-glib-0.3.12-1.fc10.i386.rpm
wget http://koji.fedoraproject.org/packages/PackageKit/0.3.12/1.fc10/i386/PackageKit-yum-0.3.12-1.fc10.i386.rpm
wget http://koji.fedoraproject.org/packages/PackageKit/0.3.12/1.fc10/i386/PackageKit-yum-plugin-0.3.12-1.fc10.i386.rpm
wget http://koji.fedoraproject.org/packages/PackageKit/0.3.12/1.fc10/i386/PackageKit-udev-helper-0.3.12-1.fc10.i386.rpm
wget http://koji.fedoraproject.org/packages/PackageKit/0.3.12/1.fc10/i386/PackageKit-gstreamer-plugin-0.3.12-1.fc10.i386.rpm
wget http://koji.fedoraproject.org/packages/kpackagekit/0.3.1/9.fc10/i386/kpackagekit-0.3.1-9.fc10.i386.rpm
wget http://koji.fedoraproject.org/packages/gnome-packagekit/0.3.12/1.fc10/i386/gnome-packagekit-0.3.12-1.fc10.i386.rpm
yum install --nogpgcheck kpackagekit-0.3.1-9.fc10.i386.rpm gnome-packagekit-0.3.12-1.fc10.i386.rpm PackageKit-0.3.12-1.fc10.i386.rpm PackageKit-glib-0.3.12-1.fc10.i386.rpm PackageKit-qt-0.3.12-1.fc10.i386.rpm PackageKit-yum-0.3.12-1.fc10.i386.rpm PackageKit-yum-plugin-0.3.12-1.fc10.i386.rpm PackageKit-gstreamer-plugin-0.3.12-1.fc10.i386.rpm PackageKit-udev-helper-0.3.12-1.fc10.i386.rpm