Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I got the following error

Reading package lists... Done
W: GPG error: http://extras.ubuntu.com oneiric Release: Unknown error executing gpgv
executing gpgv
----
----
W: GPG error: http://archive.ubuntu.com oneiric-updates Release: Unknown error executing gpgv

Then after googling it I found and followed the following instruction but that caused one error:

**sudo -i
apt-get clean
cd /var/lib/apt
mv lists lists.old
mkdir -p lists/partial
apt-get clean
apt-get update**

While running I got the error:

kapil@ubuntu:/var/lib/apt$ sudo mv lists lists.old
mv: cannot move `lists' to `lists.old/lists': Directory not empty

So once again running the update command I got the same error again. Please help me what should I do?


I did the following on your advice and it showed the following

root@ubuntu:/home/kapil# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/loop0             15G  4.7G  8.8G  35% /

udev                  1.5G  4.0K  1.5G   1% /dev

tmpfs                 591M  880K  590M   1% /run

none                  5.0M     0  5.0M   0% /run/lock

none                  1.5G  488K  1.5G   1% /run/shm

/dev/sda5             229G  221G  7.2G  97% /host

/dev/sda1             100M   25M   76M  25% /media/System Reserved

root@ubuntu:/home/kapil# ls -al /var/lib/apt/

total 68

drwxr-xr-x  7 root root  4096 2012-04-08 09:53 .

drwxr-xr-x 58 root root  4096 2012-03-28 09:59 ..

-rw-r--r--  1 root root   203 2012-03-24 13:18 cdroms.list

-rw-r--r--  1 root root  7261 2012-04-06 15:27 extended_states

drwxr-xr-x  2 root root  4096 2011-10-12 10:27 keyrings

drwxr-xr-x  3 root root 16384 2012-04-14 06:26 lists


drwxr-xr-x  4 root root 20480 2012-04-08 07:46 lists.old

drwxr-xr-x  3 root root  4096 2011-10-12 10:27 mirrors

drwxr-xr-x  2 root root  4096 2012-03-24 14:39 periodic*

When I followed the above instruction it showed following warnings first :

root@ubuntu:/home/kapil# sudo apt-get clean

root@ubuntu:/home/kapil# sudo rm /var/lib/apt/lists/*

rm: cannot remove `/var/lib/apt/lists/partial': Is a directory

root@ubuntu:/home/kapil# sudo rm /var/lib/apt/lists/partial/*

root@ubuntu:/home/kapil# sudo apt-get clean

root@ubuntu:/home/kapil# sudo apt-get update

After this it again showed the error :

Reading package lists... Done

W: GPG error: http//archive.canonical.com oneiric Release: Unknown error executing gpgv

W: GPG error: http//extras.ubuntu.com oneiric Release: Unknown error executing gpgv

W: GPG error: http//archive.ubuntu.com oneiric Release: Unknown error executing gpgv

W: GPG error: http//archive.ubuntu.com oneiric-backports Release: Unknown error executing gpgv

W: GPG error: http//archive.ubuntu.com oneiric-security Release: Unknown error executing gpgv

W: GPG error: http//archive.ubuntu.com oneiric-proposed Release: Unknown error executing gpgv

W: GPG error: http//archive.ubuntu.com oneiric-updates Release: Unknown error executing gpgv

What to do now?

share|improve this question
    
Long shot, but please check file system usage with df -h. Also check if lists.old already exists. In that case move it somewhere else. –  jippie Apr 14 '12 at 11:18
    
Thanks for ur answer but im a amateur in ubuntu ...can u give me step wise intruction for above advice because im not allowed to move a folder/file in root folder location of "var/lib/apt" –  Kapil Anand Apr 14 '12 at 11:51
    
Enter the following on the command line, then update your question with what you found: df -h and ls -al /var/lib/apt/ –  jippie Apr 14 '12 at 11:56
    
done ... i hv updated in above problem to show u the output.. –  Kapil Anand Apr 14 '12 at 12:13
    
You're currently booted from a (install) CD? –  jippie Apr 14 '12 at 12:32
show 2 more comments

4 Answers 4

Your original error :

mv: cannot move `lists' to `lists.old/lists': Directory not empty

can be addressed by adding a timestamp to the directory rename as you can see below. Also, by adding a semicolon IE. ; to end of each line will demarcate each command and so will allow you to cut and paste entire set of below commands from your notes back into a terminal

sudo apt-get clean ;
cd /var/lib/apt ;
sudo mv lists lists.old_`date '+%Y%m%d_%H%M%S'`   ;
sudo mkdir -p lists/partial ;
sudo apt-get clean ;
sudo apt-get update
share|improve this answer
add comment

I had the same problem and this solved it for me, after first performing the apt-get clean and lists purge.

mkdir ~/tmp
sudo mv /usr/local/lib/libreadline* ~/tmp
sudo ldconfig
sudo apt-get update
share|improve this answer
add comment

The only time I've ever gotten that error it was because 'lists.old' was already made by me when I fixed the problem previously. Try doing the script/terminal instructions above but substitute 'lists.old2' for 'lists.old' and everything should be fine (assuming the problem is, as it claims, that the directory is not empty).

If not then you can always try to use aptitude to solve the problem because, as far as I'm aware, it uses different lists than apt-get but can resolve the same dependency structures (sudo aptitude update && sudo aptitude upgrade) or use the aptitude shell (just type aptitude and hit enter, it will prompt you for root when it needs it) which is interactive and offers more options to try to correct apt-get's problems -- aptitude shell is also less intuitive so look up how to use it ( u, U, g, g, etc.)

Also note that if you're using an old version of ubuntu then don't try to fix things with aptitude because apt-get used to not talk very well with it and your system can get messed up if you use both of them.

share|improve this answer
add comment

I have two solutions:

  • Solution #1 (Recommended ):

    Just open a terminal and run the following commands:

    sudo apt-get clean

    sudo rm /var/lib/apt/lists/*

    sudo rm /var/lib/apt/lists/partial/*

    sudo apt-get clean

    sudo apt-get update

    Done! When running those sudo rm ... commands, don't worry about errors or warnings.

  • Solution #2:

    1. First remove all ppa repositories in Update Manager -> Settings -> Other Software;

    2. sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak

    3. sudo touch /etc/apt/sources.list

    4. sudo apt-get update

    5. sudo mv /etc/apt/sources.list.bak /etc/apt/sources.list

    6. sudo apt-get update

    7. Now add all your ppa repos back again.

    8. sudo apt-get update

    Done!

share|improve this answer
    
i have mentioned the output ...problem still persists ...any help will be greatfull .kindly help –  Kapil Anand Apr 14 '12 at 12:33
    
The commands I provided are slightly different from those you posted in the question. Carefully follow the commands I have provided. These should work, because I've used this method to solve GPG-errors many times and it has always worked for me. –  Seyed Mohammad Apr 14 '12 at 12:44
    
i have updated my question by including ur instruction tht u just said...check the o/p whihch im getting .....@seyed –  Kapil Anand Apr 14 '12 at 12:50
    
plz reply to my question @ seyed mohammad –  Kapil Anand Apr 14 '12 at 13:15
    
Hmm, strange! Currently I don't have any clue why this didn't fix the issue. I will come back as soon as I find anything useful. –  Seyed Mohammad Apr 15 '12 at 4:23
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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