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

Re: /var/lib/dpkg/alternatives

On Wed, Nov 13, 2002 at 04:21:59AM +0000, Pigeon wrote:
> Well I've got round my ldconfig problems. Eventually I found
> base2_1.tgz on my Debian CD, unzipped it on my Windoze box, wrote it
> to a CD, and copied stuff in using the rescue disk. With the addition
> of some of the rescue disk itself (fsck) I got an ldconfig, and got it
> to boot again, after several false starts. I then used dpkg -i to
> reinstall most of the stuff in main/binary-i386/base which got most
> stuff working, including dselect.
> I'm now using dselect to reinstall pretty much everything and get the
> system back into a consistent state. I have got a few errors on some
> packages due to /var/lib/dpkg/alternatives/foo being corrupt. (eg. foo
> = awk)
> Is it permissible simply to delete these files? Will I risk breaking
> the whole thing again? If so, how do I restore them?

See man update-alternatives to see how you would normally modify files
in /var/lib/dpkg/alternatives. I am not sure if anything would break
if you just delete the files. 

The files in /var/lib/dpkg/alternatives are ascii text, so you could edit
them with vi, emacs, bvi, or any text editor. I would suggest bvi or
ghex so you can see what nonprintable are in the files. 

Here is a couple of examples (vi & emacs) of what files in
/var/lib/dpkg/alternatives look like. These would be different on you
computer depending on what packages you have installed. 

$ cat /var/lib/dpkg/alternatives/vi


$ cat /var/lib/dpkg/alternatives/emacs  


The first line of the /var/lib/dpkg/alternatives/foo is mode.
Second line is the alternative command symlink.
Third line refers to filename in /etc/alternatives/
Fourth line is man symlink.
Fifth line is single LF (hex 0A, '\n')

The remaining lines are various alternative commands, priorities, and
associated man pages. The file ends with two LFs.

I hope this helps.


Attachment: pgpEJo__uJZNV.pgp
Description: PGP signature

Reply to: