SCIENTIFIC-LINUX-USERS Archives

January 2007

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Art Wildman <[log in to unmask]>
Reply To:
Date:
Sun, 28 Jan 2007 19:39:21 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (98 lines)
Ioannis Vranos wrote:
> John Hearns wrote:
>
> > rpm --install --replacepkgs
> >
> > (or --replacefiles if that is what you need)-
> >
> > I use this frequently.
> >
> >
> > --replacefiles
> >
> >   Install the packages even if  they  replace  files  from other, 
> already installed,
> >   packages.
> >
> >
> > --replacepkgs
> >
> > Install  the packages even if some of them are already installed on 
> this system.
>
>
>
> OK, but how can I do it automatically, rather than using this 
> manually, rpm after rpm?
>

John's recommendations are right on, I was going to suggest... It might 
be simpler if you told us what errors you were getting and what packages 
(libraries) you wanted to repair. Linux is much more robust, flexible & 
sometimes simpler to repair than windows (we don't kill flies with a 
sledgehammer & reinstall on a whim). RPM has a built in Verify tool (rpm 
-Va) that can help determine if any of your packages are corrupt or have 
discrepancies...
RHEL-4 SAG - Using RPM
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/s1-rpm-using.html
Using RPM to Verify Installed Packages
http://www.rpm.org/max-rpm/ch-rpm-verify.html
http://www.novell.com/coolsolutions/feature/16238.html
RPM Conflicts
http://sial.org/howto/rpm/conflicts/

It also depends if you have upgrades (yum repositories) or you want the 
install base from a CD/DVD.iso.

Using rpm scripts you can get a list of all installed packages.
#!/bin/sh
## /etc/crond.daily/rpm  - mod 'sort -f' 20050907 AW
# Produce an alpha sorted list of all installed rpms in /var/log/rpmpkgs
rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 \
        | sort -f > /var/log/rpmpkgs
-------------------------------------
Check for duplicate rpms (frequent causes of dependency problems)...
$ uniq -d /var/log/rpmpkgs | wc -l

To reinstall all packages via Yum...
$ yum clean all
$ cat /var/log/rpmpkgs | xargs yum install

You may be able to do a Yum upgrade too...
How To Upgrade To The Latest S.L. 4.x Release
https://www.scientificlinux.org/documentation/howto/upgrade.4x
http://fedoraproject.org/wiki/YumUpgradeFaq
http://www.brandonhutchinson.com/Upgrading_Red_Hat_Linux_with_yum.html
http://yum-extender.org/

Yum doesn't replace rpm and isn't a package management tool so it 
doesn't support --force and --nodeps options of rpm which are rarely 
needed to overcome dependencies (see Using RPM). One option is to script 
rpm commands, which takes a little prep work & you must copy all the rpm 
packages to a working directory...
Copy a pile of rpms to be upgraded into a working directory, cd into 
that directory and install (-i), upgrade (-U) or Freshen (-F) the 
packages...
$ cd /opt/downloads/rpms
$  rpm -ivh --replacepkgs $(find . -xdev -maxdepth 1 -type f -name 
"*.rpm") | \
 tee ~/rpms_install_$(date -I).log

Based on your last comments about 'disk errors & fsck, I'd recommend you 
perform an upgrade from an SL Install CD/DVD with the same/newer version 
& overwrite packages & not format/repartition your /home directory, 
careful to preserve home and other directories you may have modified and 
backup important /etc config files. The anaconda CD installer/upgrade 
program can handle fixing tons of problems when you don't know what's 
broken... also see the 'rescue' mode at bootup.

RHEL-4 Installation Guide - Upgrade vs. Re-Install
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/x8664-multi-install-guide/ap-upgrade.html

RHEL-4 SAG - Booting into Rescue Mode + Single-User Mode
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/s1-rescuemode-boot.html

-- 
Art Wildman - NWS JAX FL. - http://www.srh.noaa.gov/jax
"If the thunder don't get you, then the lightning will..." - Grateful Dead

ATOM RSS1 RSS2