E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

amritpal pathak amritpalpathak1 at gmail.com
Fri Jun 17 15:29:09 UTC 2011


On Thu, Jun 16, 2011 at 7:18 PM, Jordon Bedwell <jordon at envygeeks.com>wrote:

> 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)
>
       upto here..done everything smoothly..:)

>
> #~: dpkg --force-depends -i ucf_*.deb
>
        it gave the error:
        dpkg: error processing ucf_*.deb (--install):
 cannot access archive: No such file or directory
Errors were encountered while processing:
 ucf_*.deb


> why?
>
>    Amrit
   http://amritpalpathakgne.wordpress.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20110617/32d876e7/attachment.html>


More information about the ubuntu-users mailing list