-1

Doing $ sudo apt-get update gives E: Some index files failed to download. They have been ignored, or old ones used instead.. After doing some digging i found this Cannot connect to mirrordirector.raspbian.org which explains that there is a DNS issue with mirrordirector, and to change the source in /etc/apt/sources.list.

I did so and my /etc/apt/sources.list went from looking like this

deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi

to looking like this

#deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi
deb http://mirror.ox.ac.uk/sites/archive.raspbian.org/archive/raspbian/

but this gave the error

E: Malformed line 4 in source list /etc/apt/sources.list (dist)
E: The list of sources could not be read.

I tried fixing it by adding wheezy main contrib non-free rpi after the new source, but that just gave E: Some index files failed to download. They have been ignored, or old ones used instead.

I did also try uncommenting deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi but that just gave the same error again

I also did ping -c 1 8.8.8.8 and that gave

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=54 time=36.6 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 36.601/36.601/36.601/0.000 ms
ElkOnurb
  • 11
  • 1
  • 2
  • It's not clear here whether DNS is working generally or not; the fact that the error is different implies it is, but to test that you need to ping google.com, a hostname, not an IP address. – goldilocks Mar 07 '20 at 15:14
  • pig google.com gives PING google.com (216.58.211.174) 56(84) bytes of data. 64 bytes from lhr48s13-in-f14.1e100.net (216.58.211.174): icmp_req=1 ttl=54 time=16.3 ms. I can access the internet through my raspberry pi, but sometimes when trying to open a link I get SSH handshake failed – ElkOnurb Mar 07 '20 at 15:26
  • 2
    Don't bother! Wheezy is obsolete. There will NEVER be any updates. – Milliways Mar 07 '20 at 21:10

1 Answers1

3

Raspbian Wheezy is deprecated and not supported since years. Its repository is archived and you cannot use it anymore. It's not a DNS issue, it's simply not available. Try to address the archived repository with this entry in /etc/apt/sources.list:

deb http://legacy.raspbian.org/raspbian/ wheezy main contrib non-free rpi
Ingo
  • 42,107
  • 20
  • 85
  • 197