[Gllug] Repairing ubuntu packages

Jan Kokoska kokoskaj at seznam.cz
Tue Jan 11 00:58:24 UTC 2005


On Mon, 2005-01-10 at 18:45 +0000, Mike Brodbelt wrote:
> On Mon, 2005-01-10 at 16:49 +0000, Morris, Simon wrote:
> 
> > I can provide half the answer for you here.
> > 
> > If you run the following command you get a list of the packages you
> > currently have installed
> > 
> > COLUMNS=200 dpkg -l | awk '{print $2}' > ~/packages.txt
> > 
> > You could then (try) and restore the previous set of packages with
> > 
> > Apt-get install `cat ~/packages.txt`
> > 
> > However, this doesn't always work :(
> 
> A better route would be:-
> 
> dpkg --get-selections > package_list.txt
> 
> 
> Then:-
> 
> dpkg --set-selections < package_list.txt
> apt-get dselect-upgrade

Nice systematic approach but unfortunately doesn't seem to work for me
here. Only a few more packages than would be in normal dist-upgrade,
parent wants to reinstall everything.

My approach to the very same problem earlier was:

COLUMNS=200 dpkg -l | grep ^ii | awk '{print $2}' | tr '\n' ' ' | xargs
apt-get install --reinstall -y

The problem is in my case the argument list gets splitted in like 3
parts and since the system is badly damaged some of the first list will
fail (it thinks it has pre/post inst/rm scripts, while some of them are
in fact garbage), so subsequent parts of the package list will not be
installed this way until the begining gets fixed (which needs to be done
manually anyway).

Moral of the story? Don't return to a swap-suspended system on whose
root partition you just accidentally performed dist-upgrade from another
kernel ;))

Foolish I was, I know.

Jan

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list