404 failed to fetch package [duplicate]

Solution 1:

It may be best that you reset your sources.list to the default. Replace what's in /etc/apt/sources.list entirely with:

###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ utopic main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ utopic main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ utopic-security main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ utopic-updates main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ utopic-security main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ utopic-updates main restricted universe multiverse 

###### Ubuntu Partner Repo
deb http://archive.canonical.com/ubuntu utopic partner
deb-src http://archive.canonical.com/ubuntu utopic partner

###### Ubuntu Extras Repo
deb http://extras.ubuntu.com/ubuntu utopic main
deb-src http://extras.ubuntu.com/ubuntu utopic main

Then do sudo apt-get update and the 404's should stop.

Backup sources.list before you do something destructive like an in-place sed replace on it in the future (e.g. sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup.

Hope that helps!

NOTE: I used http://repogen.simplylinux.ch/ to generate the above sources loosely based off your current sources.list — check it out if you want to tweak it.

Solution 2:

The issue is that 14.10 isn't maintained anymore.

I followed https://smyl.es/how-to-fix-ubuntudebian-apt-get-404-not-found-package-repository-errors-saucy-raring-quantal-oneiric-natty/ and it worked:

Normal Ubuntu releases are supported for 9 months, whereas LTS (Long Term Support) releases are supported for 5 years. Once support is up for the version of Ubuntu you are using the repository is moved to another server and will no longer be available on the standard http://archive.ubuntu.com/ubuntu/dist/ location.

Run this command below on your server and it will replace all of the archive.ubuntu.com and security.ubuntu.com package repository URLs with old-releases.ubuntu.com

sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

My /etc/apt/sources.list contains:

deb http://old-releases.ubuntu.com/ubuntu utopic main universe