6

I im trying to do

sudo apt-get update

but i get the following error:

W: Failed to fetch http://ftp.udc.es/ubuntu/dists/trusty/Release  Unable to find   expected entry 'main/binary-x8-64/Packages' in Release file (Wrong sources.list entry or malformed file)

I have tried resetting the /etc/apt/sources.list like is here suggested:

How do I restore the default repositories?

And also tried to select another server from which to download the updates: 'sudo apt-get update' error on Ubuntu 12.04

But I keep getting the same damned error message. Any ideas?

As asked in comment, doing:

$ grep -R ftp.udc.es /etc/apt/sources.list*
/etc/apt/sources.list:deb http://ftp.udc.es/ubuntu/ trusty main universe
/etc/apt/sources.list.save:deb http://ftp.udc.es/ubuntu/ trusty main

$ cat sources.list
## See sources.list(5) for more information, especialy
# Remember that you can only use http, ftp or file URIs
deb http://ftp.udc.es/ubuntu/ trusty main universe
# CDROMs are managed through the apt-cdrom tool.

$ dpkg --print-architecture 
amd64
$ dpkg --print-foreign-architectures
i386 
x8664
x8-64
x864
gmm
  • 162

3 Answers3

6

As can be seen from the output of dpkg --print-foreign-architectures, you have a bunch of invalid architectures added, for some reason. Remove them:

sudo dpkg --remove-architecture x8664
sudo dpkg --remove-architecture x8-64
sudo dpkg --remove-architecture x864

In future, do check what you're adding.

muru
  • 197,895
  • 55
  • 485
  • 740
2

Try adding these to your /etc/apt/sources.list . These are the us repositories.

deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted

deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

deb http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe

deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse

deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner

you might get the error because Canonical has deprecated 14.04 ( before being blessed LTS) . If you are not on LTS then you should upgrade to 14.04.01 LTS.

You do that by running sudo do-release-upgrade

  • Im at 14.04.01, sorry. i did the command that you suggested anyway and got: Checking for a new Ubuntu release No new release found – gmm Feb 26 '15 at 15:56
  • Can you try this on plain command line: curl http://ftp.udc.es/ubuntu/dists/trusty/Release – user283885 Feb 26 '15 at 15:58
  • I did it but update keeps failing – gmm Feb 26 '15 at 16:00
  • I'm asking if curl says 404 page not found? I'm trying to see if your IP is not blocked. The repo is accessible from this side of the world. – user283885 Feb 26 '15 at 16:01
  • 1
    No it doesnt, it returns the MD5 sum, a number and the name – gmm Feb 26 '15 at 16:03
  • Doing that gives more errors (I cant put all of them, but they are all alike):
    W: Failed to fetch http://archive.canonical.com/ubuntu/dists/trusty/Release Unable to find expected entry 'deb-src/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)
    – gmm Feb 26 '15 at 16:10
  • I've added a copy of the us repositories you can add to sources. After you add them, run sudo apt-get updated and then retry to install. – user283885 Feb 26 '15 at 16:10
  • Could you check for typos in your file? I've pasted a copy of my working /etc/apt/sources.list . – user283885 Feb 26 '15 at 16:13
  • I commented my file (the one line in it, and used yours, and still get lots of errors, (like the one in the last comment) – gmm Feb 26 '15 at 16:15
  • sorry, can't think of anything else. I'd dare say try do-release-upgrade -d, but that WILL UPGRADE to the current DEVELOPMENT version. – user283885 Feb 26 '15 at 16:25
  • After a lot of researches, I tried both (adding the repos and upgrade). This fixed my problem! Thanks to share this. – Blo Apr 12 '16 at 12:30
0

Go to Software and Update, and in Ubuntu Software tab, change the download location to Select best server. It will update the cache and after that, youer done. Then try apt-get update.

Jens Erat
  • 5,051
  • 7
  • 31
  • 37
Sushil
  • 1