Repository packages-microsoft-com-prod is listed more than once in the configuration
Asked Answered
M

3

8

Whenever I run any yum command I am getting the below error -

Repository packages-microsoft-com-prod is listed more than once in the configuration

Any ideas to resolve the issue ?

Repository packages-microsoft-com-prod is listed more than once in the configuration
HDP-2.6                                                                                                                               | 2.9 kB  00:00:00
HDP-UTILS-1.1.0.21                                                                                                                    | 2.9 kB  00:00:00
Updates-ambari-2.5.2.0                                                                                                                | 2.9 kB  00:00:00
https://packages.microsoft.com/rhel/7/mssql-server/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's certificate issuer has been marked as not trusted by the user."
Trying other mirror.
Marchetti answered 15/5, 2019 at 11:51 Comment(0)
C
3

In the folder /ect/yum.repos.d you have two or more files.repo with the same repository name [packages-microsoft-com-prod]. I had the same problem and I have to delete one of the files, which was irrelevant to my os. And then I understood that that was a not good idea.

Cornelia answered 17/9, 2019 at 14:48 Comment(2)
Why do you understood that that was a not good idea?Hollerman
@Hollerman I don't remember already.Tribble
A
2

Find the packages that are related to another, in this case, files that relate to Microsoft and open them in your favorite editor. The file is probably named different, but the contents will be the same.

[packages-microsoft-com-prod]
name=packages-microsoft-com-prod
baseurl=https://packages.microsoft.com/rhel/7/prod/
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc

If this is the case, then it is safe to delete one of them. But if they are different, I wouldn't touch them. You could probably rename one of them, but I'm not sure if that would break something important.

Abed answered 19/12, 2020 at 19:45 Comment(0)
F
0

First of all, the specific repository is not the problem, meaning that normally with third party repos the general message should look like this:

Repository XXX is listed more than once in the configuration

If that happens, the problem solves just by deleting the files related to that repository in the location etc/yum.repos.d/

You are able to delete such files by typing:

sudo rm -rf XXX.repos

in the terminal, in that location. You also got to type:

yum clean all

or

dnf clean all

depending on which command is triggering the problem.

Also, the repository or the app is not usually the problem. This is due to a bug according to the official site of RedHat.

Finally if you want to uninstall the app, you gotta run the same command to delete files on the locations:

  • var/cache/dnf
  • var/cache/log

Example:

sudo rm -rf XXX

rm is the command to remove files using the terminal, while rmdir is for deleting directories. by using rf you are forcing the deletion, even when the files chosen are protected or the directories filled with protected and/or unprotected files, for which you might want to be careful with such command.

NOTE: Just for THIRD-PARTY repos.

Frasco answered 2/5, 2021 at 18:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.