Ask Your Question

Update package database in yum/dnf automatically?

asked 2014-07-13 08:15:22 -0500

venv21 gravatar image

When I want to install a new application oder update the system I have to wait a few minutes because the package database in yum/dnf has to update itself. Is there a way to automatically update the package database?

In apt I would add apt-get update to autostart but I don't know a yum command which does have the same effect like apt-get update


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-07-13 09:04:46 -0500

NickTux gravatar image

updated 2014-07-13 09:09:29 -0500

The equivelant yum command to apt-get update is/are yum makecache and yum check-update .

yum check-update

will refresh the pacakges index and will check for new updates, without apply them.

yum makecache

Is used to download and make usable all the metadata for the currently enabled yum repos.

But, I can't understand what you want to achieve. If you update your system, you should run the makecache or update the repos with current metadata, because you need the latest metadata at current moment before you update.

Even on apt it is recommened to always run apt-get update before apt-get upgrade , but in yum this is a kind of integrated into yum update command.

Maybe you mean, to disable the yum plugins ? Try yum --noplugins update is that what you want ?

I mean, yum check-update at startup applications in conjuction with yum --noplugins update in terminal, maybe is the answer to your question.

edit flag offensive delete link more


The first part of your answer is what I am looking for. But you are right, it is useless because I need the latest metadata. I didn't thought about that. Thank you very much!

venv21 gravatar imagevenv21 ( 2014-07-14 11:35:34 -0500 )edit

answered 2014-07-13 08:53:41 -0500

hedayat gravatar image

DNF does this automatically in configured intervals (but it might still do it again when you run dnf). Yum can be configured to do so too (you need to run yum makecache fast automatically, for example by adding it as a cron job).

Now, if you want to run DNF and prevent it from trying to updating metadata, you can run it with -C param. For example:

dnf -C install an_interesting_pacakge
edit flag offensive delete link more


FWIW: -C exists in yum too - will save you some typing over "--noplugins update".

lesterc gravatar imagelesterc ( 2016-03-03 17:39:33 -0500 )edit

Yes, I didn't talk about yum at all! :)

hedayat gravatar imagehedayat ( 2016-03-04 23:50:59 -0500 )edit

Question Tools

1 follower


Asked: 2014-07-13 08:15:22 -0500

Seen: 4,305 times

Last updated: Jul 13 '14