3

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?

5 Answers 5

14

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
1
  • 2
    For Ubuntu 16.04 xenial. ubuntu software --> Software & updates(From Menu) --Download from the drop down select a different server. Jan 1, 2019 at 18:08
6

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.

0
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

1
  • apt-key update solves my problem. Oct 15, 2019 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 !!

1
  • 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, 2016 at 12:04
0

I had this situation with a different archive. Finding and removing a 0 byte file from /var/lib/apt/lists fixed the problem for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .