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
ls -l /etc/yum.repos.d
? I am guessing you have two sources for packages-microsoft-com-prod.