I copied the apt source directory from /var/cache/apt/archives/ on my laptop (11.10) to my work PC (11.10). I then removed /var/lib/apt/lists/*.

Now when I try to update my pc from the terminal, it shows "Failed to fetch" errors. If f use the Ubuntu update manager to install updates, it says: "waiting for unattended-upgrade to exit", but no update happens. Now it won't update anything.

  • What is apt source directory? Could you be more specific? – enzotib Feb 1 '12 at 7:05
  • sorry,copy this directory : /var/cache/apt/archives/ and then remove: /var/lib/apt/lists/* and now i can't update anything – Netmoon Feb 7 '12 at 6:55
  • Why did you remove apt/lists/? Did you follow some instructions, if so link them please. Also we assume your /etc/apt/sources.list are the same on both machines? – invert Apr 16 '12 at 8:09
  • @Wesley: no, just i think this files not same, so i remove destination list file! i'v done that whitout any guide or manual ! – Netmoon Apr 18 '12 at 4:36

Go to /var/cache/apt and delete the lock file. Clear the "updates" folder. Thats it.

| improve this answer | |
  • thank you, thats working great. can you explain further about lock file; what is it and how it work? – Netmoon Apr 18 '12 at 4:34
  • The 'lock' file can be in /var/lib/dpkg/ directory as well. Use 'sudo rm lock' to remove the lock file in the directory. – sv_jan5 Jun 15 '16 at 14:37

Are you referring to the '/etc/apt/' directory, with the 'sources.list' file in it? Or the '/var/cache/apt/archives/' directory, where package archives are stored?

Can't really answer your question as to what's wrong without knowing which. If you want to update one machine from the files downloaded by apt-get off another, you're going to need to become familiar with how apt-get structures its package lists and archive files and set up a 'sources.list' file to suit, or use something like apt-mirror.

| improve this answer | |
  • sorry,commented – Netmoon Feb 7 '12 at 6:55

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.