3

I've created a custom repository following this guide.

Files are being served via http (nginx). I've cd'd into the directory to create the metadata with createrepo .. I can install a package through yum from my custom repo; so far, so good.

Now I want to see how an upgrade process might work, this is where I'm having trouble. My first package, that I installed successfully, is from build-utils-20130930-62.noarch.rpm

So I create a new package build-utils-20131001-63.noarch.rpm, then in the repo directory sudo createrepo --update .. Now I try sudo yum --nogpgcheck install build-utils, the result

Package build-utils-20130930-62.noarch already installed and latest version

I've tried to install the new version with a more explicit call to yum

sudo yum --nogpgcheck install build-utils-20131001-63

the result

No package build-utils-20131001-63 available.

Decided to dig into the filelists.xml file to see if the update worked, and sure enough

<package pkgid="c12eb685ebfedf4dd3155d0910517f3eb208dac09cc36b9e971541f038a4590d" name="build-utils" arch="noarch">
    <version epoch="0" ver="20131001" rel="63"/>

So I've even tried completely removing the current version

yum remove build-utils

Now I go to install from scratch

sudo yum --nogpgcheck install build-utils

yum offers me version 62 still! I've even tried to clear the yum cache su -c 'yum clean headers' to no avail.

How do I get my new versions available from the custom repository?

quickshiftin
  • 2,125
  • 5
  • 27
  • 41

2 Answers2

2

Try:

yum clean all

yum -y update build-utils

The repolist gets cached on your yum client host.

"Clean all cached files from any enabled repository. Useful to run from time to time to make sure there is nothing using unnecessary space." [1]

dmourati
  • 25,540
  • 2
  • 42
  • 72
  • That's a good start, I can install the latest version now! **But**, what a painful process.., the next time I go to install anything I have to sit and wait for all the repositories to update metadata or some such. Is there a way to clear just the custom repo's cache, or another thought, how come I don't have to do this with 'standard' repositories? – quickshiftin Oct 01 '13 at 22:02
  • Hmm, thinking for a minute, probably I don't ever install 'regular' packages often enough to run into wanting to install a package that's still in the cache.., that's a thought anyway. With these custom packages, we'll be installing new versions every couple weeks or so. A quick look [here](http://yum.baseurl.org/wiki/YumCommands) though, and I don't see a way to clear the cache for a single package or repo. – quickshiftin Oct 01 '13 at 22:06
  • 1
    Check out metadata_expire? metadata_expire Time (in seconds) after which the metadata will expire. http://linux.die.net/man/5/yum.conf – dmourati Oct 01 '13 at 22:06
  • Sadly I see no way to configure cache expiry time, or disable caching on a particular repository. It does look like I can get away with `yum clean expire-cache` though, which seems like it could be slightly faster than `yum clean all`. – quickshiftin Oct 01 '13 at 22:23
  • 1
    You *can* set it per repo: http://docs.fedoraproject.org/en-US/Fedora/14/html/Software_Management_Guide/ch04s08s02.html – dmourati Oct 01 '13 at 22:33
0

I've already accepted @dmourati's answer, and I'm going to leave it that way, however the final solution was a change to my repository configuration file to not cache on this repository.

[customrepo]
name=Custom Repository
baseurl=http://custom/$basearch
enabled=1
metadata_expire=0

Notice the last line (thanks again @dmourati!). This way I never have to run any sort of yum clean, and caching is still in place for all the other repositories.

The reason I'm disabling caching on this repository, is that these are proprietary application packages we'll be building frequently. Perhaps in production I'll allow some caching, but we'll have to see how things shape up with the build/deploy system.

quickshiftin
  • 2,125
  • 5
  • 27
  • 41