Skip to content

Instantly share code, notes, and snippets.

@snargledorf
Created January 31, 2012 20:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snargledorf/1712580 to your computer and use it in GitHub Desktop.
Save snargledorf/1712580 to your computer and use it in GitHub Desktop.
Script for retrieving package source using apt-get. Tested under Ubuntu 11.10
#!/bin/bash
if [ $# < 1 ] || [ $# > 2 ]
then
echo -e "Usage: \n$0 <package name> \n$0 <package name> <dir>"
exit 1
fi
if [ $# == 2 ]
then
mkdir -p $2
cd $2
fi
sudo apt-get build-dep $1
sudo apt-get source $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment