15

I am trying to use

sudo apt-get update
But i am getting error as,

W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release  Unable to find expected entry 'main/binary-i386/Packages' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead. 

I tired the solution given in https://askubuntu.com/questions/120621/how-to-fix-duplicate-sources-list-entry, but again showing the same error. Suggest me something.

7 Answers 7

25

It looks like Google has discontinued support for i386, which is why this error now shows up. It looks like they have not gracefully for how their deb install has configured apt. To fix this run the following.

sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-chrome.list"

Source: https://www.reddit.com/r/chrome/comments/48oje6/linux_how_to_fix_failed_to_fetch/

Edit: As has been pointed out by others, another command is needed to prevent this fix from reverting. Since this is at the top as the accepted answer I feel it should be part of this answer.

sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/opt/google/chrome/cron/google-chrome"
5
  • ...thank you very much... that problem got solved now. Actually in my OS there was no file named "google-chrome.list "but there was a file named "google.list " . So simply i changed the filename in the command you gave. Now its working fine. <br/> <pre><code> sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google.list" </code></pre>
    – krocks
    Mar 4, 2016 at 6:13
  • @krocks, which OS are you using? Mar 4, 2016 at 22:37
  • I am using Ubuntu 14.04LTS
    – krocks
    Mar 8, 2016 at 5:24
  • This solution only works for maximum 24 hours. See stackoverflow.com/a/35850155/260805.
    – Ztyx
    Mar 9, 2016 at 10:47
  • 1
    This answer should also address how to make chrome avoid automatically reverse this flag, a la the other two answers. Mar 9, 2016 at 10:47
6

Also, this issue may exist if there are two files with name google.list and google-chrome.list in /etc/apt/sources.list.d directory with the similar entry like:

In google.list:

  deb http://dl.google.com/linux/chrome/deb/ stable main

In google-chrome.list:

  deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main

Then you should remove google.list file or uncomment its entry like below:

  #deb http://dl.google.com/linux/chrome/deb/ stable main
3
  • This is what worked for me. Thanks! Also, you probably mean "comment its entry" instead of "uncomment its entry"?
    – abhgh
    May 7, 2017 at 9:40
  • Thanks man, this worked.. ( dependencies should be checked while debugging.. :) ) Jan 13, 2018 at 3:32
  • @heykarthikwithu If it works then a upvote is appreciable. So that, other can find it helpful as well.
    – 0xAliHn
    Jan 13, 2018 at 6:48
4

That change was reverting overnight for me. Apparently you also need to change /opt/google/chrome/cron/google-chrome

sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/opt/google/chrome/cron/google-chrome"

Note: this is only for 64-bit

Source: further down that same Reddit thread and http://www.webupd8.org/2016/03/fix-failed-to-fetch-google-chrome_3.html

2
4

This doesn't work because there is a default config in /etc/default/google-chrome that contains instructions on repository updating. If you open the google-chrome.list file in /etc/apt/sources.list.d/ you will see that it has the comment:

### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.

Like the note says, the changes using the instructions in the previous comments will probably be overwritten the next time you update. To resolve this, do the following:

  1. Open a terminal and run cd /etc/default , then sudo nano google-chrome (Note: you can use whatever editor you wish of course))

  2. In the config file, change the 2nd line: repo_reenable_on_distupgrade="true" so that it is false, as in repo_reenable_on_distupgrade="false", then save the config file.

  3. Now, you can make the edit to the repo as instructed above. In a terminal window run the commands as shown in the previous comments:

    sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-chrome.list"

    sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/opt/google/chrome/cron/google-chrome"

You changes now won't be overwritten by the config directive.

PS. This works in Linux Mint 17.3 so it will probably work in Ubuntu and any Ubuntu based distro as well.

1
  • Can you please explain, once the cron job file also contains the [arch=amd64] flag, why one needs to change repo_reenable_on_distupgrade to false? Wouldn't it now be configured correctly whenever the list file gets automatically updated? Mar 9, 2016 at 10:46
4

Go to "Software Sources" section in Ubuntu Settings then click on "other software" tab then uncheck: http://dl.google.com/linux/chrome/deb/stable

Now sudo apt-get update will work.

After updating manager go and undo the changes in software sources.

2
  • In my system, it was under the "Additional repositories" section. Sep 17, 2016 at 11:52
  • In Ubuntu 15.04 this is under Software & updates -> other Software Sep 19, 2016 at 5:35
0

I solved this problem by following process:

1.Open a new Terminal window and run the following command:

sudo gedit /etc/apt/sources.list.d/google-chrome.list

2.In the text file that opens edit the file so that the line reads:

deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main

N.B: The only addition you need to make is entering the [amd64] architecture after ‘deb’ but preceding the ‘http’. Do not edit or replace any other text in this file.

3.Hit Save. Close the Gedit window and return to the Terminal and refresh your package list by runnin

sudo apt-get update

The ‘failed to fetch’ APT error should no longer appear.

source link

0

This didn't work for me, until I modified yet another file:

/etc/apt/sources.list.d/additional-repositories.list

and changed:

deb http://dl.google.com/linux/chrome/deb/ stable main

to

deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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