Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bash script to update redhat 7.3 to latest rpms (can be changed to any version)

5 views
Skip to first unread message

Mr V

unread,
Sep 5, 2003, 11:48:30 AM9/5/03
to
#!/bin/bash
# script to update all your current rpms to the latest versions
running
# from redhat mirror in uk
# all saved rpms will be stored in /home/rh-upgrade/
# simple scripts Vahid Hedayati

package="rpm -qva"

for names in `$package`
do
echo "upgrading $names "
mkdir /home/rh-upgrade/
cd /home/rh-upgrade/
wget ftp://ftp.mirror.ac.uk/sites/ftp.redhat.com/pub/redhat/linux/7.3/en/os/i386/RedHat/RPMS/$names*

new=`ls -l /home/rh-upgrade/$name* |awk '{print $9}'`

rpm -Fvh $new

done

# script is done save this file as something.sh and chmod to 755
-------------------------------------------------
Please also note it is probably best to run this at the initial
install of redhat since it may overwrite your config files since it
does a -Fvh in the last line before done which means force upgrade
there is also -ivh -Uvh which are safer then -Fvh which is a force
although sometimes -Uvh and ivh dont work


Thanks
Vahid

0 new messages