Sorry to steal your thunder here, Newar
I have a script I use to make offline bundles. Given how easy this script is to use, we could probably be putting out more bundles with each release (though we haven't because more released binaries & bundles complicates our release process). This script requires making a fresh VM of the same OS, but
I need the VM for testing anyway, so it's actually saving me a step (it would be an extra step for others). Either way, it's not terribly difficult to install the distro with the default install options in a VM and run this script there (use the same ISO for the VM and the offline computer)
So the steps to use my script (for Debian-based OSes):
- (1) Download ISO to be installed on offline computer
- (2) Install OS on VirtualBox virtual machine
- (3) Run the script (at the bottom of this post) using "python dl_offline_deps.py download". This will create a directory with all dependencies, and a copy of the script (itself)
- (4) Take directory to offline computer, run "sudo python dl_offline_deps.py install" within download directory
That's it. You can now install Armory on the offline computer and all dependencies will already be installed!
Under the hood what it's doing is extremely simple:
apt-get install <packagelist> --print-uris --yes
That just gets the download links and MD5 hashes of the entire depenency tree. The script then downloads those, and checks their MD5 sums. It only saves files that have a matching MD5 hashes.
When you run the script on the offline computer, it runs the same command to get the list of downloads and MD5 sums, but now it reads the .deb files from the directory (instead of wget'ing them) and checks that the hashes match. If so, it adds it to the list of files to install. When it's done, it simply runs:
You can use the Synaptic method mentioned by Newar, and you won't need a fresh VM of the same operating system. Or my scripts can be adapted do the same thing: generate the wget commands on the offline computer, execute on the online computer, take back to the offline computer to install. For me, I need the VM anyway so it's actually saving me time and I don't have to go through that pesky GUI
Here's the script:
################################################################################
#
# DOWNLOAD: python dl_offline_deps.py download
#
# DOWNLOADING MUST BE RUN ON A FRESH INSTALL OF THE TARGET OPERATING SYSTEM!
#
# This will download and check the md5sums of all Armory dependencies, and
# their dependency trees, in order to install Armory on a fresh install onto
# an offline system.
#
# It is recommended you make a virtual machine using VirtualBox of the exact
# same Linux distro, then run this script on the first boot. It will create
# a directory containing every .deb package in the dependency tree, which can
# be taken to the offline computer and installed using this script but with
# the "install" command instead (and sudo)
#
################################################################################
#
# INSTALL: sudo python dl_offline_deps.py install
#
# If run with admin privilege using the "install" command, it will get the
# raw .deb files from the current directory (instead of wget'ing), it will
# check the hashes, and then install them.
#
################################################################################
import os
import shutil
import platform
import hashlib
from subprocess import check_output
from sys import argv
if len(argv)<2 or not argv[1] in ['download','install']:
print 'Usage: '
print ' python %s download' % argv[0]
print ' or:'
print ' sudo python %s install' % argv[0]
exit(1)
# This is actually all packages needed for compiling, not just installing Armory
pkglist = 'git-core build-essential pyqt4-dev-tools swig libqtcore4 libqt4-dev python-qt4 python-dev python-twisted python-psutil dpkg-sig'
# Use the package manager to pretend to install it, collect URLs and hashes
uriList = check_output('apt-get install %s --print-uris --yes' % pkglist, shell=True)
# If we are downloading, make a directory to put them into
if argv[1]=='download':
opsys = platform.system()
distro = '-'.join(platform.linux_distribution())
osbits = 64 if platform.machine().lower()=='x86_64' else 32
dirname = 'offline_bundle_%s_%s_%dbit' % (opsys, distro, osbits)
if not os.path.exists(dirname):
os.mkdir(dirname)
shutil.copy(argv[0], dirname) # copy this script in there
# Download or read from file all .debs and check hashes
debList = []
for line in uriList.split('\n'):
if not line.startswith('\'http'):
continue
uri,deb,siz,md5 = line.split()
uri = uri.strip('\'')
md5 = md5.split(':')[-1]
if argv[1]=='download':
rawDeb = check_output('wget --quiet -O - %s' % uri, shell=True)
else:
rawDeb = open(deb,'rb').read()
if not hashlib.md5(rawDeb).hexdigest() == md5:
print "***ERROR: MD5 does not match! Not saving file"
continue
debList.append(deb)
if argv[1]=='download':
targfile = os.path.join(dirname, deb)
with open(targfile, 'wb') as f:
print ' Writing %s' % targfile
f.write(rawDeb)
if argv[1]=='install':
dlcmd = 'dpkg -i "%s"' % '" "'.join(debList)
print dlcmd
check_output(dlcmd, shell=True)
Pretty darned short considering it handles both downloading and installing (depending on command line argument, argv[1]), and does all the hash checks for you. This is why I love python!