3

I am trying to use apt-get to install lynx. However I am having issues with the repositories.

This is what my sources.list looks like:

#deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
deb http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi

What I have tried:

$sudo rm /var/lib/apt/lists/* -vf
$sudo rm /var/lib/dpkg/status
$sudo rm /var/lib/dpkg/status

Sometimes the index files updated ok, more often I get something like this:

Get:1 http://archive.raspbian.org wheezy InRelease [12.5 kB]
Get:2 http://archive.raspberrypi.org wheezy InRelease [7,737 B]
Get:3 http://archive.raspbian.org wheezy/main Sources [6,234 kB]  
Get:4 http://archive.raspberrypi.org wheezy/main armhf Packages [6,413 B]
Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB                                     
Ign http://archive.raspberrypi.org wheezy/main Translation-en                                        
Get:5 http://archive.raspbian.org wheezy/contrib Sources [52.7 kB]                                   
Get:6 http://archive.raspbian.org wheezy/non-free Sources [97.1 kB]                                  
Err http://archive.raspbian.org wheezy/non-free Sources                                              
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/rpi Sources                                                   
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/main armhf Packages                                           
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/contrib armhf Packages                                        
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/non-free armhf Packages                                       
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/rpi armhf Packages                                            
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/contrib Translation-en_GB                                     
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/contrib Translation-en                                        
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/main Translation-en_GB                                        
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/main Translation-en                                           
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/non-free Translation-en_GB                                    
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/non-free Translation-en                                       
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/rpi Translation-en_GB                                         
  Unable to connect to archive.raspbian.org:http:
Err http://archive.raspbian.org wheezy/rpi Translation-en                                            
  Unable to connect to archive.raspbian.org:http:
Fetched 6,313 kB in 44s (143 kB/s)                                                                   
W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/non-free/source/Sources  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/rpi/source/Sources  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/main/binary-armhf/Packages  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/contrib/binary-armhf/Packages  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/non-free/binary-armhf/Packages  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/rpi/binary-armhf/Packages  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/contrib/i18n/Translation-en_GB  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/contrib/i18n/Translation-en  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/main/i18n/Translation-en_GB  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/main/i18n/Translation-en  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/non-free/i18n/Translation-en_GB  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/non-free/i18n/Translation-en  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/rpi/i18n/Translation-en_GB  Unable to connect to archive.raspbian.org:http:

W: Failed to fetch http://archive.raspbian.org/raspbian/dists/wheezy/rpi/i18n/Translation-en  Unable to connect to archive.raspbian.org:http:

E: Some index files failed to download. They have been ignored, or old ones used instead.

Sometimes I am able to update apt-get alright, but the majority of the time I am not able without any errors. In any case I am not able install lynx.

EDIT:

I just ran sudo apt-get install again and was able to update apt-get:

Hit http://archive.raspbian.org wheezy InRelease
Hit http://archive.raspberrypi.org wheezy InRelease
Hit http://archive.raspberrypi.org wheezy/main armhf Packages
Hit http://archive.raspbian.org wheezy/main Sources
Hit http://archive.raspbian.org wheezy/contrib Sources
Hit http://archive.raspbian.org wheezy/non-free Sources
Hit http://archive.raspbian.org wheezy/rpi Sources
Get:1 http://archive.raspbian.org wheezy/main armhf Packages [7,387 kB]
Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB                                                                                             
Ign http://archive.raspberrypi.org wheezy/main Translation-en                                                                                                
Get:2 http://archive.raspbian.org wheezy/contrib armhf Packages [23.3 kB]                                                                                    
Get:3 http://archive.raspbian.org wheezy/non-free armhf Packages [47.7 kB]                                                                                   
Get:4 http://archive.raspbian.org wheezy/rpi armhf Packages [14 B]                                                                                           
Ign http://archive.raspbian.org wheezy/contrib Translation-en_GB                                                                                             
Ign http://archive.raspbian.org wheezy/contrib Translation-en
Ign http://archive.raspbian.org wheezy/main Translation-en_GB
Ign http://archive.raspbian.org wheezy/main Translation-en
Ign http://archive.raspbian.org wheezy/non-free Translation-en_GB
Ign http://archive.raspbian.org wheezy/non-free Translation-en
Ign http://archive.raspbian.org wheezy/rpi Translation-en_GB
Ign http://archive.raspbian.org wheezy/rpi Translation-en
Fetched 6,929 kB in 58s (118 kB/s)               
Reading package lists... Done

However when I run sudo apt-get install lynx I get:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  file gcc-4.7-base libbsd0 libbz2-1.0 libc-bin libc6 libgcc1 libgcrypt11 libgnutls26 libgpg-error0 libgpm2 libidn11 libmagic1 libncursesw5 libp11-kit0
  libtasn1-3 libtinfo5 lynx-cur mime-support multiarch-support zlib1g
Suggested packages:
  glibc-doc debconf debconf-2.0 locales rng-tools gpm
The following NEW packages will be installed:
  file gcc-4.7-base libbsd0 libbz2-1.0 libc-bin libc6 libgcc1 libgcrypt11 libgnutls26 libgpg-error0 libgpm2 libidn11 libmagic1 libncursesw5 libp11-kit0
  libtasn1-3 libtinfo5 lynx lynx-cur mime-support multiarch-support zlib1g
0 upgraded, 22 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,428 kB/10.2 MB of archives.
After this operation, 24.5 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://archive.raspbian.org/raspbian/ wheezy/main lynx-cur armhf 2.8.8dev.12-2 [2,205 kB]
Get:2 http://archive.raspbian.org/raspbian/ wheezy/main lynx all 2.8.8dev.12-2 [223 kB]
Fetched 2 B in 2s (0 B/s)       
Failed to fetch http://archive.raspbian.org/raspbian/pool/main/l/lynx-cur/lynx-cur_2.8.8dev.12-2_armhf.deb  rename failed, Input/output error (/var/cache/apt/archives/partial/lynx-cur_2.8.8dev.12-2_armhf.deb -> /var/cache/apt/archives/lynx-cur_2.8.8dev.12-2_armhf.deb).
Failed to fetch http://archive.raspbian.org/raspbian/pool/main/l/lynx-cur/lynx_2.8.8dev.12-2_all.deb  rename failed, Input/output error (/var/cache/apt/archives/partial/lynx_2.8.8dev.12-2_all.deb -> /var/cache/apt/archives/lynx_2.8.8dev.12-2_all.deb).
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Edit:

When I type ls in /var/cache/apt/archives I receive this error:

ls: cannot access lynx-cur_2.8.8dev.12-2_armhf.deb: Input/output error
ls: cannot access lynx_2.8.8dev.12-2_all.deb: Input/output error

I am thinking the file system can be corrupt possibly by a bad reboot?

goldilocks
  • 58,849
  • 17
  • 112
  • 227
Richard
  • 471
  • 2
  • 5
  • 9
  • Is /var full or near full? I would check your disk space. – Munkeh Dec 20 '12 at 17:43
  • @Munkeh, 2.1G available, however I think the file system may be corrupt... See edits above – Richard Dec 20 '12 at 18:27
  • 2
    Run fsck on the drive with the SD card plugged into another machine. My initial thoughts were the I/O errors being the filesystem full, but a corrupt filesystem is more likely. – Munkeh Dec 20 '12 at 18:34
  • @Munkeh I was worried that was going to be your answer. Device is at a remote site. I will have to fix in the new year I guess. At least we narrowed the issue – Richard Dec 20 '12 at 18:38
  • @Munkeh Found info on how to fsck remotely: I will have to try this after holidays. Many thanks for yoru help http://serverfault.com/questions/62976/fsck-root-filesystem-on-a-remote-machine – Richard Dec 20 '12 at 19:15

2 Answers2

5

You are using the central archive, instead of a mirror. You should get better results from a mirror, and that will help with your intermittent updating problems.

However, this is not the cause of the I/O errors, which is probably either file-system corruption or a bad SD-Card.

Lukas Knuth
  • 949
  • 2
  • 7
  • 19
umeboshi
  • 161
  • 2
3

I have seen this several times before when I forget to expand the root FS to fill the SD card.

If you are running either on a 2GB only SD card or you are on the base install and you have not expanded your root FS you should be able to run df -k and see that the rootfs is 100% used.

If this is not the case then corruption or a bad SD card is likely the problem, as described already.

hifkanotiks
  • 1,901
  • 3
  • 16
  • 28
Robert
  • 271
  • 1
  • 1