This question already has an answer here:

I am trying to install nodejs but it keeps on failing. So I have uninstalled nodejs and found out that sudo apt-get update still fails. It's been so long that I have used postgresql. but here is my error during sudo apt-get update:

  Get:41 http://ph.archive.ubuntu.com vivid-updates/universe Translation-en [81.6 kB]                                                        
Err http://apt.postgresql.org precise-pgdg InRelease                                                                                       

Err http://apt.postgresql.org precise-pgdg Release.gpg
  Cannot initiate the connection to apt.postgresql.org:80 (2a00:f10:111:50::228). - connect (101: Network is unreachable) [IP: 2a00:f10:111:50::228 80]
Fetched 14.4 MB in 6min 3s (39.5 kB/s)
Reading package lists... Done
W: Failed to fetch http://apt.postgresql.org/pub/repos/apt/dists/precise-pgdg/InRelease  

W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release  Unable to find expected entry 'main/binary-i386/Packages' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://ppa.launchpad.net/chris-lea/node.js/ubuntu/dists/vivid/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/chris-lea/node.js/ubuntu/dists/vivid/main/binary-i386/Packages  404  Not Found

W: Failed to fetch http://apt.postgresql.org/pub/repos/apt/dists/precise-pgdg/Release.gpg  Cannot initiate the connection to apt.postgresql.org:80 (2a00:f10:111:50::228). - connect (101: Network is unreachable) [IP: 2a00:f10:111:50::228 80]

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

As you can see, the first line succeeded and the rest of updates above it. The error started on the second line. I do not know where else to go. Please help me. I could not proceed with anything since sudo apt-get update has a problem.

marked as duplicate by karel, Eric Carvalho, amc, Fabby, Zanna Nov 5 '16 at 19:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


What caused the problem

Checking out ppa.launchpad.net/chris-lea/node.js/ubuntu/dists/, vivid is not a child directory, meaning it is not supported. This is because ubuntu 15.04 vivid vervet is at it's end of life (see wiki.ubuntu.com/Releases#End_of_life).

Solution 1: Upgrade your Ubuntu OS to 16.04. This version should be stable for a long time (~2021), and so is likely to remain supported by Node for a similar duration. Then you'd have to update the ppa you're using and sudo apt-get update.

Still, that's a lot of work. You could try

Solution 2: install from source or debian packages. The instructions on nodejs.org seem pretty comprehensive. I want to say installing from debian packages from nodesource worked for me on ubuntu 15.04, but honestly I might have used

Solution 3: use nvm to upgrade. Instructions can be found here.

  • No the problem was caused by a network error on apt.postgresql.org. All the other messages are warnings. -1 – David Foerster Nov 4 '16 at 10:45

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