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.

Accidently deleted the whole /var/lib/apt/lists

Fetched 496 kB in 50s (9,738 B/s)
Reading package lists... Error!
E: Read error - read (21: Is a directory)
E: The package lists or status file could not be parsed or opened.

Is there any way to resolve this error

    root@aravinth:~# ls -l /var/lib/dpkg/ /var/lib/apt/lists/
/var/lib/apt/lists/:
total 150320
-rw-r--r-- 1 root root     5425 Dec 11 23:38     
archive.canonical.com_ubuntu_dists_saucy_partner_binary-amd64_Packages
-rw-r--r-- 1 root root     7072 Dec 11 23:38     
 archive.canonical.com_ubuntu_dists_saucy_Release
 -rw-r--r-- 1 root root      933 Dec 11 23:38        
 archive.canonical.com_ubuntu_dists_saucy_Release.gpg
 -rw-r--r-- 1 root root    82659 Nov 25 04:18  
 archive.cloudera.com_cdh4_ubuntu_precise_amd64_cdh_dists_precise-  
 cdh4_contrib_binary-amd64_Packages
 -rw-r--r-- 1 root root    25377 Nov 25 04:18  
 archive.cloudera.com_cdh4_ubuntu_precise_amd64_cdh_dists_precise-  
 cdh4_contrib_source_Sources
 -rw-r--r-- 1 root root     1927 Nov 25 04:18     
 archive.cloudera.com_cdh4_ubuntu_precise_amd64_cdh_dists_precise-cdh4_InRelease
 -rw-r--r-- 1 root root  7082166 Apr 25  2013   
 archive.ubuntu.com_ubuntu_dists_raring_main_binary-amd64_Packages
 -rw-r--r-- 1 root root  3615768 Apr 23  2013     
 archive.ubuntu.com_ubuntu_dists_raring_main_i18n_Translation-en
 -rw-r--r-- 1 root root   647785 Apr 25  2013     
 archive.ubuntu.com_ubuntu_dists_raring_multiverse_binary-amd64_Packages
 -rw-r--r-- 1 root root   394791 Apr 22  2013    
 archive.ubuntu.com_ubuntu_dists_raring_multiverse_i18n_Translation-en
 -rw-r--r-- 1 root root    40778 Apr 25  2013   
 archive.ubuntu.com_ubuntu_dists_raring_Release
 -rw-r--r-- 1 root root      933 Apr 25  2013    
 archive.ubuntu.com_ubuntu_dists_raring_Release.gpg
 -rw-r--r-- 1 root root   153454 Apr 25  2013    
 archive.ubuntu.com_ubuntu_dists_raring_restricted_binary-amd64_Packages
 -rw-r--r-- 1 root root    13233 Apr 19  2013   
 archive.ubuntu.com_ubuntu_dists_raring_restricted_i18n_Translation-en
 -rw-r--r-- 1 root root 29085587 Apr 25  2013    
 archive.ubuntu.com_ubuntu_dists_raring_universe_binary-amd64_Packages
 -rw-r--r-- 1 root root 16871423 Apr 25  2013  
 archive.ubuntu.com_ubuntu_dists_raring_universe_i18n_Translation-en
 -rw-r--r-- 1 root root        0 May  1  2013  
 extras.ubuntu.com_ubuntu_dists_saucy_main_binary-amd64_Packages
 -rw-r--r-- 1 root root        0 May  1  2013     
 extras.ubuntu.com_ubuntu_dists_saucy_main_source_Sources
 -rw-r--r-- 1 root root     9753 May  1  2013  
 extras.ubuntu.com_ubuntu_dists_saucy_Release
 -rw-r--r-- 1 root root       72 Dec 13 13:31    
 extras.ubuntu.com_ubuntu_dists_saucy_Release.gpg
 -rw-r--r-- 1 root root        0 Nov 16 01:18   
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_main_binary-amd64_Packages
 -rw-r--r-- 1 root root        0 Apr 25  2013   
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_main_i18n_Translation-en
 -rw-r--r-- 1 root root        0 Nov 16 01:19    
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_main_source_Sources
 -rw-r--r-- 1 root root        0 Nov 16 01:18    
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_multiverse_binary-amd64_Packages
 -rw-r--r-- 1 root root      816 Nov  7 02:44   
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_multiverse_i18n_Translation-en
 -rw-r--r-- 1 root root     1466 Nov 16 01:19   
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_multiverse_source_Sources
 -rw-r--r-- 1 root root    49615 Nov 16 01:19    
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_Release
 -rw-r--r-- 1 root root      933 Nov 16 01:19  
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_Release.gpg
 -rw-r--r-- 1 root root        0 Nov 16 01:18   
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_restricted_binary-amd64_Packages
 -rw-r--r-- 1 root root        0 Apr 25  2013i  
 n.archive.ubuntu.com_ubuntu_dists_saucy-backports_restricted_i18n_Translation-en
 -rw-r--r-- 1 root root        0 Nov 16 01:19  
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_restricted_source_Sources
 -rw-r--r-- 1 root root      803 Nov 16 01:18   
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_universe_binary-amd64_Packages
 -rw-r--r-- 1 root root      992 Nov 16 01:11  
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_universe_i18n_Translation-en
 -rw-r--r-- 1 root root     1403 Nov 16 01:19   
 in.archive.ubuntu.com_ubuntu_dists_saucy-backports_universe_source_Sources
 -rw-r--r-- 1 root root  7483055 Oct 17 18:06    
 in.archive.ubuntu.com_ubuntu_dists_saucy_main_binary-amd64_Packages
 -rw-r--r-- 1 root root  3818658 Oct 17 05:10   
 in.archive.ubuntu.com_ubuntu_dists_saucy_main_i18n_Translation-en
 -rw-r--r-- 1 root root  4626740 Oct 17 18:08   
 in.archive.ubuntu.com_ubuntu_dists_saucy_main_source_Sources
 -rw-r--r-- 1 root root   655674 Oct 17 18:06   
 in.archive.ubuntu.com_ubuntu_dists_saucy_multiverse_binary-amd64_Packages
 -rw-r--r-- 1 root root   404348 Oct 15 22:16   
 in.archive.ubuntu.com_ubuntu_dists_saucy_multiverse_i18n_Translation-en
 -rw-r--r-- 1 root root   713781 Oct 17 18:12   
 in.archive.ubuntu.com_ubuntu_dists_saucy_multiverse_source_Sources
 -rw-r--r-- 1 root root    49557 Oct 17 18:12   
 in.archive.ubuntu.com_ubuntu_dists_saucy_Release
 -rw-r--r-- 1 root root      933 Oct 17 18:12   
 in.archive.ubuntu.com_ubuntu_dists_saucy_Release.gpg
 -rw-r--r-- 1 root root   139874 Oct 17 18:06   
 in.archive.ubuntu.com_ubuntu_dists_saucy_restricted_binary-amd64_Packages
 -rw-r--r-- 1 root root    14624 Oct 17 04:55 
 in.archive.ubuntu.com_ubuntu_dists_saucy_restricted_i18n_Translation-en
 -rw-r--r-- 1 root root    18029 Oct 17 18:08   
 in.archive.ubuntu.com_ubuntu_dists_saucy_restricted_source_Sources
 -rw-r--r-- 1 root root 30496103 Oct 17 18:06   
 in.archive.ubuntu.com_ubuntu_dists_saucy_universe_binary-amd64_Packages
 -rw-r--r-- 1 root root 17629289 Oct 17 07:05   
 in.archive.ubuntu.com_ubuntu_dists_saucy_universe_i18n_Translation-en
 -rw-r--r-- 1 root root 26368945 Oct 17 18:12   
 in.archive.ubuntu.com_ubuntu_dists_saucy_universe_source_Sources
 -rw-r--r-- 1 root root  1025646 Dec 13 18:05  
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_main_binary-amd64_Packages
 -rw-r--r-- 1 root root   508094 Dec 13 02:05    
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_main_i18n_Translation-en
 -rw-r--r-- 1 root root   256152 Dec 13 18:05   
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_main_source_Sources
 -rw-r--r-- 1 root root     3030 Dec 13 18:05 
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_multiverse_binary-amd64_Packages
 -rw-r--r-- 1 root root     1370 Nov 20 04:49   
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_multiverse_i18n_Translation-en
 -rw-r--r-- 1 root root     3018 Dec 13 18:05 
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_multiverse_source_Sources
 -rw-r--r-- 1 root root    49567 Dec 13 18:05    
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_Release
 -rw-r--r-- 1 root root      933 Dec 13 18:05   
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_Release.gpg
 -rw-r--r-- 1 root root        0 Dec 13 18:05   
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_restricted_binary-amd64_Packages
 -rw-r--r-- 1 root root        0 Apr 25  2013   
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_restricted_i18n_Translation-en
 -rw-r--r-- 1 root root        0 Dec 13 18:05 
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_restricted_source_Sources
 -rw-r--r-- 1 root root   365742 Dec 13 18:05  
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_universe_binary-amd64_Packages

 -rw-r--r-- 1 root root   184100 Dec 13 02:05   
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_universe_i18n_Translation-en
 -rw-r--r-- 1 root root    76410 Dec 13 18:05    
 in.archive.ubuntu.com_ubuntu_dists_saucy-updates_universe_source_Sources
 -rw-r----- 1 root root        0 Dec 13 18:41 lock
 drwxr-xr-x 2 root root     4096 Dec 13 18:42 partial
 -rw-r--r-- 1 root root    15267 Dec 11 18:17  
 ppa.launchpad.net_webupd8team_java_ubuntu_dists_saucy_main_binary-amd64_Packages
 -rw-r--r-- 1 root root    11882 Dec 11 18:17   
 ppa.launchpad.net_webupd8team_java_ubuntu_dists_saucy_Release
 -rw-r--r-- 1 root root      316 Dec 11 18:17    
 ppa.launchpad.net_webupd8team_java_ubuntu_dists_saucy_Release.gpg
 -rw-r--r-- 1 root root   296000 Dec 13 18:05 
 /var/lib/dpkg/:
 total 28
 drwxr-xr-x 2 root root 4096 Dec 13 13:12 alternatives
 -rw-r--r-- 1 root root    0 Dec 13 13:12 dpkg.status.0
 drwxr-xr-x 2 root root 4096 Dec 13 13:12 info
 -rw-r----- 1 root root    0 Dec 13 14:35 lock
 drwxr-xr-x 2 root root 4096 Dec 13 13:12 methods
 drwxr-xr-x 2 root root 4096 Dec 13 13:12 parts
 drwxr-xr-x 2 root root 4096 Dec 13 13:50 status
 drwxr-xr-x 2 root root 4096 Dec 13 13:12 triggers
 drwxr-xr-x 2 root root 4096 Dec 13 13:12 updates
share|improve this question
1  
Did you try an apt-get update? –  frlan Dec 13 '13 at 12:43
    
Getting the same error after apt-get update –  Aravinth Dec 13 '13 at 12:49
    
Is /var/lib/apt/lists there? If not, please create it with sudo mkdir -p /var/lib/apt/lists/ and rerun apt-get clean && apt-get update –  frlan Dec 13 '13 at 12:53
    
still the same error –  Aravinth Dec 13 '13 at 13:07
    
Edit your question and add the output of ls -l /var/lib/dpkg/ /var/lib/apt/lists/. –  Braiam Dec 13 '13 at 13:11

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.