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.

AK
Alyssa Kordek Content Writer I

Alyssa started working for InMotion Hosting in 2015 as a member of the Technical Support team. Before being promoted to Technical Writer, Alyssa developed expertise in the fields of server hardware, Linux operating systems, cPanel, and WordPress. She now works to produce quality technical content featuring cutting-edge topics such as machine learning, data center infrastructure, and graphics card technology.

More Articles by Alyssa

Comments

It looks like this article doesn't have any comments yet - you can be the first. If you have any comments or questions, start the conversation!

Was this article helpful? Let us know!