I executed the following command:

sudo rm /var/lib/apt/lists/lock 

due to the solution I got from here.

Now my system gets hanged more frequently while running several applications. I dont know if its because I deleted lock folder or not because in that solution provided they said deleting lock can have serious consequences So can someone please suggest a means to restore it. Only this folder is missing.

  • The file you deleted is an empty file which is owned by root. It is created when performing system updates and upgrades. Hangs don't have to do anything with this problem. – syss Nov 2 '15 at 13:44
  • You can just ignore the /var/lib/apt/lists/lock, it will be created automatically when needed. You problem lies elsewhere. – Jérôme Nov 2 '15 at 15:03

If you have deleted a folder by accident, just restore it from your backups.

If you do not have any backups, you shouldn't delete random folders in the first place.

Furthermore, it's often suboptimal to follow random advice from the internet, without thinking through its consequences. A good read on this topic is DontBreakDebian (Ubuntu is based on Debian; but keep in mind that the two are not the same).

Finally: the /var/lib/apt/lists/lock file (not folder) is solely used by apt (and its various frontends). It helps preventing multiple instances of apt to run in parallel (to keep you from installing packages while another install process is running - which could lead to an inconsistent package database). Software that is not related to package management will not work any more stable or unstable if this folder is missing (or not).

So your real problem (system lockups,...) is not related to this folder.

  • thanks ... I dont have backups . So no other alternatives availiable ? – Anushman Nov 2 '15 at 12:46
  • not really, short of "unplug your computer and bring the hard disk to your local data recovery center". when running things as root (e.g. using sudo) you tell the computer explicitly that you know what you are doing, so you better do :-) – umläute Nov 2 '15 at 12:49
  • apt-get will re-create its lock file next time it runs. the fact that it was deleted would ONLY be a problem if you happened to be running two instances of apt-get at the time you deleted the lock. as @umläute and @syss said, the system lockups are completely unrelated. I suggest installing memtester or memtest86 and testing your RAM. – cas Nov 3 '15 at 1:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.