CentOS Repository List in Linux [A Complete Guide]

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

In CentOs, repositories play a crucial role in software management, providing a centralized location for storing and distributing packages. The repositories, stored in the configuration files of the /etc/yum.repos.d/ directory, define the sources from which the package management system (usually Yum or DNF) retrieves software packages and updates. This article provides a comprehensive discussion of the CentOS repository list.

What is CentOS Repository?

CentOS repositories contain collections of software packages and updates for the CentOS operating system. These repositories can be called a centralized storage location of precompiled software packages, configurations, and metadata. These repositories help users maintain an updated and secured system environment through easy installation, software management, and updates on their CentOS systems.

CentOS repositories are accessed using package management tools like ‘yum’ or ‘dnf’. Officially, these repositories remain in control of the CentOS project and its community to ensure a stable and secure software package during software installation.

Types of CentOS Repositories

The types of CentOS repositories are:

  • Base Repository: The base repository is the primary and mandatory repository included with a standard CentOS installation. It contains the core set of packages required for the basic functionality of the operating system. These packages include essential system utilities, libraries, and basic tools.
  • Update Repository: The updates repository works with the base repository to provide timely updates, security patches, and bug fixes for the packages included in the base repository. Regularly updating your system from the updates repository ensures a secure and stable CentOS environment.
  • Extras Repository: The extras repository complements the base and updates repositories by offering additional packages that are not part of the core CentOS installation. These packages may include supplementary software, tools, or applications that users may find useful but are not considered essential for the base system.
  • Third-Party Repositories: Some repositories aren’t provided or supported by CentOS which are called third-party repositories. They are maintained by independent entities.

Official CentOS Repositories in Linux

Official CentOS repositories are essential components that provide a centralized and reliable source for software packages and updates. These repositories are maintained by the CentOS project and are designed to ensure the CentOS operating system’s stability, security, and functionality. Here are the key official repositories:

1. CentOS AppStream

CentOS 8 introduces the concept of Application Streams, offering different versions of user-space components. These versions are now delivered and updated more often than the core operating system packages. This flexibility allows for customization without compromising the stability of the platform.

2. CentOS Extras

In CentOS 7 and 8, this is an upstream repository along with additional CentOS packages. The CentOS development team ensures compatibility of every item in this repository, and it is enabled by default.

3. CentOS Plus

The CentOSPlus repository offers upgraded packages beyond those found in the CentOS base and update repositories. These packages enhance CentOS’s functionality but come at the cost of potential upstream compatibility issues. Enabling CentOSPlus makes CentOs differ from the upstream versions. You can browse the CentOSPlus directory for CentOS 6, CentOS 7, or CentOS 8.

4. debuginfo

These packages contain debugging symbols created during the building of primary packages. There is no default repository configuration. Debuginfo packages are essential for tools like profile, crash, and systemtap. it’s important to remember that debug info packages may lack signatures, so they need to be installed using “–nogpgcheck” or “gpgcheck=0” in the repo definition.

5. CR

The Continuous Release (CR) repository holds packages for the upcoming CentOS point release during the period between an upstream release and the official CentOS release. The repository contains mirrors that will be publicly available once ISO images are built and tested. This approach allows sysadmins to access the content of the new point release to use on running servers without waiting for the ISO images.

Third-Party Repositories

Third-party CentOS repositories are external software repositories maintained by independent individuals or organizations. These repositories extend the range of available software packages beyond what is provided in the official CentOS repositories. While third-party repositories can offer additional functionality and applications, users should exercise caution and ensure the reliability of these sources. Here are some notable third-party CentOS repositories:

1. RPMFusin Repository

RPMFuisn offers packages not included in the Fedora or Red Hat repositories and expands software availability. They provide precompiled RPMS for current Fedora versions and RHEK or similar versions. Users can access these packages using tools like yum and PackageKit.

2. EPEL Repository

EPEL is a third-party repository that provides additional software packages not included in the official CentOS repositories. The Fedora project maintains it and is often used to access a broader range of applications.

3. REMI Repository

REMI’s repository is known for providing the latest versions of PHP and related software packages for CentOS, Fedora, and RHEL systems. It offers both PHP updates and compatibility packages.

4. ELRepo Repository

EL Repo (Enterprise Linux Repo) is dedicated to providing hardware-related packages and drivers for CentOS and RHEL systems. It is beneficial for managing hardware support.

5. IUS Community Repository

The IUS community repository focuses on providing more recent versions of software like PHP, Python, and MySQL. It aims to deliver a balance between stability and up-to-date features.

Problematic Repositories

Some repositories in CentOS cause major issues on the system, known as problematic repositories. They replace base packages on a large scale without proper warning. Be cautious when using these repositories. Here are some problematic repositories:

1. Automatic Repo

Automatic repo offers both commercial and free repositories including new versions of PHP, MySQL, etc. They provide unique packages like hunspell, snort, and zabbix.

The major problems with Automatic repos are:

  • Enable their repo by default.
  • Overwrite user-made changes in the configuration file without any notice.
  • Removing packages from the automatic repo may leave the system in an unstable situation.

2. City-Fan

City-Fan provides repositories for various CentOS/RHEL versions which tend to overwrite base/updates without any warning. The issues that occur are:

  • Include numerous packages, particularly system libraries like “libcurl” which holds the risk of breaking yum immediately upon installation.
  • Replace many core packages with other packages which often have different structures than CentOS.
  • Removing packages installed from these repositories makes the system unstable.

3. Webtatic

Webtatic offers up-to-date versions of various web-related software packages, including PHP, and MySQL for CentOS systems. It’s used for web server setup. IUS or SCL are better alternatives.

Managing CentOS Repository

Managing the CentOS repository list involves configuring and maintaining the repositories from which the system retrieves software packages.

1. Viewing Repository List

To list out the enabled repositories, run the command yum repolist. The command shows the repository lists. Here, you can view the list of enabled repositories on the system.

You can also use the command yum repolist enabled to check the enabled repositories. This command enlists all the enabled repositories.

To inspect all existing repositories, both enabled and disabled, execute the command yum repolist all. This command shows the CentOS repository list. Here, you can observe a list of all the repositories.

2. Enabling a Repository

To enable a repository, simply run the command:

sudo yum-config-manager --enable repository_id

You can find the “repository_id” in the first column of the repository list named repo_id.

Check the following example:

#Check the repository's state
yum repolist --all | grep appstream-debuginfo
#Enable the repository
sudo yum-config-manager --enable appstream-debuginfo
#Check the state of the repository after enabling it
yum repolist --all | grep appstream-debuginfo

The command enables a repository.In this context, it is evident that the “appstream-debuginfo” repository was previously disabled. However, upon executing the 2nd command to enable the repository, it is now enabled.

3. Disabling a Repository

To disable a repository, run the following command:

sudo yum-config-manager --disable repository_name

Don’t forget to replace the “repository_name” with the repo id of the corresponding repository from the list.

Here’s an example:

#Check the repository's state
yum repolist --all | grep appstream-debuginfo
#Disable the repository
sudo yum-config-manager --disable appstream-debuginfo
#Check the state of the repository after disabling it
yum repolist --all | grep appstream-debuginfo

Shows the command to disable a repository. Certainly, the first command is used to verify the status of the “appstream-debuginfo” repository, which was initially enabled. Following that, the second command is utilized to disable the repository, as validated by the third command.

4. Add a Repository in CentOS

To add a repository, run the command:

sudo yum-config-manager --add-repo repository_url

Replace the “Repository_url” with the repository’s URL you want to add.

For example: Here ‘https://download.docker.com/linux/centos/docker-ce.reporepository is added using yum-config-manager.

#Add a repository
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
#check the new repository in the repository list
yum repolist

This shows the command to add a new repository. Using yum repolist, you can find the newly added repository in the list.

5. Updating Repository Information

To keep the repositories updated with the latest information, run the command sudo yum update and enter the user password. The command updates all the repositories with the latest informations. Here you can see the enlisted repositories to update.

To continue the update process, type y and press ENTER. Shows the confirmation asked by the command to update repositories. After the confirmation, the update process will start. This is how you can update your system’s repository information.

Moreover, if you want to clean all the cached information or metadata so that the latest information of packages gets enough space while updating, then run the yum clean all command.

Conclusion

A well-configured repository list is fundamental for maintaining a CentOS system efficiently. Regularly updating your system from trusted repositories ensures that you have the latest security patches and software enhancements. Understanding how to manage and customize your CentOS repository list empowers you to tailor your system to your specific needs while enjoying the stability and reliability that CentOS is known for.

People Also Ask

Why is it important to manage CentOS repository lists?

It’s essential to manage CentOS repository lists to keep your system updated with the latest software updates, security patches, and additional packages. It helps in maintaining system stability and security.

How can I add a repository to CentOS by editing config File?

To add a new repository to your CentOS system:

  1. Open the terminal and navigate to the /etc/yum.repos.d/ directory.
  2. Now, create a new configuration file using nano or vim. For example:
    sudo nano /etc/yum.repos.d/newrepo.repo

    Here, “newrepo.repo” is the new configuration file’s name.

  3. After that, add repository details, including name, base URL, enabled status, etc. For instance:
    [newrepo]
    
    name=New Repository
    
    baseurl=http://example.com/repo/
    
    enabled=1
    
    gpgcheck=1
  4. Save the changes and exit the text editor.
  5. Run the sudo yum makecache command to refresh the Yum cache.

Can I prioritize repositories in CentOS?

Yes, you can prioritize repositories by assigning a numerical value in the configuration file. Lower values indicate higher priority.

To add repository priorities:

  1. Open the terminal and navigate to the /etc/yum.repos.d/ directory.
  2. Open the configuration file using a text editor for example:
    sudo nano /etc/yum.repos.d/newrepo.repo
  3. Include the ‘priority’ parameter in the repository configuration file assigning a numerical value.
    [newrepo]
    
    name=New Repo
    
    baseurl=http://example.com/repo/
    
    enabled=1
    
    gpgcheck=1
    
    priority=1
  4. Finally, save and exit the text editor.

What should I do if a repository is not responding or is outdated?

If a repository is not responding or is outdated, you may disable or remove the repository from the list. For convenience, you can search for another alternative repository that may provide the required packages.

Related Articles


<< Go Back to Linux Repository List | Package Management in Linux | Learn Linux Basics

5/5 - (1 vote)
Auhona Islam

Auhona Islam is a dedicated professional with a background in Electronics and Communication Engineering (ECE) from Khulna University of Engineering & Technology. Graduating in 2023, Auhona is currently excelling in her role as a Linux content developer executive at SOFTEKO to provide a more straightforward route for Linux users. She aims to generate compelling materials for Linux users with her knowledge and skills. She holds her enthusiasm in the realm of Machine Learning (ML), Deep Learning (DL), and Artificial Intelligence (AI). Apart from these, she has a passion for playing instruments and singing. Read Full Bio

Leave a Comment