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

Re: Reinstalling lost packages using /var/lib/dpkg/status-old



On 9/27/12 9:58 PM, lars nooden wrote:
> If a bunch of packages have been uninstalled, what is an automated way
> of reinstalling them using /var/lib/dpkg/status-old or
> /var/backups/dpkg.status.* ?
> 
> I see a lot of material mentioning status but nothing about precisely
> how to use it.
> 
> Regards,
> /Lars
> 

There might have been a better way to extract the list of packages but
this seems to have done the job:

  dpkg --clear-selections
  awk '$1=="Status:" && $2=="install" {print PACKAGE "
install";PACKAGE=""};$1 == "Package:" {PACKAGE=$2}'
/var/backups/dpkg.status.0 | dpkg --set-selections
  apt-get dselect-upgrade

Regards,
/Lars


Reply to: