9

Running sudo apt update, I got this error:

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

How do I fix this? I am running Ubuntu 14.04 64-bit.

Update: I followed my answer, but the error returned today. The file /etc/apt/sources.list.d/google-earth.list is back to the way it was, and I just noticed it has these two lines:

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

So it seems the file was overwritten, meaning the current answer is not a permanent fix, and neither is the duplicate.

Update 2: I've decided to uninstall Google Earth and delete its .list file. I never use it anyway. If anyone is having the same issue, let me know and I'll help you out.

Update 3: muru mentioned in the comments that there is a cron file, /etc/cron.daily/google-earth. I read through it and found it appends this to the .list file:

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

So maybe editing this part of the cron job, or disabling it outright, would solve the problem.

wjandrea
  • 14,236
  • 4
  • 48
  • 98

2 Answers2

8

I found the answer on this similar question: No more updates for Google Chrome 32-bit

I ran sudo nano /etc/apt/sources.list.d/google-earth.list, and changed this line:

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

to this:

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

Then sudo apt update succeeded.

wjandrea
  • 14,236
  • 4
  • 48
  • 98
  • 1
    Note that in my latest version it is Google Earth Pro so when I have problems I run sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-earth-pro.list" – Dennis May 01 '19 at 16:22
  • @Dennis Take a look at edit 3 in my question. You probably have a cron job at /etc/cron.daily/google-earth-pro that you could edit. – wjandrea May 01 '19 at 17:05
  • 1
    Good point. I was mainly commenting on the fact that the name changed and didn't think so much about the answer itself. I wonder though are there benefits to the cron job that might be missed by doing so? I don't understand it all but it looks like a lot of error checking and fixing. – Dennis May 01 '19 at 19:26
  • @Dennis Right, the name is different. About the cron job, I meant to say you could edit it instead of disabling it. I just clarified that bit in the question. – wjandrea May 01 '19 at 19:49
0

Addressing this part of the question:

So it seems the file was overwritten, meaning the current answer is not a permanent fix, and neither is the duplicate.

I have this problem with both google 'earth' and 'chrome' (of the corrected source lists getting overwritten). To solve it, I made a copy of the correct source lists and saved them off, then I made a script fix-google that copies the saved versions over the ones in /etc/apt. Since I always do updates with aptitude, I changed the script I use to start aptitude to run fix-google before it starts aptitude. Kludgy but it works. I found this problem super annoying

Organic Marble
  • 23,641
  • 15
  • 70
  • 122