0

Problem

I tried to install power shell core on a CentOS 8 sever. It didnt work so I tried a couple solutions from the web. It seems like I have added a repository twice. On dnf update I get this output:

[codingsafari@centosbox ~]$ sudo dnf update
[sudo] password for codingsafari:
Repository packages-microsoft-com-prod is listed more than once in the configuration
CentOS-8 - AppStream                                                                 90 kB/s | 4.3 kB     00:00
CentOS-8 - Base                                                                     110 kB/s | 3.8 kB     00:00
CentOS-8 - Extras                                                                    43 kB/s | 1.5 kB     00:00
Extra Packages for Enterprise Linux 8 - x86_64                                       34 kB/s |  15 kB     00:00
packages-microsoft-com-prod                                                          22 kB/s | 2.9 kB     00:00
Killed

It did this killed at the end before as well but that was one step earlier at extra packages...

Does anyone know why this is happening and how to fix it?


Ways I have added the repo

first try didnt succeed and ended with killed

sudo su 
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/microsoft.repo
exit
sudo yum install -y powershell

This one I cannot really remember, I found these lines in the history though.

curl https://packages.microsoft.com/config/rhel/7/prod.repo > ./microsoft-prod.repo
sudo cp ./microsoft-prod.repo /etc/yum.repos.d/
curl https://packages.microsoft.com/keys/microsoft.asc > ./microsoft.asc
sudo rpm --import ./microsoft.asc 

Thise was another thing I did

curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
sudo yum makecache
sudo yum clean metadata
sudo yum clean all
sudo dnf update       

Output of ls -l /etc/yum.repos.d

-rw-r--r--. 1 root root  733 Sep 25 14:52 CentOS-AppStream.repo
-rw-r--r--. 1 root root  714 Sep 25 14:52 CentOS-Base.repo
-rw-r--r--. 1 root root  800 Sep 25 14:52 CentOS-centosplus.repo
-rw-r--r--. 1 root root 1043 Jan  2 15:21 CentOS-CR.repo
-rw-r--r--. 1 root root  668 Jan  2 15:21 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  758 Sep 25 14:52 CentOS-Extras.repo
-rw-r--r--. 1 root root  339 Sep 25 14:52 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  738 Jan  2 15:21 CentOS-HA.repo
-rw-r--r--. 1 root root  928 Jan  2 15:21 CentOS-Media.repo
-rw-r--r--. 1 root root  738 Sep 25 14:52 CentOS-PowerTools.repo
-rw-r--r--. 1 root root 1383 Sep 25 14:52 CentOS-Sources.repo
-rw-r--r--. 1 root root   74 Jan  2 15:21 CentOS-Vault.repo
-rw-r--r--. 1 root root 1351 Aug  6  2019 epel-playground.repo
-rw-r--r--. 1 root root 1206 Aug  6  2019 epel.repo
-rw-r--r--. 1 root root 1305 Aug  6  2019 epel-testing.repo
-rw-r--r--. 1 root root  193 Feb 13 13:07 microsoft-prod.repo
-rw-r--r--. 1 root root  193 Feb 13 13:02 microsoft.repo
2
  • How did you add the repo? Can you post the contents of ls -l /etc/yum.repos.d? I am guessing you have two sources for packages-microsoft-com-prod.
    – Bert
    Feb 13, 2020 at 15:53
  • @Bert thanks for the hint, I have updated my post. Now I see both ms repos, I guess I should just remove one of them. Any idea which one based on my update?
    – The Fool
    Feb 13, 2020 at 17:25

1 Answer 1

1

You have two files for that repo, remove either of them (as they are the same file), then run yum update to fix the issue.

3
  • Hi Bert, thanks for the answer. I removed one of the repos and now it ends like that Out of memory allocating 771751936 bytes! Killed
    – The Fool
    Feb 13, 2020 at 17:39
  • Its a linode/ nanode with 1 GB ram. Its not that much but should this really happen? I guess no one could knew this and the problem is not solvable based on the question. You helped me to remove the dupe repo though, so I will accept your answer and open another question regarding this memory issue.
    – The Fool
    Feb 13, 2020 at 17:43
  • follow up question: serverfault.com/questions/1002971/…
    – The Fool
    Feb 13, 2020 at 17:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .