Apt-get :: lock file & admin dir problems



I'm running DSL .5 from a hard drive install. Can anyone tell me how to around this?

sudo apt-get install whatever
E: could not open lock file /var/lib/dpkg/lock -open (2 no such file or directory)
E: unable to lock the administratior directory (/var/lib/dpkb), are you root?

These error messages, or similar, come up in some way or another whenever I try to do anything with apt-get.  sudo, sudo su, no diff.

Have you typed:

sudo su
dpkg-restore
exit

before you tried to run the apt-get stuff? You need to restore the dpkg directory before apt-get will work and the dpkg-restore command will grab the file from the web site and restore it for you.

Good Luck.


original here.