Last active
September 12, 2016 19:35
-
-
Save vadimkantorov/63878200829249832ded to your computer and use it in GitHub Desktop.
A script to download and unpack and use Ubuntu packages without root permissions
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 | |
# Usage example: bash install_ubuntu_package_locally_without_root.sh libopencv-dev ~/deb | |
# Author: Vadim Kantorov | |
# Add the following exports to your .bashrc or .profile to use the unpacked packages | |
# export PATH=$HOME/deb/usr/bin:$PATH | |
# export LD_LIBRARY_PATH=$HOME/deb/usr/lib:$HOME/deb/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH | |
# export CPATH=$HOME/deb/usr/include:$CPATH | |
# export LIBRARY_PATH=$LIBRARY_PATH:$LD_LIBRARY_PATH | |
set -e | |
DEB=${2:-deb} | |
mkdir -p $DEB | |
for url in $(apt-get --print-uris --yes install $1 | grep http | cut -d\' -f2); | |
do | |
wget $url -P $DEB | |
dpkg -x $DEB/"${url##*/}" $DEB | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment