I just started Raspberry pi and was ordered to get vim installed. However whenever I run sudo apt-get install vim I get the following errors:

Err:1 http://raspbian.raspberrypi.org/raspbian stretch/main armhf vim-runtime all 2:8.0.0197-4+deb9u1 Connection failed [IP: 80] E: Failed to fetch

http://raspbian.raspberrypi.org/raspbian/pool/main/v/vim/vim_8.0.0197-4+deb9u1_armhf.deb Connection failed [IP: 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

So this time I run sudo apt-get update which works perfectly (unlike Ubuntu, typing sudo isn't asking me password)

Then I do sudo apt-get upgrade. which returns 83 errors, I paste here some of them:

Err:1 http://raspbian.mirror.net.in/raspbian/raspbian stretch/main armhf base-files armhf 9.9+rpi1+deb9u8 403 Forbidden


E: Failed to fetch http://raspbian.mirror.net.in/raspbian/raspbian/pool/main/b/base-files/base-files_9.9+rpi1+deb9u8_armhf.deb 403 Forbidden

Research from my side tells me that I should do this:

sudo rm /var/lib/dpkg/status

sudo touch /var/lib/dpkg/status

but I don't have any /dpkg in my /lib

Solution 2 that didn't work for me:

edit /etc/apt/sources.list and replace http://mirrordirector.raspbian.org/raspbian with a mirror address from https://www.raspbian.org/RaspbianMirrors (from the website: https://www.raspberrypi.org/forums/viewtopic.php?t=123260)

because my source.list file looks nothing like mentioned above, so I didn't messed with it.

  • Did you intentionally word wrap the text? It is almost unreadable.
    – RalfFriedl
    Mar 8, 2019 at 7:27
  • @RalfFriedl sorry, I did. I thought it will make errors more stand out and easy to read. It turned out to be a bad idea. I'm editing it
    – Breakpoint
    Mar 8, 2019 at 7:31
  • Try again there's been some Raspbian mirroring problems this week. You'll also want vim-full to get all of the sensible vim options working.
    – Dougie
    Mar 8, 2019 at 7:42
  • Thankyou @Dougie. I have been trying for last three hours. Right now, I'll report this error as something at their (raspberry pi)end. I hope it works soon!
    – Breakpoint
    Mar 8, 2019 at 7:44
  • I have same issue and in my case it was caused by application firewall Fortinet which block traffic to repository sites.
    – Rohlik
    Jan 29, 2022 at 14:38

1 Answer 1


Maybe your package list files are messed. You can try to reinitialize them. You can do it by deleting the list files but that is the brute force method. I suggest to do it under control of the package manager so it has a chance to notice the changes. How to do it you can look at Raspberry Pi sudo apt-get update not working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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