How to add additional packages to a Fedora repo

It’s time to give Fedora 12 a whirl on our servers. In the lab we are massive users of anaconda’s kickstart system for doing unattended installs. This means that everything has to be perfect, otherwise the install will hang. For instance, if a package that you have defined in the kickstart isn’t there, anaconda (the name for Fedora’s installer) will hang.

I’ve noticed that Fedora has dropped the compat-libstdc++-296 and compat-libstdc++-33, which we require for DB2. The compat packages are in still the ‘Everything’ directory in the Fedora 12 mirror sites, so we can download them and add them to our repository. This approach would work with any RHEL/CentOS/Fedora type distro.

1. Extract the CD/DVD to a folder.
2. Copy the packages you would like to add to the Packages subdirectory
3. Cd to the top level directory of the extracted files (you should see directories like Packages, repodata, images as subdirectories )
4. Run this command :

createrepo --update -g repodata/comps.xml .

This will update the package metadata in the repodata directory to include the new packages that you have added.
5. Add your new packages to the %packages section of the kickstart file – anaconda will now find the packages. For example, this is what mine says:

%packages --nobase
@core
vim-enhanced
-exim
-samba-winbind
-cairo
-krb5-libs
-fedora-release-notes
-python
-python-libs
-gtk2
-selinux-policy-targeted
-selinux-policy
-policycoreutils
-system-config-samba
-wireless-tools
-openldap
-libthai
-cups-libs
-efibootmgr
-hicolor-icon-theme
-fedora-logos
-system-config-network-tui
-system-config-firewall-tui
-perl-Module-Pluggable
-perl-Convert-ASN1
-perl
-popt
-libtiff
-libselinux
-libselinux-devel
-linux-atm-libs
-cyrus-sasl-lib
-ed
-newt-python
-mdadm
-python-numeric
-kudzu
-gamin
-parted
-wireless-tools
@smb-server
libaio
wget
yum
rpm-build
createrepo
sudo
ntp
openssh-server
openssh-clients
dhclient
kernel-headers
gcc
gcc-c++
mlocate
anacron
vixie-cron
crontabs
make
curl
unzip
svn
compat-libstdc++-296
compat-libstdc++-33

%post

This package selection is really minimal and enables us to build a Fedora machine from nothing in about 5 minutes!

This entry was posted in howto and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *