[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: etch upgrade blows away /usr/bin?



Hi Henry,

Henry Hollenberg wrote:

> Still puzzling over how this happened.  During the upgrade
> I got a message about an install script not being able
> to make a sym-link in /usr/X11R6/bin because
> the directory was "full" and needed to be "emptied".

I'm no X expert and maybe you would be better asking this on the
debian-x@lists.d.o mailing list.  But what I think happens during the
upgrade is that, provided /usr/X11R6/bin is empty (maybe also if it's
non-existent), the upgrade script rmdir's this directory and creates the
symlink /usr/X11R6/bin -> /usr/bin .

That is, it's not trying to make a symlink *in* /usr/X11R6/bin, it's
trying to make a symlink *of* /usr/X11R6/bin.

> So I moved it to /root/backup/usr_X11R6/bin where a copy
> still resides.

OK, so after that I'm guessing that you ran the upgrade script again and
it was able to create the symlink (now that /usr/X11R6/bin either didn't
exist or was empty).

> before the final attempt at the upgrade I noticed a bunch
> of files in /usr/X11R6/bin that weren't there before.  Not
> sure where they came from, I hadn't copied all those files
> in there and I certainly hadn't done a sym-link.
> 
> So I deleted them and finished the upgrade with no errors.
> 
> Checked /usr/X11R6/bin and didn't see a symlink...uh-oh the
> upgrade lied to me, what does that mean.

Did you do "ls -l /usr/X11R6/bin" ?  Because "ls -l /usr/X11R6/bin/"
(note the trailing slash) would show you the directory contents even if
/usr/X11R6/bin is itself a symlink.

> Copied the saved copy back to /usr/X11R6/bin and went back
> to work or tried to.
> 
> That's when I noticed a whole lots of stuff wasn't working and
> a whole lot of commands were MIA including "locate".
> 
> Hmmm,
> 
> checked /usr/bin and it held the contents of /usr/X11R6/bin
> and did not have the 3000 some odd binaries and sym-links that
> should be in there.
> 
> That's kind of bad.
> 
> So what happened, did I do an incredibly bone-headed thing?
> Certainly possible, but I wonder if the upgrade scripts
> somehow went up an extra level in the directory tree while
> making a sym-link and fooled me.
>
> I'm pretty darn sure that the directory I was in was
> /usr/X11R6/bin as I make a habit of doing a pwd before
> doing an rm just do double check the what the system
> prompt is telling me.

If you used the shell's version of pwd, it is usually "smart" enough (at
least this is the case for bash and zsh) to tell you your current
directory relative to any symlinks into which you cd'ed.  That is, if
you cd into /usr/X11R6/bin but it is really a symlink to /usr/bin,
typing "pwd" will still show you /usr/X11R6/bin.  The "real" pwd, if you
run it by typing "/bin/pwd", will show you that you are actually in
/usr/bin.

Sounds like you got hosed by some corner-case behavior of ls and pwd :-(
 Maybe you could send a report about this to debian-x and suggest that
the upgrade process give a clear explanation of exactly what's going on?
 I'm glad to hear your next message sounds like you have mostly recovered:

> Did a bunch of dpkg repair by hand and copied over some /usr/bin
> files from another partition and apt finally took off.
> 
> Still have lingering errors from postgresql and X is broken:
> 
> andy:/etc/init.d# ./postgresql-7.4 restart
> Restarting PostgreSQL 7.4 database server: main* Error: You must run this program as the cluster owner (postgres)
>  failed!

This sounds like a permissions problem; try to "aptitude reinstall" the
package containing the postgresql-7.4 binary.  (Or if aptitude is still
broken because of this error, download the .deb and "dpkg -i" it by hand.)

You can get a complete list of the installed packages that are supposed
to have binaries in /usr/bin with "dpkg -S /usr/bin".  It might be a
good idea to "aptitude reinstall" all of them just to clear up any
remaining inconsistencies.

regards,

-- 
Kevin B. McCarty <kmccarty@princeton.edu>   Physics Department
WWW: http://www.princeton.edu/~kmccarty/    Princeton University
GPG: public key ID 4F83C751                 Princeton, NJ 08544



Reply to: