Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old March 19th, 2009   #1
sergiodlc
Just Give Me the Beans!
 
Join Date: Jan 2006
Location: Havana, Cuba
Beans: 65
Ubuntu 9.04 Jaunty Jackalope
Lightbulb HOWTO: Download package dependencies for offline installation

Have you ever been into trying to install a package in a computer that is not connected to the network? Keep reading to find solutions to this problem.

Follow these Steps:
  1. Find out what packages have to be downloaded

    Case 1: You have a recent synaptic version.

    The first step would be to open Synaptic and select the package(s) you want to install. Then go to File -> Generate package download script and save it naming it as you want (herein referred as download_script_file).

    Case 2: You don't have a recent synaptic version or you are not using any window manager.

    Use grabpackages.py (attached). Type python grabpackages.py -h to see the help. This is the command you would use to download Inkscape and its dependencies:
    Code:
    python grabpackages.py -o download_script_file inkscape
    Now take download_script_file to the computer with internet access.
  2. Download the packages

    Case 1: The computer with internet access has a linux OS with wget installed.

    Open a terminal and cd to a suitable directory (e.g. cd /tmp).

    Create a directory to download the packages and cd into it:
    Code:
    mkdir packages_dir
    cd packages_dir
    Copy download_script_file into this directory and execute it:
    Code:
    sh download_script_file
    The script begins to download the files using wget.

    Case 2: You have a Windows/Linux box but wget is not installed.

    You could try one of these:
    1. Install wget

      In Debian/Ubuntu:
      Code:
      sudo apt-get install wget
      In Redhat/Fedora:
      Code:
      yum install wget
      In Windows: see here.
    2. Generate an html page and download the packages from your browser

      If you already have the download script file generated by synaptic, the easiest way is to use downloadscript2html.py (attached):
      Code:
      python downloadscript2html.py download_script_file download_page.html
      If not, grabpackages.py (attached) will work too (using the --html option). Revisiting the Inkscape example:
      Code:
      python grabpackages.py --html -o download_page.html inkscape
      Now open download_page.html in your browser and download the linked files in your download directory (here a download accelerator like DownThemAll is very useful, specially with large files).
  3. Copy the packages to your PC

    Copy the .deb files you downloaded to /var/cache/apt/archives:

    From the directory where the .deb files are stored type:
    Code:
    sudo cp *.deb /var/cache/apt/archives
    or start Nautilus as root and copy the files in the usual way.
  4. Install the packages

    Just open a terminal and type
    Code:
    sudo apt-get install <package_name(s)>
replacing <package_name(s)> with the name(s) of the program(s) you wanted to install (E.g. inkscape).


This should be pretty much everything.

Note:

The attached scripts are written in Python. In some systems Python is not installed by default. See http://www.python.org/download/ to solve this.

Additional references:
sergiodlc is offline   Reply With Quote
 

Bookmarks

Tags
package dependencies, package installation, setup

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:17 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry