How to Add Repositories in CentOS

Add Repositories Hero Image

Occasionally, when operating a CentOS-based dedicated server you may find that you require additional software packages. If the required packages are not in the current repositories that you have enabled, then you may need to add repositories to the server in order to get the software you need. This technique can be used to acquire software packages from a variety of different providers and sources. In this article, we will demonstrate how to add the EPEL Repository to a CentOS server using the command-line interface.

Note that you will require root access in order to use these directions.

Adding Repositories

  1. First, log into your dedicated server with the root user.
  2. Next, run the following command in your command-line:
    rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  3. After running that command, you should see output similar to the following

    Retrieving https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    warning: /var/tmp/rpm-tmp.BNvGWL: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
    Preparing... ########################################### [100%]1:epel-release ########################################### [100%]

  4. In order to finalize the added repo, you may need to update the YUM package manager. Using the following command:
    yum update
    After entering this command, you may be asked to confirm the changes by hitting y. You can do this by pressing the y key and then pressing enter to continue. Alternatively, you can you can just add a -y to the end of the command to automatically confirm the update.

Congratulations! You now know how to add repositories to your CentOS VPS or dedicated server. This same process can be used to add a wide variety of different repositories from many different sources. One of the benefits of the open-source nature of CentOS hosting is the ability to add additional software repositories to aid in software development or other server-based operations.

If you still want to know more about repositories, please review this article where we outline how to upgrade your repository packages.

InMotion Hosting Contributor
InMotion Hosting Contributor Content Writer

InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!

More Articles by InMotion Hosting

Was this article helpful? Join the conversation!