4 Comments

  1. This doesn’t work for me in CentOS 7.4 All the entries in the repo file are key value pairs : . There aren’t any “=” signs in the repo files.

      1. The system is on my employers network , which I won’t be connected to for a few days. I have a CentOS 7.7 VM at home and repeated the steps to exclude a package ( this case postgresql ) and it worked as expected by excluding postgresql from base and updates packages ( see .repo file contents at the bottom of this post ) .

        I also noted that my VM’s CentOS-Base.repo file had = formatting instead of my employer’s system’s : format .

        My employer has a lot of customer internal repos and automation around configuration management. What might be happened is the .repo files yum.repos.d might either not be used, or if used, overridden by files in another location. I’ll check the yum.confg for the reposdir ( just learned that exists! ) parameter to see of that it the case.

        My ( not my employers ) CentOS-Base.repo file contents –
        [base]
        name=CentOS-$releasever – Base
        mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
        #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
        gpgcheck=1
        gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
        exclude=postgresql*

        #released updates
        [updates]
        name=CentOS-$releasever – Updates
        mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
        #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
        gpgcheck=1
        gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
        exclude=postgresql*

        #additional packages that may be useful
        [extras]
        name=CentOS-$releasever – Extras
        mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
        #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
        gpgcheck=1
        gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

        #additional packages that extend functionality of existing packages
        [centosplus]
        name=CentOS-$releasever – Plus
        mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
        #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
        gpgcheck=1
        enabled=0
        gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

        1. The parser messed up my post because I used greater than less than characters. Here it is again – My repo format: (key)=(value) . My employers repo format (key):(value) .

Leave a Reply

Your email address will not be published. Required fields are marked *