Ubuntu apt-get update does not work

If you are working with a old version of Ubuntu that has reached the end of their support (EOL – end of life). You can be got a error when you use apt-get command like the below:

There are some reasons make apt-get command do not work, e.g: no internet connection, not correct DNS server, …. However, in this article, I just talk about the reason come from the version of Ubuntu that has reached the end of the support. It means the original repositories are closed and no longer able to install software. So you have to set the repository list so that it references to the server – old releases.ubuntu.com (as show below).

Firstly, check your version of Ubuntu:

Or

Now, open the repository list file /etc/apt/source.list and replace all the code by:

Taking care to replace the term CODENAME with the code name for the version of Ubuntu derived in the previous step. (e.g: raring)

After done editing sources.list,  type:

You are done.