I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily?
I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily?
Check out Keryx; it's an offline repository manager.
How does it work? It lets you download updates and new programs (with dependencies) to your flash drive.
Its interface is similar to synaptic, but it works from a pendrive (it doesn't need installation). Unfortunately, the GUI needs wxwidgets, which don't come preinstalled on Ubuntu (they're cross-platform and installable from here and Ubuntu repository here). It can only install software in a Ubuntu system, but you can download the updates or new packages in any Linux, Windows or OS X.
Here you can find a tutorial.
Another detailed step-by-step tutorial is in this answer.
Launchpad also hosts downloadable files.
A screenshot:
A quick hack
A quick hack is to copy all the packages you downloaded for your install to his machine (detailed instructions here). The .deb files are stored in
/var/cache/apt/archives
, then in the other computer launch Synaptic and selectFile -> Add Package Downloaded
and search the folder were you put the files and open it, accept all (or install from terminal using the commandsudo dpkg -i DEB_PACKAGE_NAME
).NOTE:
This assumes that your package manager is not setup to delete the packages straight after install. It also assumes that you are running the same version of Ubuntu (10.10, 12.04, etc) and architecture version (32b or 64b).
A DVD repository
If you want the latest bug fixes and security patches available then have a look at this tutorial, which covers creating your own DVD repository.
A USB repository
If you have a decent sized USB stick - assuming around 4-8Gb (or external hard drive) you can set up a custom copy of the Ubuntu repository and configure that as a local repository as covered in AptGet/Offline/Repository on help.ubuntu.com.
To get the actual package files (the .deb files), I suggest using
apt-mirror
.The
apt-mirror
package will help you create a custom mirror which should be smaller than the 30Gb of the full repository. Install the package:and edit its configuration file
or since Ubuntu 14.04
Only include the repository sections you want. Here is a simple example that copies the binary .deb files from all 4 sections (main, restricted, universe and multiverse) as well as the latest bug fixes.
It is guesstimated that you will need around 15Gb of space for all 4 sections, without the source.
I have put the path for all the .deb files to be
/tmp
, make sure you have enough space so your hard drive does not fill up (if your hard drive does fill up and your computer freezes,/tmp
should be cleared with a reboot).If you just want the main files, remove the restricted, universe and multiverse names from the configuration file.
If you are using a different architecture (you have 64bit, but your friend has 32 bit) then add the following at the start of the mirror.list configuration file:
Once you have the
apt-mirror
configuration you want, runapt-mirror
and go do something fun or life changing as it will take hours or days to get the repository (depending on your connection and the Ubuntu mirror you are using).Once you have the .deb files, copy the files to your USB memory stick (or external hard drive) and set up the local repository as per the article mentioned previously.
Test it works before taking it to your friend!
Use
apt-get
with the--print-uris
option to do it and add-qq
so it would be quiet.Use
sed
to remove extra characters added to some filenames (something like3%2a
) and to get the url, filename and md5sum of files. Usewget
to download the files. Usemd5sum
to check if the files are downloaded properly.You may use this to create a shell script for Linux or Mac OS (replace
.cmd
in the commands to.sh
and dochmod a+x <filename>
to add permission to execute the script) or a Windows Command batch file, and an MD5Sum file to make sure the files are downloaded correctly.Commands
Create script:
Examples:
Create md5sum file:
Examples:
You need
md5sum
for Windows if you're using that operating system to download files.Create script to download repository listings:
Checking MD5 Sums
You may add these to the ends of scripts to check md5sum:
Linux:
Windows (uses older md5sum, does not support --quiet):
To add automatically to script:
Installing List Files (Update Command)
Run these commands to the target computer.
You need to use
bunzip2
to extract the repository list files:Then copy to listing folder (current folder only contains list files):
Above combined (current folder may contain other files):
Faster Downloads
If you want to make downloading the files faster, try using Axel.
Replace
wget -c ... -O ...
withaxel ... -o ...
.Folder Hierarchy (Downloading files using Windows)
I usually create a folder like this:
Then change
wget
in the lines above to..\\bin\\wget.exe
,md5sum
to..\\bin\\md5sum.exe
, etc.This will separate the *.deb files and list files into different folders.
Updating your system
update.sh
(for Linux or Mac OS) orupdate.cmd
(Windows)upgrade/dist-upgrade
(addmd5sum
commands to end)upgrade.sh/dist-upgrade.sh
(Linux or Mac OS) orupgrade.cmd/dist-upgrade.cmd
(Windows)*.deb
files to cache:sudo cp *.deb /var/cache/apt/archives/
sudo apt-get upgrade
orsudo apt-get dist-upgrade
Download Executables for Windows
Wget
for Windows: http://gnuwin32.sourceforge.net/packages/wget.htmmd5sum
for Windows: http://gnuwin32.sourceforge.net/packages/coreutils.htm or http://www.etree.org/cgi-bin/counter.cgi/software/md5sum.exeYou may also use the ones from MinGW, which are what I use. You only need
wget.exe
,md5sum.exe
and the necessary shared libraries. Check the section "Folder Hierarchy".Notes
update
command, which I haven't tested today some parts of it.Step 1: Get the download URLs in a file :
Execute the following command replacing package-names with required ones, separating by a space.
Step 2: Copy this file (apturls) to a machine which has high-speed Internet access, and execute the following command to download the packages:
Step 3: Now get those downloaded packages to your machine, and install them using :
Done!
You need to get a PC with Internet connection first, where you can download required .deb files. Once you have downloaded all the files, You can now create a CD/DVD rom or ISO file which can you use to install the software you have downloaded in your offline PC.
Start with a clean install or VM.
sudo apt-get install aptoncd
Install the packages you want on one PC
sudo apt-get install gbrainy
Run aptoncd
Click Create
Click Burn and set options then Apply
Burn it or save it
Note that aptoncd only backs up things in the current apt-cache.
This is why we started with a clean VM/new install and did all of this in one run.
Offline Repository
How to create an offline repository is described here: you just have to download the appropriate files from archive.ubuntu.com; alternatively, you could use
apt-medium
.EDIT: Another approach based on a local archive of
*.deb
files is described in different blog entries (see here and here). Sarath Chandra summarizes as follows:Make a dir accessible (at least by root)
Copy all the deb files to this directory.
Make the directory as a gzip:
or
Add the local repo to sources
You can use CubeGet. It is a portable package manager that lets you download packages on another internet connected computer (Linux or Windows), and install them back to your original Linux computer, offline.
What CubeGet does is that it creates a Project, that will contain the computer's list of repositories, list of installed packages, and the computer's distribution details (lsb_release). Then using that project, it can be opened on other internet connected computer (Windows also) using CubeGet, search and download for new repositories, package updates and specific package.
In synaptic you can select the packages you want to install and under the first menu there is an option to generate a script which you can take to another machine and run there. This script will "wget" (i.e. "download") all the packages you specified that you wanted (and their dependencies) which you run on a computer that does have internet access.
Once run you'll have all the package files needed by the disconnected computer. Carry them on a CD/USB stick and install them by
sudo dpkg -i *.deb
.You can use
apt-offline
orapt-offline-gui
.Pre-requistes: A friend's system with Internet connection. apt-offline installed in both your systems.
The Offline installation is achieved in 3 simple steps.
Step 1:
Generate a signature file on the Disconnected Debian box at home
apt-offline set /tmp/apt-offline.sig
The above command will generate all information required from apt about updating its database.
Step 2:
Download data based on the signature file generated earlier
apt-offline get C:\apt-offline.sig --threads 5
The above command will download data as mentioned in the signature file. To speed up downloads (that can be from multiple apt repositories), in this example we spawn 5 download threads.
Once completed, you could just copy the data (an archive file, if you used the --bundle option) back to the removable medium and copy it back onto your offline host.
Step 3:
Once you're back upon the home Debian machine, you feed the data from the removable medium to apt-offline:
apt-offline install /media/USB/apt-offline.zip
This will update the APT database on your disconnected machine seamlessly.
Apt-offline can be even used in Windows systems. In my opinion,
apt-offline
is the best option for Offline installation.Source