Install packages without internet access in Ubuntu

in ubuntu (online or offline), make the download script:

sudo apt-get install [package name] --print-uris -qq | sed -n "s/'\([^ ]\+\)' \([^ ]\+\) \([^ ]\+\) MD5Sum:\([^ ]\+\)/wget -c \1/p" > script.cmd

run it in online ubuntu

sh script.cmd

zip it for convenience

tar -cvf [file name].tar.gz *.deb

move it to the computer without internet access by any means!

unzip it

tar -xvf [file name.tar.gz]

and install it all

dpkg -i *.deb

credit: this answer in SO

Leave a Reply

Your email address will not be published. Required fields are marked *