0

for the millionth time guys this isn't a duplicate question and if it is, them all the solutions don't work for me. i have seen this issue in a newly installed system. I tried all the things provided on the internet including creating a new sources.list, deleted the entries of list.d folder, but when I try to run the apt-get update command I get the following:

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release 
Unable to find expected entry 'restricted/source/Sources' in Release file (Wrong sources.list entry or malformed file)

here is the sources.list

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

deb http://security.ubuntu.com/ubuntu/ trusty-security universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu trusty-updates universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu trusty-backports universe main multiverse restricted

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

# deb http://extras.ubuntu.com/ubuntu trusty main
# deb-src http://extras.ubuntu.com/ubuntu trusty main
  • sorry for the typos, have been up for hours now and i am really tired. its sources.list. i even forget the etiquette of saying please. anyway guys please help me out.. – wachira nicholus Sep 22 '15 at 09:06
  • @pilot6 trust me it ain't a duplicate. have replaced the sources.list a million times with the same error. maybe there is another way you can assist. – wachira nicholus Sep 22 '15 at 09:12
  • 1
    Maybe you want to modify (click edit) your question to include the sources.list file – Bruni Sep 22 '15 at 09:29
  • @Bruni seems like i can't post the content of the file..i need some reputation – wachira nicholus Sep 22 '15 at 09:52
  • 1
    @wachiranicholus You can just [edit] your question and add the content of the file. You may open it with your favourite text editor to get the content, or you may dump it in the terminal using the cat command: cat /etc/apt/sources.list and copy from there by selecting the text with the mouse and using right-click/copy (context menu) or STRG+INS. Do not use STRG+C!. – Byte Commander Sep 22 '15 at 10:07

3 Answers3

0
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release 

as the warning suggests its unable to fetch that url. Its your network issue. Not a source.list issue. Check if you have a working internet connection. Are you on a network that needs you to set proxy manually ? In such cases sudo apt-get update fails if proxy is not set properly for the sudo environment.

  • if it was a network issue i don't see how it can fetch other urls and fail with that specific one sir. ..ping works fyn anyways..thanks for the attempt i can use another brainstorm from you though.. – wachira nicholus Sep 22 '15 at 16:42
  • 1
    could you please send a full log the update command and the output , and result of the command curl http://archive.ubuntu.com/ubuntu/dists/trusty/Release -o /tmp/aucr123 – hrushikesh Sep 23 '15 at 07:12
0

Have you tried this

   alther the sources.list file whit gedit

and then type this in the bottom

   deb http://archive.ubuntu.com/ubuntu/dists/trusty/Release
   # deb-src http://archive.ubuntu.com/dists/trusty/Release

and it might work fine this way.

Michael
  • 2,499
  • 5
  • 19
  • 24
  • as you can see there is no entry of deb-src http://archive.ubuntu.com/dists/trusty/Release or deb http://archive.ubuntu.com/ubuntu/dists/trusty/Release in my sources.list maybe it is related to another url in there its not one of the ones available. – wachira nicholus Sep 22 '15 at 16:49
  • Delete the sources.list file and use the other sources file, and simple rename it to sources.list. – Michael Sep 22 '15 at 19:32
-2

Use this

http://us.archive.ubuntu.com/ubuntu/dists/trusty/Release

Instead of this

http://archive.ubuntu.com/ubuntu/dists/trusty/Release

or Change DNS to google DNS or Open DNS

Goolge DNS

8.8.8.8

8.8.4.4

Openn DNS

208.67.222.222

208.67.220.220

or you still face problem see this Community help

https://help.ubuntu.com/community/Repositories/Ubuntu
  • Why? http://archive.ubuntu.com/ubuntu/dists/trusty/Release is valid too. – Oli Sep 22 '15 at 09:55
  • that address in the error is not in my sources.list file. how do i use the address you advised? – wachira nicholus Sep 22 '15 at 09:56
  • Yes @Oli Its Valid address but some time DNS does not resolve address.....thats why i suggest to use http://us.archive.ubuntu.com/ubuntu/dists/trusty/Release – Ayog Rai Sep 22 '15 at 10:04
  • @wachiranicholus

    please add the link in your source list

    Open terminal

    sudo gedit /etc/apt/sources.list

    and add the following line

    deb http://us.archive.ubuntu.com/ubuntu/dists/trusty/Release

    or just put us before archive

    http://archive.ubuntu.com/ubuntu/dists/trusty/Release

    – Ayog Rai Sep 22 '15 at 10:04
  • @Rai thanks for the replies but how to i use the address, append it the sources.list or what? – wachira nicholus Sep 22 '15 at 10:08
  • If the old host was not reachable, the error would have been different. According to Oli, this will not change anything. It's the syntax of the sources.list file that is wrong and not the used address! – Byte Commander Sep 22 '15 at 10:08
  • edit source list file with gedit editor

    path = /etc/apt/sources.list

    just put (us) in following un commented (#) line in file

    like this

    deb http://archive.ubuntu.com/ubuntu/dists/trusty/Release without comment

    change this too deb http://us.archive.ubuntu.com/ubuntu/dists/trusty/Release

    – Ayog Rai Sep 22 '15 at 10:18
  • but first change DNS – Ayog Rai Sep 22 '15 at 10:21
  • @Rai thanks for the replies, i have added the address in the sources.list but when i try to update it returns an error about a malformed line 13 in the sources.list file. have tried several tweaks on the address but it doesn't work – wachira nicholus Sep 22 '15 at 10:25
  • @wachiranicholus

    see this-----------> http://askubuntu.com/questions/78951/how-do-i-remove-a-malformed-line-from-my-sources-list

    – Ayog Rai Sep 22 '15 at 10:38
  • @Rai have tried those suggestions and none works – wachira nicholus Sep 22 '15 at 16:50