Skip to content

Instantly share code, notes, and snippets.

@kfei
Created January 21, 2015 03:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kfei/d3f3e36136c39cfab5e5 to your computer and use it in GitHub Desktop.
Save kfei/d3f3e36136c39cfab5e5 to your computer and use it in GitHub Desktop.
Adding new packages to customized CentOS 7
# Resolve all dependencies for packages that are going to be installed
for pkg in "virt-top cifs-utils redhat-lsb"; do repoquery --requires --resolve --recursive $pkg | grep -vE "i686" > dep-for-$pkg.log
# For a .rpm file, resolving dependencies can be `rpm -qpR mediawiki-1.4rc1-4.i586.rpm`
# Remove duplicates
awk '!x[$0]++' `cat dep-for-$pkg.log` > all-deps.log
# Extract package name from .deb file name
awk -F ":" '{print $1}' all-deps.log | sed -e 's/-[[:digit:]]\+$//g' > deps.log
# Copy all required packages to isolinux/Packages/ (if it's not there)
for pkg in $(cat deps.log); do stat isolinux/Packages/$pkg* &>/dev/null || echo "not found: $pkg"; done
# After manually added package into isolinux/Packages/
# Run `cd isolinux/ && createrepo -g ../comps.xml .`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment