Skip to content

Instantly share code, notes, and snippets.

@danhper
Last active May 31, 2017 06:44
Show Gist options
  • Save danhper/5f8e0d31ad63b0910c2433a485cd0295 to your computer and use it in GitHub Desktop.
Save danhper/5f8e0d31ad63b0910c2433a485cd0295 to your computer and use it in GitHub Desktop.
#!/bin/bash
PACKAGE=$1
BASE_URL=http://ftp.jaist.ac.jp/pub/Linux/ubuntu
BASE_PATH=$HOME/install_root
DEB="$PACKAGE.deb"
path=$(apt-cache show $PACKAGE | grep "Filename:" | cut -f 2 -d " ")
wget $BASE_URL/$path -O $DEB
dpkg-deb -x "$DEB" $BASE_PATH
rm "$DEB"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment