Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to install some packages from repository but always when I'm trying to yum install packagename yum updates db:

Loaded plugins: fastestmirror, langpacks, presto, refresh-packagekit
Determining fastest mirrors
updates/metalink                                                                                                                      |  23 kB     00:00     
 * fedora:
 * rpmfusion-free:
 * rpmfusion-free-updates:
 * rpmfusion-nonfree:
 * rpmfusion-nonfree-updates:
 * updates:
fedora-awesome                                                                                                                    | 3.3 kB     00:00     
google-chrome                                                                                                                     |  951 B     00:00     
rpmfusion-free-updates                                                                                                        | 3.3 kB     00:00     
rpmfusion-free-updates/primary_db                                                                                             | 272 kB     00:08     
rpmfusion-nonfree-updates                                                                                                     | 3.3 kB     00:00     
rpmfusion-nonfree-updates/primary_db                                                                                          |  93 kB     00:05     
updates                                                                                                                       | 4.7 kB     00:00     
updates/primary_db                                                                                                            | 4.6 MB     02:35     
updates/group                                                                                                                     | 1.9 MB     00:33     

So using yum install packagename -C also not works ("cache not found" error happens and yum makecache don't give results too). But I just want to install packages without updating db.

share|improve this question
Why? Updating the DB means you have the latest versions of the package list – sam Dec 5 '11 at 15:45
What db are we talking about? The yum repo/package cache? – thinice Dec 5 '11 at 15:47
@sam because my Internet speed is too slow to update repo for every installation. – purple Dec 5 '11 at 21:26
@thinice yes as you see in log there is update happens for ever repository. I don't need it to do I just want to install package without repository updating. – purple Dec 5 '11 at 21:26
@purple Then you should be using a local repository, yum is designed to work with full access to the repo data, be it remote or local yum doesn't care but it should have it. – sam Dec 5 '11 at 22:10

3 Answers 3

If you want yum to behave like apt-get (not to update the metadata by each run), edit /etc/yum.conf and put there:




in case you want to update the metadata after a week. If you run yum makecache, your metadata will be updated like by apt-get update in Debian.

But keep in mind that if you use "never" in the config file, you will have to care about that manually. If you use i.e. "7d", you will save your data bandwidth, but after a week, the metadata will be updated for you automatically.

Here is the metadata_expire documentation:

You can also change from the default of using seconds to using days, hours or minutes by appending a d, h or m respectively. The default is 6 hours, to compliment yum-updatesd running once an hour. It's also possible to use the word "never", meaning that the metadata will never expire.

share|improve this answer
will 2w work as well? – Sebastian Godelet May 15 '14 at 5:43
No 2w doesn't work. The default is 6 hours, to compliment yum-updatesd running once an hour. You can change from the default of using seconds to using days, hours or minutes by appending a d, h or m respectively. – Shubham Chaudhary Jun 25 at 22:54

If you want to install a package without updating the db, you download the rpm directly (either via yumdownloader, ftp or web browser) and then install it with the rpm directly:

rpm -ivh packagename

I do not recommend you do this, as it is a lot more work to track down the dependencies (that is why yum is created) and it could break future installs via yum.

share|improve this answer
Yes but why apt-get for example doesn't update repository when you just tell him to install package? And for updating you use 'apt-get update' command. – purple Dec 5 '11 at 21:28

What you're asking is out of the spirit of yum in some regards. Yum is a comprehensive package and dependency manager. In order to do it's job and not screw up your system by mix-and-matching incompatible packages, it needs to have that data you don't want to update.

You can manually analyze what dependencies a package has by using deplist <packagename> and install them manually.

Not having yum have an up-to-date seems like an odd request whatever the circumstances...

share|improve this answer
But why apt-get don't update repository when you type install command? It will update repository only and only when you type update. I want yum to do the same thing. – purple Dec 5 '11 at 21:27
If you run apt-get install foo - and the remote package version has changed, you'll get messages like this:… - Likewise with any dependencies that have been updated in the repo as well. (Essentially, forcing you to run update). – thinice Dec 5 '11 at 21:35
Yes but when I run yum to install application which hasn't been changed it updates db too. – purple Dec 6 '11 at 21:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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