Created
January 6, 2015 18:42
-
-
Save osirisgothra/c2a8cfb3311e965e2091 to your computer and use it in GitHub Desktop.
install dependencies for a debian package via apt-get/cache (requires sh or bash, and of course, dpkg and apt tools)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install-depends.sh | |
# install dependencies example | |
# by: Gabriel T. Sharp <[email protected]> | |
# osirisgothra.github.com | |
if [[ -z $1 ]]; then | |
echo -ne "Enter a package name: " | |
read | |
set $REPLY | |
fi | |
if [[ $1 ]]; then | |
apt-get install --yes --no-remove `apt-cache depends --important "$1" | grep -Po '(?<=Depends: )[^\<>]*$' | tr '\n' ' '` | |
echo "apt-get remove --yes --no-remove `apt-cache depends --important "$1" | grep -Po '(?<=Depends: )[^\<>]*$' | tr '\n' ' '`" > uninstall-$1-.sh | |
else | |
echo "not installing a blank entry" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the example file, pertaining to this question on ServerFault:
http://serverfault.com/questions/577942/install-only-dependencies-of-a-given-package-in-debian-or-ubuntu-apt