User Tools

Site Tools


how_to_set_the_centos-base.repo

This is an old revision of the document!


How to set the CentOS-Base.repo

Apr 2017
Updated Nov 2017


Because the minimal install of CentOS is generally what we use, the base repos are not present, this is not an issue until you need certain features (normally when fault finding) like:

  htop
  nload
  tcpdump


To install these you need to setup the base (and possibly EPEL) repositories, or when trying to use Yum Install you will get errors.

To get the base repositories added, you need to navigate to the following location (this is for CentOS, other distributions may differ).

  /etc/yum.repos.d


If this folder is empty then you have no repositories set, you might see other repositories (like epel) but not the base ones.

NOTE: If there is a file called local.repo then you may need to rem out the lines in this file, or all external links will be ignored.

#[local-Server-centos]
#name=local-Server-centos
#baseurl=file:/mnt/MEDIA/repo/centos
#failovermethod=priority
#gpgcheck=0
#enabled=1

#[local-Server-epel]
#name=local-Server-epel
#baseurl=file:/mnt/MEDIA/repo/epel
#failovermethod=priority
#gpgcheck=0
#enabled=1

Create a new file called CentOS-Base.repo copy the following text in to it and save. Note: This is for CentOS 7 only.

If the mirrorlist= does not work for you, as a fall back you can try the marked out baseurl= line instead.

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
# 
[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
#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 

#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


To activate the repos you need to do run the following command:

  Yum Update



You should now be able to install default repository tools like tcpdump

Below is an example output after doing this on a new unit.

====== How to set the CentOS-Base.repo ======
<color darkorange>Apr 2017</color>\\ 
<color darkorange>Updated Nov 2017</color>
\\ 
\\ 

----

Because the minimal install of CentOS is generally what we use, the base repos are not present, this is not an issue until you need certain features (normally when fault finding) like:
\\ 
    htop
    nload
    tcpdump
\\ 
To install these you need to setup the base (and possibly EPEL) repositories, or when trying to use <color #ed1c24>Yum Install</color> you will get errors.
\\ 
\\ 
To get the base repositories added, you need to navigate to the following location (this is for CentOS, other distributions may differ).
\\ 
\\ 
    /etc/yum.repos.d
\\ 
If this folder is empty then you have no repositories set, you might see other repositories (like epel) but not the base ones.
\\ 
\\ 
N<color #ed1c24>OTE:</color> If there is a file called <color #ed1c24>local.repo</color> then you may need to rem out the lines in this file, or all external links will be ignored.
\\ 
\\ 
<file>
#[local-Server-centos]
#name=local-Server-centos
#baseurl=file:/mnt/MEDIA/repo/centos
#failovermethod=priority
#gpgcheck=0
#enabled=1

#[local-Server-epel]
#name=local-Server-epel
#baseurl=file:/mnt/MEDIA/repo/epel
#failovermethod=priority
#gpgcheck=0
#enabled=1

Create a new file called CentOS-Base.repo copy the following text in to it and save. Note: This is for CentOS 7 only.

If the mirrorlist= does not work for you, as a fall back you can try the marked out baseurl= line instead.

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
# 
[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
#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 

#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


To activate the repos you need to do run the following command:

  Yum Update



You should now be able to install default repository tools like tcpdump

Below is an example output after doing this on a new unit.

how_to_set_the_centos-base.repo.1698882480.txt.gz · Last modified: 2023/11/01 23:48 by walkeradmin