2

After upgrading from 15.10 to 16.04, I am receiving the following error on apt-get update:

Reading package lists... Done
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/source/Sources  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/source/Sources  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/multiverse/source/Sources  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/binary-amd64/Packages  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/binary-i386/Packages  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/i18n/Translation-en  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/binary-amd64/Packages  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/binary-i386/Packages  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/i18n/Translation-en  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/multiverse/binary-amd64/Packages  Empty files can't be valid archives
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/multiverse/binary-i386/Packages  Empty files can't be valid archives
E: Some index files failed to download. They have been ignored, or old ones used instead.

Does anyone know how to solve this error?

11

Go to "Ubuntu Software Center->Edit->Software Source"
select from "Download From" and choose "Other..." and click "Select Best Server". It will take some time... And it comes up with best server for you. Then chose that server and type command below again,

sudo apt-get update
  • 2
    For Ubuntu 16.04 xenial. ubuntu software --> Software & updates(From Menu) --Download from the drop down select a different server. – Yuvaraj Loganathan Jan 1 at 18:08
5

I was getting this for the past few months after upgrading, but just running:

apt-get clean

fixed it. No need for changing the source servers as others have suggested.

5
apt-get clean

worked for me in conjunction with:

apt-key update

and following the steps found in this answer:

Cannot solve GPG error

  • apt-key update solves my problem. – Jiangwei Yu Oct 15 at 11:13
4

Solved using this:

sudo cd /etc/apt
sudo mv sources.list sources.list.ok

sudo echo <<EOF
deb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-security main restricted universe multiverse
EOF > sources.list

sudo apt-get clean
sudo apt-get update

After update and upgrade, you can revert your sources.list to original !!

  • 2
    This solved my issue but a little more context would be helpful to understand why this problem is happening and what does this mirror thing do to fix it... – madpoet Sep 19 '16 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.