In Centos 7, I want to install some packages that I see in the following URL: http://mirror.centos.org/centos/7.4.1708/extras/x86_64/Packages/

How can I add this URL to my yum package manager ?

PS: downloading a single rpm file doesn't work, because it looks recursively for dependencies with the same version.

  • 2
    That repo is already in the base set of repos for CentOS 7. – Ignacio Vazquez-Abrams May 18 '18 at 16:46
  • With version 7, not with a specific version 7.4.1708 – forzagreen May 18 '18 at 17:06
  • Why do you want to pin the repo to a specific version? – Ignacio Vazquez-Abrams May 18 '18 at 17:07
  • I want a specific package version that exists only in this repo version. – forzagreen May 18 '18 at 17:23
  • Force the releasever and then pin the package. – Ignacio Vazquez-Abrams May 18 '18 at 17:27

Yum utils is a package which provides yum-config-manager. A quick and easy way to add a repo without the hassle writing a repo file and enabling is to use this as a sudo user

yum-config-manager --add-repo=http://vault.centos.org/centos/7.4.1708/extras/x86_64/

This will create the file and enable it for you.

P.S. Guide to install yum-utils if you don't have it already. It's part of the base CentOS repo. Usually on most yum systems, yum-utils is a must have!


I had to add a new repo file: e.g. /etc/yum.repos.d/CentOS-7.4.1708.repo with repo configuration:

name=Extras packages for CentOS 7.4.1708 for x86_64

Then, to install for example docker-1.12.6-55.gitc4618fb.el7.centos (which has dependencies in the same Packages), run:

$ sudo yum install -y docker-1.12.6-55.gitc4618fb.el7.centos        

Options --disablerepo=* with --enablerepo=extras741708 can be used to enforce only the new repo file to be considered.

--- UPDATE ---

Package version 7.4.1708 doesn't exist anymore in mirror.centos.org. You should rather use: baseurl=http://vault.centos.org/centos/7.4.1708/extras/x86_64/

  • 1
    I was trying to install lftp. I found that the name of the repo file in /etc/yum.repos.d and the name within brackets in the file does not matter. Then all I needed to install lftp was to run sudo yum install lftp. – pacoverflow Oct 4 '18 at 23:46

Take a peek at the files /etc/yum.conf and the ones in /etc/yum.repos.d, you should be able to cobble up something for unofficial repositories. That if they don't publish a package containing the required configuration.

You certainly can also download all needed packages, and install them "by hand" with yum. But that way you won't get updates automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.