microsoft/linux-package-repositories

Deb package postinst script adds the microsoft repository to /etc/apt/source.list.d/

PorkCharsui79 opened this issue · 2 comments

Describe the issue
The postinst script in the microsoft-edge-* packages incorrectly checks for and adds the Microsoft repository to /etc/apt/source.list.d/.

When did the issue occur?
When you install the microsoft-edge-* package.

If applicable, what package did you attempt to install, and from which repo?
microsoft-edge-stable from https://packages.microsoft.com/repos/edge/ stable main

Steps to Reproduce
apt install microsoft-edge-stable

Actual Result
Installs microsoft-edge-stable
Adds new sources.list file to /etc/apt/sources.list.d/
Changes update-alternatives x-www-browser & gnome-www-browser to microsoft-edge-stable

Expected Result
Installs microsoft-edge-stable

Additional context

  1. We've mirrored packages.microsoft.com and add our mirror to our systems. The microsoft-edge-stable packages' postinst script checks for the presence of the microsoft repository, badly, and if it doesn't find an exact string it will add the repository to /etc/apt/sources.list.d/ again. Since we've added our own mirror, the string that is looked for will never match and the microsoft repository is added double.
  2. We use firefox as the default browser and microsoft-edge-stable blatantly overwrites this without asking the user.

Hey @PorkCharsui79,

Regarding 1 below, you can disable the automatic repo-adding behavior -- just make an empty default file for Edge prior to installing:
sudo touch /etc/default/microsoft-edge

To fix up:
sudo rm /etc/default/microsoft-edge
sudo rm /etc/apt/sources.list.d/microsoft-edge.list
sudo touch /etc/default/microsoft-edge

Regarding 2, we do register as a web browser with alternatives. For Edge Stable, we set a priority value of 200, which is the same as upstream / Chrome / Chromium (this has been true since 2013): https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/debian/postinst?q=update-alternatives&ss=chromium.

Thanks,

Andy

Typical... microsoft forcing itself everywhere on your system without asking and you then having to work around if you don't want that, instead of mircosoft not being a$$holes.