I have a friend who has got a computer that is not connected to internet,is there any way to install software offline easily?

link|improve this question

feedback

15 Answers

up vote 37 down vote accepted

Check out Keryx, it's an offline repository manager- it lets you download updates and new programs (with dependencies) to your flash drive. Its interface is similar to synaptic but it works on a pendrive (don'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.

Launchpad also hosts downloadable files.

link|improve this answer
4  
keryx is the one! – akshatj Aug 5 '10 at 8:56
feedback

A quick hack

If your friend uses the same version of Ubuntu as you and wants the same packages, a quick hack is to copy all the packages you downloaded for your install to his machine. The .deb files are stored in /var/cache/apt/archives, so simply copy all the .deb files from that location to the same location on his machine.

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 architecture version (32bit or 64bit).

A DVD repository

If you want the latest bug fixes and security patches available then have a look at this tutorial: http://ubuntuforums.org/showthread.php?t=352460 which covers creating your own DVD repository.

link|improve this answer
feedback

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 "sudo dpkg -i *.deb".

link|improve this answer
feedback

An 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 https://help.ubuntu.com/community/AptGet/Offline/Repository/

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:

sudo apt-get install apt-mirror

and edit its configuration file

gksudo gedit /etc/apt-mirror/mirror.list

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.

# apt-mirror configuration file
##
## The default configuration options (uncomment and change to override)
##
#
set base_path    /tmp/ubuntumirror
#

## Repositories to copy from - 

## use a mirror so you don't overload the main server!!!

# Lucid binaries - no source files
deb http://archive.ubuntu.com/ubuntu lucid main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse


## Clean up older .deb files no longer in the archive
clean http://archive.ubuntu.com/ubuntu

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:

set defaultarch i386

Once you have the apt-mirror configuration you want, run apt-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!!

link|improve this answer
The apt-mirror package is detailed at: : apt-mirror.sourceforge.net – JR0cket Aug 5 '10 at 10:39
feedback

I recommend APTonCD: http://aptoncd.sourceforge.net

link|improve this answer
AptonCD only backup those packages which is saved in /var/cache/apt/archives. If you clean this folder, then APTonCD won't be able to backup anything. It basically saves those packages into .ISO file – crucified soul Apr 17 '11 at 17:18
feedback

I use apt-get with the "--print-uris" option to do it. I also add "-qq" so it would be quiet.

Use sed to remove extra characters added to some filenames (something like 3%2a) and to get the url, filename and md5sum of files. Use wget to download the files. Use md5sum to check if the files are downloaded properly.

You may use this to create a Windows Command batch file and an MD5Sum file to make sure the files are downloaded correctly.

Commands

Create script:

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

Examples:

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

Create md5sum file:

sudo apt-get <<<apt-get command and options>>> --print-uris -qq | sed -n -e "s/_[0-9]%[0-9a-f][0-9a-f]/_/" -e "s/'\([^ ]\+\)' \([^ ]\+\) \([^ ]\+\) MD5Sum:\([^ ]\+\)/\4  .\/\2/p" > md5sum.txt

Examples:

sudo apt-get install anjuta --print-uris -qq | sed -n -e "s/_[0-9]%[0-9a-f][0-9a-f]/_/" -e "s/'\([^ ]\+\)' \([^ ]\+\) \([^ ]\+\) MD5Sum:\([^ ]\+\)/\4  .\/\2/p" > md5sum.txt
sudo apt-get upgrade --print-uris -qq | sed -n -e "s/_[0-9]%[0-9a-f][0-9a-f]/_/" -e "s/'\([^ ]\+\)' \([^ ]\+\) \([^ ]\+\) MD5Sum:\([^ ]\+\)/\4  .\/\2/p" > md5sum.txt
sudo apt-get dist-upgrade --print-uris -qq | sed -n -e "s/_[0-9]%[0-9a-f][0-9a-f]/_/" -e "s/'\([^ ]\+\)' \([^ ]\+\) \([^ ]\+\) MD5Sum:\([^ ]\+\)/\4  .\/\2/p" > md5sum.txt

You need md5sum for Windows if you're using that operating system to download files.


Create script to download repository listings:

sudo apt-get update --print-uris -qq | sed -n "s/'\([^ ]\+\)' \([^ ]\+\) \([^ ]\+\) :/wget -c \1 -O \2.bz2/p" > update.cmd

Checking MD5 Sums

You may add these to the ends of scripts to check md5sum:

Linux:

md5sum --quiet -c md5sum.txt

Windows (uses older md5sum, do not support --quiet):

md5sum -c md5sum.txt

To add automatically to script:

echo -e "md5sum -c md5sum.txt\npause" >> script.cmd

Installing List Files (Update Command)

You need to use bunzip2 to extract the repository list files:

bunzip2 *.bz2

Then copy to listing folder (current folder only contains list files):

sudo cp * /var/lib/apt/lists/

Above combined (current folder may contain other files):

for listfile in `ls *.bz2`; do bunzip2 $listfile; sudo cp ${listfile%.bz2} /var/lib/apt/lists/; done

Faster Downloads

If you want to make downloading the files faster, try using Axel: http://goo.gl/AC4k3.

Replace wget -c ... -O ... with axel ... -o ....

Folder Hierarchy

I usually create a folder like this:

  • apt-get/
    • bin/
      • msys-1.0.dll
      • msys-intl-8.dll
      • wget.exe
      • msys-iconv-2.dll
      • md5sum.exe
      • libeay32.dll
      • libintl3.dll
      • libssl32.dll
      • libiconv2.dll
    • update/
      • update.cmd
      • md5sum.txt
    • install/
      • install-foo.cmd
      • install-bar.cmd
      • upgrade.cmd
      • md5sum.txt

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

  1. boot to Ubuntu
  2. create a script for update
  3. boot to Windows
  4. run update.cmd
  5. boot to Ubuntu
  6. install list files
  7. create a script for upgrade/dist-upgrade (add md5sum commands to end)
  8. boot to Windows
  9. Run upgrade.cmd/dist-upgrade.cmd
  10. boot to Ubuntu
  11. Copy *.deb files to cache: sudo cp *.deb /var/cache/apt/archives/
  12. Run: sudo apt-get upgrade or sudo apt-get dist-upgrade

Download Executables for Windows

Wget for Windows: http://gnuwin32.sourceforge.net/packages/wget.htm

md5sum for Windows: http://gnuwin32.sourceforge.net/packages/coreutils.htm or http://www.etree.org/cgi-bin/counter.cgi/software/md5sum.exe

You 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

  • I'm not entirely sure if everything above commands will work, since I haven't used them for a month now. Especially the update command, which I haven't tested today some parts of it.
  • To easily see the results of the commands, add a "pause" line in the end of the scripts, if using Windows.
  • I recommend to create shell scripts to update, upgrade and install packages if you're using these commands often.
link|improve this answer
feedback

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 rchive of *.deb files is described in different blog entries (see here and here). Sarath Chandra summarizes as follows:

  1. make a dir accessible (atleast by root)

    sudo mkdir /var/my-local-repo

  2. copy all the deb files to this directory.

  3. make the directory as a

    sudo dpkg-scanpackages /var/my-local-repo /dev/null > /var/my-local-repo/Packages

  4. add the local repo to sources

    echo "deb file:/var/my-local-repo ./" > /tmp/my-local.list

    sudo mv /tmp/my-local.list /etc/apt/sources.list.d/my-local.list

    sudo apt-get update

link|improve this answer
feedback

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
enter image description here
Click Create
enter image description here
Click Burn and set options then Apply
enter image description here
Burn it or save it
enter image description here

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.

link|improve this answer
sooo, are you saying if i make a vm and install all the apps i want, then run this program, take the cd/dvd to the offline pc. and it would install all the apps on it? – Alex May 1 at 22:51
As long as you use the same base system media, yes. If you're deploying an office, and you want a quick and simple way to add something, then this becomes very helpful. If you use create-meta package, yes – aking1012 May 1 at 22:56
feedback

Yes. You can download the DVD iso, burn it on a DVD, and install the software from the DVD. See CDs and DVDs can be given as source to package managers in the same way as online archives.

link|improve this answer
feedback

hey just go here but it's repository from indonesia , type what you want, choose your version of ubuntu, and it comes out with all dependencies

link|improve this answer
feedback

I suggest to customize Live CDs and install them.

You also can download the files on http://packages.ubuntu.com/filename, but then you have to pay attention to the dependencies, too.

link|improve this answer
feedback

Another possibility is to use remastersys. This tool allows you to make an iso image from your own system and after creating a bootable usb stick via unetbootin you can install a customized system to as many computers you want.

link|improve this answer
feedback

Step 1: Get the download URLs in a file :

Execute the following command replacing package-names with required ones, separating by a space.

$apt-get -y install --print-uris package-name | cut -d\' -f2 | grep http:// > apturls

Step 2: Copy this file (apturls) to a machine which has high-speed Internet access, and execute the following command to download the packages:

$wget -i path-to-apturls-file

Step 3: Now get those downloaded packages to your machine, and install them using :

$cd path-to-the-downloaded-packages-directory

$sudo dpkg -i *.deb

Done!

link|improve this answer
feedback

This is not a fully detailed answer, but at a high level you could:

  1. get the desired .deb pkgs (and create a list of them) (include packages they depend on that are not already installed)
  2. create an apt archive that contains them
  3. copy the apt archive to a CD or USB
  4. insert the CD or USB into the target system
  5. configure apt on the target system to include the CD or USB apt archive as a source
  6. install the packages from your list with apt-get install (list of pkgs)
link|improve this answer
feedback

Maybe you take a look at the SuperDeb Creator?

link|improve this answer
Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – jrg Apr 27 at 1:56
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.