Ask Your Question

Changing the location of cache of yum-plugin-local

asked 2014-07-13 10:29:41 -0500

I would like to change cache location of yum-plugin-local from /var/lib/yum/plugins/local to something like ~/Documents/Software. So that the rpms get copied when I do home folder backup. From what I understand I could just change the location of baseurl in /etc/yum.repos.d/_local.repo. I wanted to know if I could hit some snag because of file permission, etc.

Just for reference I am posting my config files here.


name=Automatic local repo. (manged by the "local" yum plugin).
#  Metadata expire could be set to "never" because the local plugin will
# automatically cause a cache refresh when new packages are added. However
# it's really cheap to check, and this way people can dump stuff in whenever
# and it never gets out of sync. for long.
#  Make cost smaller, as we know it's "local". If you really want to be sure,
# you can do this ... but the name will do pretty much the same thing, and that
# way we can also see the other packages (with: --showduplicates list).
# cost=500


# Path to the local repository.
# repodir = /var/lib/yum/plugins/local

# Createreop options. See man createrepo
# This option lets you disable createrepo command. This could be useful
# for large repositories where metadata is priodically generated by cron
# for example. This also has the side effect of only copying the packages
# to the local repo directory. 
# enabled = true

# If you want to speedup createrepo with the --cachedir option. Eg.
# cachedir = /tmp/createrepo-local-plugin-cachedir
# If you need to override the checksum with the --checksum option. Eg.
# checksum = sha

quiet = true
verbose = false
skip_stat = false
unique_md_filenames = true
update = true
databases = true

# createrepo deltarpm support - set to true to enable.
# enable_deltas = false

# How many delta packages to build?
# deltas = 1

# Where to look for old packages? By default this is repodir. You can
# also specify a different directory which holds older packages.
# oldpackagedirs = /var/lib/yum/plugins/local


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-07-13 11:07:18 -0500

hedayat gravatar image

Actually, /etc/yum/pluginconf.d/local.conf controls where the packages are being saved. /etc/yum.repos.d/_local.repo is used by yum to find the packages of local repo. Therefore, you should uncomment repodir line in /etc/yum/pluginconf.d/local.conf and change it to something like this:

repodir = /home/username/Documents/Software

You should also edit baseurl in _local.repo if this repository is enabled for yum, so that it can find the packages saved by yum-plugin-local plugin.

I think you won't encounter any permission issues, but SELinux might have somthing to say! ;) Try changing the location and install a package, and see if it will be copied to the location correctly.

edit flag offensive delete link more


@hedayat Thanks, it worked. I updated both local.conf and _local.repo. The cache is saved under root users and I think I shouldn't have permission issues while backing up. If you have time to reply, I would love to know what kind of SELinux problem I could have faced.

sudhirkhanger gravatar imagesudhirkhanger ( 2014-07-14 07:19:10 -0500 )edit

Since it is in a user's home directory, SELinux might prevent some processes/services from writing to it by default (for example it does so for httpd IIRC). But it might prevent it for special services (rather than allowing it for special services). Specially, it could prevent access for non-interactive processes (e.g. if an automatic update is in process). But as I said, I'm not sure if it will affect your scenario. :)

hedayat gravatar imagehedayat ( 2014-07-14 09:45:59 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-07-13 10:29:41 -0500

Seen: 773 times

Last updated: Jul 13 '14