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

Re: Recovering dpkg database



MoiN

On Sun, Apr 22, 2001 at 11:58:15AM -0500, Taral wrote:
> On Sat, Apr 21, 2001 at 10:49:20PM -0700, Joseph Carter wrote:
> > From then on (sorry, I know of no other way) you will simply have to get a
> > list of installed packages (dpkg --get-selections, you can use cut or sed
> > and grep or something to cut the list down to just the ones you want) and
> > feed the result to apt-get install..  If you do it cleverly, you can do it
> > on one cmdline.
> 
> Actually, dpkg is likely not to want to install them. Answer:
> 
> apt-get clean
> apt-get -d install `dpkg --get-selections | awk '$2 == "install" { print
> $1 }'`
> dpkg -i /var/cache/apt/archives/*.deb
> 
> This will force a reinstall. You just have to hope that upgraded
> packages don't break on you.

Nope, this will only upgrade to new versions. You need to add the
switch '--reinstall' to the invocation of apt-get. I also suggest
that you let apt-get do the install ordering instead of doing
'dpkg -i *.deb'. Otherwise dpkg probably will fail on
unconfigured predependencies...

apt-get --reinstall install `dpkg --get-selections | awk '$2 == "install" { print $1 }'`

But--no guarantee this is going to work out of the box, you
probably need to mess around with apt, dpkg and/or debconf first.

    Ingo
-- 
16                      Hard coded constant for amount of room allowed for
                        cache align and faster forwarding (tunable)

-- seen in /usr/src/linux-2.2.14/net/TUNABLE



Reply to: