My changes to apt sources keep being reversed?

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
mattlach
Level 3
Level 3
Posts: 135
Joined: Mon May 30, 2011 8:34 pm

My changes to apt sources keep being reversed?

Post by mattlach » Sun Mar 06, 2016 4:51 pm

Hey all,

So I usually wind up using Google's Chrome browser as my sole browser on my Linux Mint desktop installs.

I do this by adding googles sources as described here:

Code: Select all

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update 
sudo apt-get install google-chrome-stable
For years when I have been doing this, somehow - oddly enough - a new /etc/apt/sources.list.d/google-chrome.list sources entry is automatically created for google chrome, which results in duplicate sources entries. I've never been able to figure out what it is that has root access to the folder in /etc to create this file, but the way I have solved it is by just going in after the fact and deleting my original google.list sources entry and then everything works as normal again.

That was until Google recently discontinued the 32 bit version of Chrome. Ever since then, every time I update my sources I get the following error:

Code: Select all

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)
Now I run a 64bit system, so I really don'r care about the 32bit version of the browser, but somehow apt thinks I do anyway, looks for it, and when it isn't there, fails.

Having googled for a solution to this problem, the internet seems to agree that simply specifying the architecture I am interested in the sources solves this problem, by editing my source entry so it reads as follows:

Code: Select all

deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
And this does work, but only once.

Whatever mystery process that has write access to my /etc quickly changes my /etc/apt/sources.list.d/google-chrome.list back to what it originally was, giving me the error message again.

I have tried making the change both using a text editor in the console, and editing it directly in the GUI "Update Manager" (which I never usually use, I do everything from console), just in case the GUI "Update Manager" was somehow involved in changing my sources, but even when I do this, it gets changed back again.

This is starting to get rather infuriating.

Does anyone know:

1.) What annoying process is has write access to my /etc and is making these changes; and

2.) How I can stop it from doing so?

Thanks,
Matt
Desktop: Intel i7-3930K@4.8Ghz, Asus P9X79 WS, 64GB DDR3-1866, 400GB Intel 750 SSD, Sound Blaster X-Fi Titanium HD, Nvidia Titan X (Pascal)
Proxmox (NAS, Mythbuntu, etc.): 2x Xeon E5-2650v2, 256GB RAM, 120TB ZFS

mattlach
Level 3
Level 3
Posts: 135
Joined: Mon May 30, 2011 8:34 pm

Re: My changes to apt sources keep being reversed?

Post by mattlach » Sun Mar 06, 2016 4:57 pm

Well, I edited my /etc/apt/sources.list.d/google-chrome.list to add the architecture again.

This time I changed the permissions to 400 in an attempt to remove write access in the file.

I'm not sure if this will help, or if whatever process that is changing the file is programmed to take into consideration the permissions and alter them as needed. I mean, if it has permission to write in /etc it must ahve root permissions, and if it has root permissions it CAN change the permissions of the file... I'm hoping it doesn't...

Time will tell.
Desktop: Intel i7-3930K@4.8Ghz, Asus P9X79 WS, 64GB DDR3-1866, 400GB Intel 750 SSD, Sound Blaster X-Fi Titanium HD, Nvidia Titan X (Pascal)
Proxmox (NAS, Mythbuntu, etc.): 2x Xeon E5-2650v2, 256GB RAM, 120TB ZFS

User avatar
LinuxJim
Level 5
Level 5
Posts: 659
Joined: Tue Jan 26, 2016 8:01 pm
Location: Oregon, USA

Re: My changes to apt sources keep being reversed?

Post by LinuxJim » Sun Mar 06, 2016 5:52 pm

mattlach wrote:
I do this by adding googles sources as described here:
[...]
This is starting to get rather infuriating.
All the answers to your questions are in the comments to the link you posted. You need to change "> google.list" to "> google-chrome.list".
mattlach wrote: Does anyone know:

1.) What annoying process is has write access to my /etc and is making these changes; and

2.) How I can stop it from doing so?

Thanks,
Matt
1.) The normal package updating tools - apt, apt-get, synaptic, Software Manager, Update Manager, aptitude, etc.

2.) Change the name of the package list to the proper one.

mattlach
Level 3
Level 3
Posts: 135
Joined: Mon May 30, 2011 8:34 pm

Re: My changes to apt sources keep being reversed?

Post by mattlach » Sun Mar 06, 2016 11:01 pm

LinuxJim wrote:
All the answers to your questions are in the comments to the link you posted. You need to change "> google.list" to "> google-chrome.list".
Nope.

If you reread my post you'll realize I deleted my original google.list entry, leaving only google-chrome.list

Even so, when I make the change to limit the arch to 64 bits in that file, it initially works, but then changes itself back.

This time, after I changed the write permissions on google-chrome.list to not allow writes, it has stayed the same, but I am not sure when they usually change back. lt's been about 6 hours since I made my last change, followed by changing the write permissions, and this time it hasn't changed back yet, but I also haven't rebooted yet, so I don't know if that is when it happens.
LinuxJim wrote:
The normal package updating tools - apt, apt-get, synaptic, Software Manager, Update Manager, aptitude, etc.
So, what triggers these packages making changes to my defined sources? Is apt just dead set against specifying the architecture in a .list file? If so, why does apt even have that option?

Or maybe the source itself (google in this case) instructs apt to maintain the source file to their specification? If this is the case it seems a little disconcerting and a potential security risk

I have to admit, I am quite bothered by the fact that something that I specify can be changed without my direct action. During the upgrade and install process, Apt at least gives me the option of whether I want to keep my existing config files, or replace them, and it gives me the option of seeing a side by side comparison. When something I specifically set, is silently changed back in the background, it gives me great pause, and makes me question if I should be using this system at all.
Desktop: Intel i7-3930K@4.8Ghz, Asus P9X79 WS, 64GB DDR3-1866, 400GB Intel 750 SSD, Sound Blaster X-Fi Titanium HD, Nvidia Titan X (Pascal)
Proxmox (NAS, Mythbuntu, etc.): 2x Xeon E5-2650v2, 256GB RAM, 120TB ZFS

User avatar
LinuxJim
Level 5
Level 5
Posts: 659
Joined: Tue Jan 26, 2016 8:01 pm
Location: Oregon, USA

Re: My changes to apt sources keep being reversed?

Post by LinuxJim » Mon Mar 07, 2016 1:13 am

mattlach wrote:
LinuxJim wrote: All the answers to your questions are in the comments to the link you posted. You need to change "> google.list" to "> google-chrome.list".
Nope.

If you reread my post you'll realize I deleted my original google.list entry, leaving only google-chrome.list
Um, yup. Like I said, read the comments in the original link you posted. There are more steps.

Hint: This is one of the comments:

Code: Select all

 Noel J. Bergman
Don't forget to patch /opt/google/chrome/cron/google-chrome, or you'll have the same problems the next day.
mattlach wrote:
LinuxJim wrote: The normal package updating tools - apt, apt-get, synaptic, Software Manager, Update Manager, aptitude, etc.
So, what triggers these packages making changes to my defined sources? Is apt just dead set against specifying the architecture in a .list file? If so, why does apt even have that option?
Again, the answers are right there in the comments. Look for references to /etc/default/.
mattlach wrote:I have to admit, I am quite bothered by the fact that something that I specify can be changed without my direct action.
I don't like it either, but Mint does this all over the place. Look at the scripts in /etc/linuxmint/adjustments. Part of the reason for this behavior is to maintain "branding" (overwriting icons, logos, messages on every boot), and part of the reason is to keep newbies from breaking their system too easily (replacing some critical files on every boot). Note, however, that this is not what is happening in this particular case. Look at the quote I reproduced above from the other thread.
Last edited by LinuxJim on Mon Mar 07, 2016 1:38 am, edited 3 times in total.

GeneBenson
Level 4
Level 4
Posts: 342
Joined: Fri Sep 17, 2010 9:55 pm

Re: My changes to apt sources keep being reversed?

Post by GeneBenson » Mon Mar 07, 2016 1:35 am

Hi mattlach,

Have a look at /etc/cron.daily/google-chrome This is installed when Chrome is installed. It runs once a day and resets the entry in google-chrome.list if it is not what it expects to find.

The entry at /etc/cron.daily/google-chrome is a symlink to /opt/google/chrome/cron/google-chrome. One solution is to edit this file and add [arch=amd64] there like this:
Before

Code: Select all

REPOCONFIG="deb http://dl.google.com/linux/chrome/deb/ stable main"
SSLREPOCONFIG="deb https://dl.google.com/linux/chrome/deb/ stable main"

After

Code: Select all

REPOCONFIG="deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main"
SSLREPOCONFIG="deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main"
Now, when the cron script runs it will not change anything because it expects to find [arch=amd64] in google-chrome.list

User avatar
LinuxJim
Level 5
Level 5
Posts: 659
Joined: Tue Jan 26, 2016 8:01 pm
Location: Oregon, USA

Re: My changes to apt sources keep being reversed?

Post by LinuxJim » Mon Mar 07, 2016 1:48 am

GeneBenson wrote:Hi mattlach,
Have a look at /etc/cron.daily/google-chrome This is installed when Chrome is installed. It runs once a day and resets the entry in google-chrome.list if it is not what it expects to find.
I was purposely not giving Matt the direct answer, because he already found it in another forum, but failed to read it. Also, this question has already been answered fully in at least 4 different threads here in the last few days. A little searching would have found it. I was attempting to help Matt help himself.

In any case, thanks for jumping in and ending his frustration. :)

mattlach
Level 3
Level 3
Posts: 135
Joined: Mon May 30, 2011 8:34 pm

Re: My changes to apt sources keep being reversed?

Post by mattlach » Mon Mar 07, 2016 11:52 am

LinuxJim wrote:
GeneBenson wrote:Hi mattlach,
Have a look at /etc/cron.daily/google-chrome This is installed when Chrome is installed. It runs once a day and resets the entry in google-chrome.list if it is not what it expects to find.
I was purposely not giving Matt the direct answer, because he already found it in another forum, but failed to read it. Also, this question has already been answered fully in at least 4 different threads here in the last few days. A little searching would have found it. I was attempting to help Matt help himself.

In any case, thanks for jumping in and ending his frustration. :)

Ahh, my bad. I pulled a stupid on this one. I had another forum post open in a different tab, and I thought that was one that I had linked. kept going back to it, and being like "this guy must be crazy, there is nothing of the sort here". :p That, and I have been conditioned to skim over disqus-type blog comments, as they are typically useless.

That being said, it would be nice if the top post were updated to reflect the latest information of how to make things work. In this particular case it isn't THAT bad, but sometimes when you have long running threads that can amount to hundreds of pages of reading before you find the latest information, can be frustrating.
Desktop: Intel i7-3930K@4.8Ghz, Asus P9X79 WS, 64GB DDR3-1866, 400GB Intel 750 SSD, Sound Blaster X-Fi Titanium HD, Nvidia Titan X (Pascal)
Proxmox (NAS, Mythbuntu, etc.): 2x Xeon E5-2650v2, 256GB RAM, 120TB ZFS

LenW
Level 1
Level 1
Posts: 6
Joined: Sun Oct 28, 2012 2:56 am

Re: My changes to apt sources keep being reversed?

Post by LenW » Wed Mar 09, 2016 5:45 pm

GeneBenson wrote:Have a look at /etc/cron.daily/google-chrome This is installed when Chrome is installed. It runs once a day and resets the entry in google-chrome.list if it is not what it expects to find.
...
It appears that Google has taken action to settle this situation down a bit:
The latest update of google-chrome-stable:amd64 (49.0.2623.87-1)
has a new version of /opt/google/chrome/cron/google-chrome
which does expect (but does NOT require) the [arch=amd64] modifier.

So it would seem that if you need to add [arch=amd64] to
/etc/apt/sources.list.d/google-chrome.list it now will stick,
(if you have the latest google-chrome package.)

BTW, I had assumed that editing the sources list with the "official" tool,
"Software Update" would insure that the edit would stick.
Was anyone else surprised to find that it did not do that?

Post Reply

Return to “Software & Applications”