A standard install with a kickstart file on fedora or centos just installs the packages from the install repository, which are usually outdated after some days after the release of a new fedora/centos version. So installing a fedora/centos always requires a %post section in the kickstart file where you would call a dnf/yum update -y in order to upgrade the old and outdated packages. This is a waste of time and bandwidth and the dnf/yum installer can use multiple repositories at the same time and pick the latest version.

How can I tell anaconda during a fresh install to include the "updates" repository for installation, so that a yum/dnf update -y afterwards is not required, as the updates woud already be installed?

  • Did you try the repo option of kickstart?
    – Thomas
    Commented Sep 17, 2017 at 9:59
  • oh my, not sure why i did overlook this option - will try this. Thanks
    – Mandragor
    Commented Sep 17, 2017 at 11:00

2 Answers 2


In any recent version of Fedora, Anaconda comes with built-in configuration for the updates repo. So you should be able to enable updates in a Fedora install just by adding the line:

repo --name=updates

to your kickstart. From the kickstart documentation of the repo command:

By default, anaconda has a configured set of repos taken from /etc/anaconda.repos.d plus a special Installation Repo in the case of a media install. The exact set of repos in this directory changes from release to release and cannot be listed here. There will likely always be a repo named “updates”.

Note: If you want to enable one of the repos in /etc/anaconda.repos.d that is disabled by default (like “updates”), you should use –name= but none of the other options. anaconda will look for a repo by this name automatically. Providing a baseurl or mirrorlist URL will result in anaconda attempting to add another repo by the same name, which will cause a conflicting repo error.

That shortcut should work fine in CentOS 7 (thanks to @maxschlepzig in the comments for checking!). If you have to deal with something older you should still be able to add the updates repo manually with a more complete repo command:

repo --name=centos-updates --mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

That would enable the CentOS updates repo (with full mirror support!) during the install.

  • 1
    would be wonderful for completion sake to know which one actually worked..
    – Alex R
    Commented Nov 30, 2018 at 14:30
  • @AlexR, I've just tested repo --name=updates with CentOS-7-x86_64-NetInstall-1810.iso and it does work. That means the ks.cfg is accepted and a yum update after first reboot doesn't want to update anything. Commented Jan 18, 2019 at 16:06

For those coming to this question hoping for a solution that works with CentOS 8.x, I found adding these lines will do the trick:

repo --name=centos-updates --mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS --cost=1000
repo --name=appstream-updates --mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream --cost=1000
repo --name=extras-updates --mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=Extras --cost=1000

The same should work with RHEL 8, with appropriate modifications and system registration, etc...

You must log in to answer this question.

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