Skip to content

Instantly share code, notes, and snippets.

@tjhartmann
Last active December 20, 2015 07:09
Show Gist options
  • Save tjhartmann/6090793 to your computer and use it in GitHub Desktop.
Save tjhartmann/6090793 to your computer and use it in GitHub Desktop.
Using yum to build chroot
mkdir /path/to/chroot
rpm --root /path/to/chroot --initdb
wget http://repo_url/centos-release-version.rpm
rpm -i --nodeps --root /path/to/chroot /path/to/centos-release-version.rpm
yum --installroot=/path/to/chroot --nogpgcheck install -y yum rpm-build
# -or-
yum --installroot=/path/to/chroot --nogpgcheck groupinstall -y Base
# to use yum inside the chroot
mount --bind /proc /path/to/chroot/proc
mount --bind /dev /path/to/chroot/dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment