1

I have been trying to install npm on a server running Ubuntu 20.04 and I keep getting 403 Forbidden for the npm package

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/n/npm/npm_6.14.4+ds-   1ubuntu2_all.deb  403  Forbidden [IP: 91.189.88.152 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Installing other software, like for example nodejs, worked fine, so I suspected it might've been just a server issue. I've tried again today, several days after my first attempt, but no luck.
I've changed the mirrors from my local repositories (AU) to the main one, and then tried also with third country (US), but I still get 403.

Running sudo apt upgrade --fix-missing also results in a 403 error:

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-5.4.0-65-generic_5.4.0-65.73_amd64.deb  403  Forbidden [IP: 91.189.88.142 80]

I've also cleaned up the lists by running sudo rm /var/list/apt/lists/* -rf but that didn't help either.

Any suggestion would be appreciated, I'm not sure where to go fro here.

Vito
  • 11

2 Answers2

0

One of the answers to this post suggests that it could be due to a corrupted partial dowload. Try sudo rm -r /var/cache/apt/archives/partial

Also, make sure you have done a sudo apt update recently.

  • I have been running sudo apt update after every change of the sources.list file, the IP of the servers that respond 403 is not always the same. Deleting partially downloaded packages did not help, I still get 403 for npm. – Vito Jan 31 '21 at 23:24
0

It turned out the firewall in the offic was blocking some packages because they had .cmd files in them, and npm was one of these. Once the system admin found that rule I was able to install npm.

Vito
  • 11