Skip to content

Instantly share code, notes, and snippets.

@amon-ra
Created August 8, 2017 06:46
Show Gist options
  • Save amon-ra/3ddae617ebf09e5c5b961797215478ff to your computer and use it in GitHub Desktop.
Save amon-ra/3ddae617ebf09e5c5b961797215478ff to your computer and use it in GitHub Desktop.
apt-build hack to install only from source
#!/bin/bash
#USAGE: apt-build -aptget /usr/local/bin/apt-src-only.sh install $package
PARAMS=$*
if [[ $* == *"build-dep"* ]]; then
PACKAGES_TO_BUILD=$(apt-get -s $PARAMS 2> /dev/null | grep -e '^Inst ' | awk -F '[ \(]' '{print $2"="$4}')
apt-build --aptget $0 install $PACKAGES_TO_BUILD
else
apt-get $*
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment