E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
Jordon Bedwell
jordon at envygeeks.com
Thu Jun 16 23:18:53 UTC 2011
On 6/16/2011 1:52 PM, NoOp wrote:
> $ sudo -i
> (enter your normal user password at the password prompt)
> # ar x dpkg_1.15.8.4ubuntu3.1_i386.deb
> # mv data.tar.gz /data.tar.gz
> # cd /
> # tar xzfv data.tar.gz
> # exit
> $ sudo apt-get update && sudo apt-get upgrade
> $ sudo dpkg --configure -a
> $ sudo apt-get install -f
>
> Reference for the above:
> http://www.debianhelp.co.uk/debianproblem.htm
> [ What to do if the dpkg command is broken]
I literally deleted /var/lib/dpkg on one of my computers and then
proceeded to figure out how to recover it and this is what I came up
with and this is how I got the system restored (it's a bit rough but it
works):
#~: sudo -i
#~: rm -rf /var/cache/apt/archives
#~: mkdir /var/lib/dpkg
#~: mkdir /var/lib/dpkg/info
#~: mkdir /var/lib/dpkg/parts
#~: mkdir /var/lib/dpkg/alternatives
#~: mkdir /var/lib/dpkg/methods
#~: mkdir /var/lib/dpkg/updates
#~: mkdir /var/cache/apt/archives
#~: mkdir /var/cache/apt/archives/partial
#~: cp /var/backups/dpkg.status.0 /var/lib/dpkg/status
#~: cd /var/cache/apt/archives
#~: dpkg --clear-avail
#~: apt-get clean
#~: apt-get --reinstall -dy install $(dpkg --get-selections | grep
'install' | cut -f1)
#~: dpkg --force-depends -i ucf_*.deb
#~: dpkg --force-depends -i *.deb
More information about the ubuntu-users
mailing list