Friday, August 12, 2016

A “failed to fetch” error occurs when apt-get update is run. How do I fix this?

I was facing the same problem and figured the easiest solution is to reset the sources of /etc/apt/sources.list. To do so, follow these steps:
  1. Obtain the release of your Ubuntu version, type into the console:
    lsb_release -r
  2. Go to to generate a new sources.list
  3. Select your country & release
  4. Check the first 12 boxes:
    All Ubuntu Brances + Security & Updates
  5. Generate and copy your new list
  6. Backup the old file to sources.list.old
    mv /etc/apt/sources.list /etc/apt/sources.list.old
  7. Open vim to save the new list
    vi /etc/apt/sources.list
  8. Paste and save using :wq
  9. G2G, retry running apt-get update

If you are getting below error then remove broken repository.

W: The repository ' xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.

$ sudo add-apt-repository --remove ppa:colingille/freshlight
 This PPA contains my free softwares.
 More info:
Press [ENTER] to continue or ctrl-c to cancel removing it

No comments:

Post a Comment