Discussion:
What to do when yum goes south
(too old to reply)
Matt Giwer
16 years ago
Permalink
I think I have read of this problem before and do not remember a solution.

What apparently happened was the power dropped when the rpm database was
being updated. I got corrupt files in the database directory and yum itself
was corrupted.

I did not take notes but this is the general process.

When you run yum and it fails due to being corrupted it will give you the
location of the database files. Go there. Make a directory such as yum-temp.
copy all the files from yum to yum-temp which will be only the good files.
move yum to yum-orig and move yum-temp to yum. Then do rpm --initdb and get a
cup of coffee. The needed database is available after your second coffee.

go to your installation disk and find the yum-x-x-x.rpm under Packages or
some such (I used Fedora 10)

rpm -e --nodeps yum [may need version which you can get from conflicts list]

You get the conflicts list by trying to install what you find on your
installation disk.

the --nodeps is the trick to removing only yum and none of the dependencies

and then

rpm -i yum-installation-disk

These two steps appear to be the same as the single

yum reinstall package.rpm

operation.

After this yum functions as expected. The first step is obviously

yum -y update yum

to get you back to where you were before the file was corrupted.
--
It ain't covering a war unless you see the blood.
-- The Iron Webmaster, 4100
http://www.giwersworld.org/holo/nizgas3.html a4
Mon Jan 26 05:24:41 EST 2009
Jan Gerrit Kootstra
16 years ago
Permalink
...
Matt,


Thank you for the information.
I added some words to the subject for foreigners like me who might want
to search for your 'how to' in the future and do not know the phrase
"Somethings goes south".


Thanks again,


Jan Gerrit Kootstra
Matt Giwer
16 years ago
Permalink
...
Should I get around to adding this to my website I will try to take out all
the idioms. It will be at http://www.giwersworld.org/computers/linux/
--
Israel needs a second front in its war on Gaza so Bush can lock Obama into
supporting Israel's wars.
-- The Iron Webmaster, 4098
http://www.giwersworld.org/israel/bombings.phtml a5
Tue Jan 27 01:45:35 EST 2009
Nico Kadel-Garcia
16 years ago
Permalink
...
Nothing *CARES* about yum databases. Seriously, those can be rebuilt
on the fly from system information.

RPM databases, however, are something else altogether: *THOSE*, which
live in /var/lib/rpm/, should be backed up for safety and then the
command 'rpmbuild --rebuilddb' can be run to try and resolve the
problems.

You can also refer to the previous night's package list in '/var/log/
rpmpkgs' to try and restore any corrupted packages, and carefully
review the contants of 'rpm -qav' in order to look for errors and
duplicates.
...
Matt Giwer
16 years ago
Permalink
...
Any mature software has at least three ways to do the same thing.

I simply recount what I did. The previous posts I referred to all stumbled on
the

rpm -e corrupted.rpm

because of the dependencies it threatened to take with it. I do not remember
any solution posted with this problem. I was staring at the usual cryptic man
page when I noticed the --nodeps option and tried it and it solved the
threatened/required elimination of files which were not small or minor.
--
Dual citizenship is treason waiting to happen.
-- The Iron Webmaster, 4107
http://www.haaretz.com What is Israel really like? http://www.jpost.com a7
Tue Jan 27 01:39:35 EST 2009
Nico Kadel-Garcia
16 years ago
Permalink
...
Next time, download a clean copy and try:

rpm -U --replacepkgks newcopy.rpm
Nico Kadel-Garcia
16 years ago
Permalink
...
Make that:

rpm -U --replacepkgs newcopy.rpm

Darn new desk messing with my typing!
Matt Giwer
16 years ago
Permalink
...
Have you actually done that? And it worked?

I have no problem giving more than one way to do something. No pride of
discovery here. Just kicking my own ass for not recognizing a solution years ago.
--
If Jews are a race by birth and intermarriage why are not the
Latter Days Saints a race?
-- The Iron Webmaster, 4099
http://www.giwersworld.org/antisem/GAZA-pics/ a13
Tue Jan 27 22:38:36 EST 2009
Nico Kadel-Garcia
16 years ago
Permalink
...
Yes, generally. The only time it was unhappy was when I *really* had
rpm databases screwed up, due to interrupted procedures, and I had to
do the 'rpm --rebuilddb' first, then add the '--force' option to get
it to stop whining about the dependencies of other screwed up
packages. Re-installing can mess up your configurations somewhat: I
don't always agree with RedHat about which config files should be
moved aside and replaced, and which should be preserved as-is. But
they're pretty good about it.

Remember, yum databases are just a layer of user interface on top of
rpm: you can clean out yum by doing 'yum clean all', or by doing 'rm -
rf /var/cache/yum/', and it should rebuild itself from the remote
repositories. It's the rpm database that stores information about the
packages, their contents, and their dependencies.
Paul Mitchell
16 years ago
Permalink
Hello, I'm trying to set up a chroot jail on a redhat 5 linux box and have
run into a problem.
/bin/su - pmitchel
/bin/su: user pmitchel does not exist
grep pmitchel /etc/passwd
pmitchel:x:502:502::/home/jail/home/pmitchel:/bin/chroot-shell
cd /home/jail/etc
pmitchel:x:502:502::/home/jail/home/pmitchel:/bin/chroot-shell
oops, the above was a typo, should have been:

pwd
/home/jail/etc
[***@ELNDZ01F etc]# grep pmitchel ./passwd
pmitchel:x:502:502::/home/pmitchel:/bin/bash

Paul
...
1PW
16 years ago
Permalink
...
Hello Paul:

It's considered bad form to steal another's thread. Rather you should
begin your own thread. However...

List your /etc/sudoers and see if pmitchell has been setup there. If it
hasn't, then: man 5 sudoers

Please start a *new* cross posted thread and let us know how you're doing.

HTH

Pete
--
1PW @?6A62?FEH9:DE=6o2@=]4@> [r4o7t]
Paul Mitchell
16 years ago
Permalink
Hello, I'm trying to set up a chroot jail on a redhat 5 linux box and have
run into a problem.

/bin/su - pmitchel
/bin/su: user pmitchel does not exist

This is untrue:

grep pmitchel /etc/passwd
pmitchel:x:502:502::/home/jail/home/pmitchel:/bin/chroot-shell

cd /home/jail/etc
[***@ELNDZ01F etc]# grep pmitchel /etc/passwd
pmitchel:x:502:502::/home/jail/home/pmitchel:/bin/chroot-shell

I've seen various explanations via google, some calling for a set of
libnss* libs, but we seem to have them, and there's no others available at
our rhnsat archive (I'll try redhat as well).

cd /lib64
[***@ELNDZ01F lib64]# ls -l libnss*
-rwxr-xr-x 1 root root 43040 Jan 5 19:32 libnss_compat-2.5.so
lrwxrwxrwx 1 root root 20 Feb 3 15:37 libnss_compat.so.2 ->
libnss_compat-2.5.so
-rwxr-xr-x 1 root root 791456 Dec 11 2007 libnss_db-2.2.so
lrwxrwxrwx 1 root root 16 Nov 26 15:01 libnss_db.so.2 ->
libnss_db-2.2.so
-rwxr-xr-x 1 root root 23736 Jan 5 19:32 libnss_dns-2.5.so
lrwxrwxrwx 1 root root 17 Feb 3 15:37 libnss_dns.so.2 ->
libnss_dns-2.5.so
-rwxr-xr-x 1 root root 53880 Jan 5 19:32 libnss_files-2.5.so
lrwxrwxrwx 1 root root 19 Feb 3 15:37 libnss_files.so.2 ->
libnss_files-2.5.so
-rwxr-xr-x 1 root root 24736 Jan 5 19:32 libnss_hesiod-2.5.so
lrwxrwxrwx 1 root root 20 Feb 3 15:37 libnss_hesiod.so.2 ->
libnss_hesiod-2.5.so
-rwxr-xr-x 1 root root 3155144 Oct 16 17:51 libnss_ldap-2.5.so
lrwxrwxrwx 1 root root 18 Feb 3 15:41 libnss_ldap.so.2 ->
libnss_ldap-2.5.so
-rwxr-xr-x 1 root root 53432 Jan 5 19:32 libnss_nis-2.5.so
-rwxr-xr-x 1 root root 62944 Jan 5 19:32 libnss_nisplus-2.5.so
lrwxrwxrwx 1 root root 21 Feb 3 15:37 libnss_nisplus.so.2 ->
libnss_nisplus-2.5.so
lrwxrwxrwx 1 root root 17 Feb 3 15:37 libnss_nis.so.2 ->
libnss_nis-2.5.so
-rwxr-xr-x 1 root root 20624 Dec 9 11:03 libnss_winbind.so.2
-rwxr-xr-x 1 root root 1011272 Dec 9 11:03 libnss_wins.so.2

Has anyone a fix for this inability for root to switch user?

Thanks,

Paul Mitchell
==============================================================================
Paul Mitchell
Enterprise Resource Planning Project
email: ***@email.unc.edu
cubby: 4609 211 Manning Dr.
phone: (919) 843-4146
==============================================================================
Mark Hobley
16 years ago
Permalink
grep pmitchel /etc/passwd
Try the following from outside of the chroot;

grep pmitchel /home/jail/etc/passwd

Mark.
--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
Loading...