Where Are the apt-get Repo Configuration Files for a Debian/Ubuntu Linux Server?

Problem scenario
You run an apt-get command, and you get an error about a .deb file's source not being found.  For example you try to run an apt-get command to install a package, but you are blocked by this error:
"E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/postgresql-9.5/libpq-dev_9.5.6-0ubuntu0.16.04_amd64.deb  404  Not Found [IP:..."

An updated version for the deb file may have superseded the older version.  Or the repository server's hostname may have changed or its IP address has changed.  You want to change where your Ubuntu server retrieves files from, how do you do this?

Possible solution #1
As root or with a "sudo " in front of it, run this command:  "apt-get update"
Possible solution #2
Update /etc/apt/sources.list to point to new repositories.
Possible solution #3
Update your /etc/resolv.conf files or /etc/hosts file.  The IP address of the source of the repositories may have changed.

Leave a comment

Your email address will not be published. Required fields are marked *