Please find the attached snip, for the complete error message. This is the second time I've faced this issue, last time it happened I tried couple of different things updating source list file or apt-get clean but was of no utter use. I gave up and woke up next morning it worked effortlessly. I'm from India, so is this possible some server might be down or could be ISP's issue? Is this issue specific to Raspbian Jessie? Suggest any resolution for this?
I had an issue with the error you have on the last line of your error log "E: Some index files failed ..."
For me, this was caused by an entry in the /etc/dhcpcd.conf file. Basically, I opened this file and noticed that the WiFi static IP address setup was incorrect ...
interface wlan0 static ip_address=192.168.0.32/24 static routers=192.168.0.1 static domain_name_servers=192.168.0.1.
Notice the full stop on the end of the last line:
static domain_name_servers=192.168.0.1. <=====
I simply removed the full stop and saved the file, restarted the Pi and all worked good.
I used the command "sudo nano /etc/dhcpcd.conf" (without the quoted) to enable me to edit this file. I suspect there are probably cleaner ways of making this change, but for me, this did the job! :D
This same problem often happens to me when my Raspberry Pi's system time is too far off from the actual UTC time, as it usually is when I first try to do a
sudo apt-get update. This is because the Raspberry Pi doesn't have a hardware clock and needs needs to use ntp to sync up.
Try running the
date command on your Raspberry Pi to see if its system time is more than a few minutes off from UTC time (which can be found here).
If it is, you can run this command to sync back up:
sudo sntp -s time.google.com
You may also need to run
sudo rm -rf /var/lib/apt/lists/partial
sudo apt-get update
I have been facing this issue for a while and finally I figured out. Here I just want to post my approach even if the question is old.
Let's clean some temporary files:
sudo apt-get clean sudo rm /var/lib/apt/lists/partial/*
Then, we can uncomment some a line from:
sudo nano /etc/apt/sources.list
In my case, the file was like this:
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi # Uncomment line below then 'apt-get update' to enable 'apt-get source' # deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
As you can see from above, i was asked to uncomment and i did it.
Updating public key:
wget https://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add -
Please, pay attention for https and then everything went smooth.
sudo apt-get update