View Full Version : /var/chache/apt/lock
buddhagui
November 23rd, 2005, 10:35 AM
Hello friends in Ubuntu! I need help. I deleted /var/chache/apt/lock and /var/chache/apt/archives, now I can no longer use apt! Someone please help! I did it because I was in a hurry and had to get something else out of there for lack of space. Now I don't know what's going on. An easy fix?
Thanks in advance
adwait
November 23rd, 2005, 11:02 AM
The lock file can be deleted without a problem. The /var/cache/apt/archives folder just stores the deb files that have been previously downloaded and installed.......so deleting them shouldn't theoratically cause a problem. What error are you getting when you try to run apt?
buddhagui
November 23rd, 2005, 11:18 AM
chris@ip62:~/The Producers$ sudo apt-get update
E: Archive directory /var/cache/apt/archives/partial is missing.
and the following error when running apt-get upgrade:
chris@ip62:~/The Producers$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
The following packages have been kept back:
linux-image-386 linux-restricted-modules-386
The following packages will be upgraded:
libnetpbm10 libnetpbm9 linux-386 linux-restricted-modules-common netpbm
5 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
E: Could not open lock file /var/cache/apt/archives/lock - open (2 No such file or directory)
E: Unable to lock the download directory
Please HELP! Thanks,
chris
buddhagui
November 23rd, 2005, 11:34 AM
Thanks for the help. I ended up fixing it by recreating the directories and the lock file. Just putting in blank ones is enough and apt does the rest. Again, Thank you for the help.
MikeyXX
November 23rd, 2005, 11:46 AM
Thanks for posting your fix.
bfonseca
November 28th, 2005, 01:27 AM
Thanks for the help. I ended up fixing it by recreating the directories and the lock file. Just putting in blank ones is enough and apt does the rest. Again, Thank you for the help.
Hi can you please help me with the problem you had..I have the same problem and I am totally new so I dont understand what you mean by all that.. Can you please give me a step by step fix..
Thank you
Brian
towsonu2003
November 28th, 2005, 02:04 AM
Hi can you please help me with the problem you had..I have the same problem and I am totally new so I dont understand what you mean by all that.. Can you please give me a step by step fix..
Thank you
Brian
"Thanks for the help. I ended up fixing it by recreating the directories and the lock file. Just putting in blank ones is enough and apt does the rest. Again, Thank you for the help."
it seems like he did the following in a terminal (applications>accessories>terminal):
sudo mkdir /var/cache/apt/archives
sudo touch /var/cache/apt/archives/lock
sudo mkdir /var/cache/apt/archives/partial
sudo apt-get update
I hope this will fix it...
atropus
December 15th, 2005, 01:17 PM
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/aptitude/lock
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/apt/lists/lock
sudo dpkg --configure -a
andrewsomething
June 15th, 2007, 11:20 PM
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/aptitude/lock
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/apt/lists/lock
sudo dpkg --configure -a
I had the same issue. I accidentally deleted the files due to some bad advise concerning a different issue. Running the above commands fixed it for me. Thanks!
(I just wanted to put that on the record so people like me who might stumble upon this page googling the error message know this works.)
frozenjim
June 28th, 2008, 06:57 AM
Confirmed again.
I (foolishly) deleted my cached files because I had (foolishly) created my partition at only 2.5 GB. Two days later, disk was 100% and I was stuck in the middle of an upgrade.
Followed the advice and I'm back in business - ready to apt-get gparted and resize some partitions.
Thanks.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.