简体   繁体   中英

sudo apt-get update fails on postgresql

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.

Try this:

sudo apt-get update

sudo apt-get install -y build-essential

sudo apt-get install curl

curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM