Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
The following link could also be interesting for you. askubuntu.com/questions/86358/… –  starkus Sep 28 '13 at 0:08
add comment

18 Answers

up vote 74 down vote accepted

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 in this answer.

Launchpad also hosts downloadable files.

A screenshot:

screen-shoot

share|improve this answer
3  
keryx is no longer under development, if you are trying this on a newer version of Ubuntu, use the portable version to save yourself from the trouble of dependencies. –  Axlrod Dec 6 '12 at 10:54
    
I do still use keryx without problems, although it clearly needs further development and improvements. –  carnendil Sep 27 '13 at 22:44
add comment

A quick hack

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, then in the other computer launch Synaptic and select File -> Add Package Downloaded and search the folder were you put the files and open it, accept all.

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.

share|improve this answer
1  
If you can't run sudo apt-get update this will not work very well, still a good time saver when setting up a new system :) –  GM-Script-Writer-62850 Apr 30 '13 at 1:54
    
Agreed, just upgraded two computers to 13.10 from 13.04. The first one had to download ~1.8Gb, copying the content of /var/cache/apt/archives to the second one made it only download ~250Mb. Still, you need a connection to run the install. –  Maxime R. Nov 2 '13 at 18:16
    
apt-get update is not needed if you copy /var/lib/apt/lists - this directory contains the repository information that is downloaded by apt-get update. –  ignis Mar 19 at 21:21
add comment

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:

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!

share|improve this answer
    
The apt-mirror package is detailed at: : apt-mirror.sourceforge.net –  jr0cket Aug 5 '10 at 10:39
add comment

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
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.

share|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 '12 at 22:51
1  
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 –  hbdgaf May 1 '12 at 22:56
add comment

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 shell script for Linux or Mac OS (replace ".cmd" in the commands to .sh and do "chmod 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:

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, does 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)

Run these commands to the target computer.

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.

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

Folder Hierarchy (Downloading files using Windows)

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 target computer that uses Ubuntu
  2. Create a script for update
  3. Boot to a computer with an internet connection
  4. Run update.sh (for Linux or Mac OS) or update.cmd (Windows)
  5. Go back to target computer
  6. Install list files
  7. Create a script for upgrade/dist-upgrade (add md5sum commands to end)
  8. Go back to computer with internet connection
  9. Run upgrade.sh/dist-upgrade.sh (Linux or Mac OS) or upgrade.cmd/dist-upgrade.cmd (Windows)
  10. Go back to target computer
  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.
share|improve this answer
3  
Can you create a simple gui for this :) –  Tachyons Jul 22 '12 at 3:32
    
using windows for this seems very weird... –  Axlrod Dec 6 '12 at 11:50
    
It's also applicable to Linux (which is actually better because you don't need to install md5sum and wget). The Windows part is for those who don't have a Linux computer with internet connection, so you could use it in an internet cafe or a friend's computer that only has Windows. –  Arnel A. Borja Dec 10 '12 at 1:32
add comment

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 bash -c 'dpkg-scanpackages /var/my-local-repo /dev/null > /var/my-local-repo/Packages'
    or
    dpkg-scanpackages /var/my-local-repo /dev/null > /var/my-local-repo/Packages if you are already root

  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

share|improve this answer
add comment

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".

share|improve this answer
    
its a nice trick but 2 computers to do the process ? hmmmm –  Suhaib Oct 2 '12 at 14:23
add comment

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!

share|improve this answer
add comment

You can use apt-offline or apt-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

share|improve this answer
add comment

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

share|improve this answer
add comment

There are several good, effective answers listed above. However, this is the mechanism I personally use -- apt-ftparchive. I'm documenting it here, in case I need it again in the future. Perhaps it might be useful to you.

Creating the Archive Snapshot

  • Create an instance of Ubuntu that closely mimics the target environment
    • For example, an Ubuntu 12.04 64-bit instance in Amazon
  • Start with a clean package environment
    • sudo apt-get clean
  • Update the package lists
    • sudo apt-get update
  • Download all package updates available
    • sudo apt-get dist-upgrade --download-only
  • Download all relevant packages and dependencies
    • sudo apt-get install --download-only byobu run-one bikeshed dotdee powernap
  • Install the apt-ftparchive utility
    • sudo apt-get install apt-utils
  • Create the package manifest
    • (cd /var/cache/apt/archives/ && sudo apt-ftparchive packages . ) | sudo tee /var/cache/apt/archives/Packages
  • Create an archive of the packages
    • sudo tar cvf snapshot.tar -C /var/cache/apt archives/

Using the Archive Snapshot on the Offline Target System

  • Through some mechanism, you will need to get the snapshot.tar from the source to the target system. Perhaps on a USB stick, or otherwise.
  • Extract the archive on the target system (in this case, in /home/ubuntu)
    • tar xvf snapshot.tar
  • Add the local, offline source to /etc/apt/sources.list
    • echo "deb file:/home/ubuntu/archives /" | sudo tee -a /etc/apt/sources.list
  • Update the package list
    • sudo apt-get update
  • Install the packages as desired
    • sudo apt-get install byobu run-one bikeshed dotdee powernap
share|improve this answer
add comment

For offline installation you will need the packages. If you are using a Debian system

  • get the package file with the .deb file extension and use dpkg -i package_name to install it
  • get the source tarball with the .tar.gz or .tar.bz2 file extension, then extract and install them with:

    • tar -zxvf your_pack.tar.gz or tar -jxvf your_pack.tar.bz2
    • make
    • sudo make install
    • make clean (optional, and may prevent uninstallation)

You may have problems with dependencies. You need to install all those first for a successful offline installation.

share|improve this answer
add comment

You can use Cube. It is an offline package management system which is available to Ubuntu, Linux Mint and other distributions that uses apt-get in installing.

Latest Preview of Cube 1.0.8 (February 7, 2014 Release) Camicri Cube

Running in freshly installed Ubuntu 12.04 Ubuntu

Microsoft Windows -- Downloading packages Downloading Packages

Ubuntu (Original Computer) Installing previously downloaded packages Installing Packages

It is written in C#, and running in both Windows and Linux Distributions using mono-framework. Cube is a portable application, and no additional applications needed to be installed in Linux to use it.

Features :

  • Creates and open projects in Linux and Windows (open only)
  • Download and update repositories
  • Search specific package/application
  • List down packages
  • Filter packages (Installed, Upgradable, Downloaded, Broken)
  • View package information and available screenshot
  • Build package dependencies (Find all packages needed to be installed also)
  • Download packages (both Linux and Windows) using Aria2 and Axel for faster download
  • Download package updates (both Linux and Windows)
  • Installing packages (Linux with superuser privileges)
  • Cleaning not needed downloaded packages
  • Updating project status (Linux)
  • Updating computer's status by transferring downloaded repositories to it (Linux with superuser privileges)
  • Add-APT-Repository feature added. You can now add PPA address format directly to cube
  • Supports 64 bit architecture
  • Supports Translations

You can download it in its Launchpad page (cube.zip) : Camicri Cube Launchpad Page

Or in SourceForge : Camicri Cube SourceForge Page

A tutorial is also included in the zip.

Still in continuous development (BETA) phase, Debian Apt-Based distributions (Ubuntu and Linux Mint) are currently supported (Both 32 and 64bit). Kindly read the "Readme.txt" inside for more details. You could also help in maintaining it by reporting bugs and translating to your language at its launchpad page. Thank you.

share|improve this answer
    
is it .deb or .exe? –  user204653 Dec 15 '13 at 3:53
1  
There is no .deb file because it is standalone, portable and can be executed without installing (just run cube-normal file). Cube.exe is also included for windows users. –  CamicriSystems Dec 18 '13 at 4:10
add comment

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.

share|improve this answer
    
But how to update them afterwards? –  Eliah Kagan Jul 22 '12 at 3:23
add comment

Maybe you take a look at the SuperDeb Creator?

share|improve this answer
4  
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 '12 at 1:56
add comment

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

share|improve this answer
add comment

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)
share|improve this answer
add comment

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.

share|improve this answer
    
(Originally this was an answer to a slightly different question which became merged with that one.) –  Jakob Jul 11 '12 at 20:35
    
Time killing job –  totti May 22 '13 at 8:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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