8

Is there a way to make reposync ignore /etc/yum.conf ?

When i use reposync --config=/my/path/to/alternative/inputrepo.conf it's still picking up repositories for consideration inside /etc/yum.repos.d

My alternative/inputrepo.conf just looks like:

[varnish]
name=varnish
baseurl=http://repo.varnish-cache.org/redhat/varnish-3.0/el6/x86_64/

...but reposync still picks up the google-chome repo, which is only in /etc/yum.repos.d/ and complains about varnish being defined twice.

This is a problem for me because some of the mirrors i want to sync are also present on the system in /etc/yum.repos.d/, but with different baseurls.

2
  • I'm still seeing this issue in 2023, the only solution I have is to rename your repos so there is no name overlap. Instead of [varnish] use something like [varnish-3]. Not a very elegant solution.
    – Mick T
    Nov 13, 2023 at 22:19
  • This fix may help: serverfault.com/a/586499/110096 Set distroverpkg to the OS major version, and possibly the cachedir and persistdir.
    – Mick T
    Nov 14, 2023 at 17:20

3 Answers 3

7

In your alternate yum.conf you need to set reposdir to something else so it won't look in /etc/yum.repos.d.

I put my repo definitions for reposync in /etc/reposync.repos.d so the line to add to the yum.conf you're using for reposync would look like this:

reposdir=/etc/reposync.repos.d
1

Try:

% reposync -p [destdir] --repoid=varnish

This option will sync repo varnish repo to your local repo to whatever directory you provide.

% reposync -p [destdir] -n --repoid=varnish

Will sync only the newest files for subsequent syncs.

-1

Check out yum --disablerepo="*" ... and similar flags. Read the yum manpage.

2
  • I thought of this, but how does that help ? both repos have the same name. In my case 'varnish'. I can disable both, then will reposync use the ones from my file regardless ? -- i'll go try it.
    – Sirex
    Jan 30, 2013 at 21:45
  • 1
    no joy. aside from all else, --disablerepo disables for the following yum operation, not a reposync one.
    – Sirex
    Jan 30, 2013 at 21:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .