1

This error shows up on my sudo apt update:

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.microsoft.com/repos/code stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF

It is only a warning but it is annoying. I don't use this repo. I had another similar error which I got rid of using sudo add-apt-repository --remove but this one doesn't seem to have a repo for add-apt-repository to find. I think I installed it (years ago) using sudo dpkg -i packages-microsoft-prod.deb having downloaded the deb file as described here but I can't see how to uninstall it. I tried the dpkg --remove command but I can't find a way to specify the repository. for example

sudo dpkg --remove packages.microsoft.com

tells me the package isn't installed. I also tried packages-microsoft-prod and every variation in between. Always package not found.

So I did a dpkg -l to list the packages and it isn't there. But I'm aware that we're now talking about packages rather than repositories. Is there a way to remove the repository I added with dpkg? Or something else?

3 Answers3

2

Unfortunately, dpkg only works to remove package files and not repository entries.

You can find the location of the repository lists that contain the corresponding URL with this:

cd /etc/apt && grep -r 'packages.microsoft.com'

That will give you output for the list of repository entries/lists that contain the URL.

For each file returned, edit the files (with root or superuser via sudo) and comment out the line(s) containing that URL by putting a # at the beginning of the line.


Additionally, you may want to run dpkg -r packages-microsoft-prod, but if it says that it is not installed, then you just have leftover list entries and should do the above I stated.

Thomas Ward
  • 78,878
0

dpkg provides two primary methods for uninstalling packages:

  1. dpkg -r <package_name>:
    removes the package and its associated files, but leaves configuration files.
  2. dpkg –purge <package_name>:
    not only removes the package but also purges its configuration files and leftover data.

You can also use the synaptic package manager to remove that specific package. Here is how to install it.

Or open

Software -> search for that specific file -> Select or right click -> click on removal or complete removal

Note:
Now the browser issue of video playback of chrome and edge is fixed so there is no need to remove it.
For removing MS Edge replace packages.microsoft.com with microsoft-edge-stable.

zx485
  • 2,865
Bee
  • 13
0

Common Methods

  • dpkg focuses on other tasks, and its source management is actually handled by the higher-level tool apt. So I think your repo sources should be managed by apt, and you can locate them in /etc/apt. You can use cat /etc/apt/sources.list to view the file and modify it directly using sed.
  • And It's a good practice to organize and maintain the /etc/apt/sources.list.d directory, especially when you need to disable certain repository sources due to slow servers or the need to lock versions.
  • Relationship: sources.list is the main source configuration file, while sources.list.d is a centralized 3rd-party directory for managing other .list file sources. I believe external packages would prefer to configure their sources in this directory.

To remove a repo source, it may be listed in a file like /etc/apt/sources.list.d/<pack-name>.list. For example, it could be named *something*-microsoft-stable.list. You can use ls -a to check and confirm its existence.

Alternative Method 1

If it's a Microsoft package, there might be compatibility issues with the Windows architecture. Sometimes, issues related to Microsoft on Linux can be resolved by simply restarting. Whenever convenient, restarting is worth a try.

Alternative Method 2

If a repo source is added through a configuration file, there is a foolproof method. Set up a VirtualBox, use Timeshift to back up the entire system, reinstall the original .deb files, and then compare the differences between the two systems.

Digging into the root of deb pack file

After unpacking, check if you have found any information related to the repository sources. Perhaps you can find out what command (e.g., curl) was used in the installation script to obtain the source repository, or the documentation might provide detailed instructions.

mkdir pack-dir
cp <path_to>/packages-microsoft-prod.deb pack-dir && cd packdir
sudo dpkg-deb -x packages-microsoft-prod.deb pack-cont

hope can help you.