Debian upgrade without Internet HOWTO

  Johan Haggi

   Version 1.01

   Copyright  2004, 2006 Johan Haggi

  Warning!

   THE AUTHOR IS NOT RESPONSABLE FOR ERROR IN THIS DOCUMENT. EVERY USE OF
   IDEAS, EXAMPLES AND OTHER CONTENTS OF THIS DOCUMENT IS UNDER YOUR
   RESPONSIBILITY AND THE ENTIRE RISK IS WITH YOU.

  License

   You can copy and distribute verbatim copies of this document under the
   condition that this license accompanies each copy.

   You can modify this document and you can distribute modified (or
   translated) copies of this document under this conditions:

     o you must write the author of the modifications (or of the translation)
       and you must write that it is a modified work;

     o you must include in the copyright advice a reference to the original
       author;

     o you must write where is available the original document;

     o the modified document must be distributed (at your choise):

          o under the terms of this license

          o under the terms of the GNU GPL

          o under the terms of the GNU FDL, with no Invariant Sections.

   15 november 2006

   +------------------------------------------------------------------------+
   | Revision History                                                       |
   |------------------------------------------------------------------------|
   | Revision 1.01                    | 15 november 2006                    |
   |------------------------------------------------------------------------|
   | General revision. Write in XML (DocBook)                               |
   |                                                                        |
   | Add examples for contrib, non-free and for security.debian.org         |
   |                                                                        |
   | First translation in English                                           |
   |------------------------------------------------------------------------|
   | Revision 1.00                    | 7 march 2004                        |
   |------------------------------------------------------------------------|
   | First public release. Write in HTML                                    |
   +------------------------------------------------------------------------+

   Abstract

   How to upgrade the package's list for Debian and download only the
   packages that you need also without an Internet connection

     ----------------------------------------------------------------------

   Table of Contents

   1. Introduction

                1.1. This document's availability

                1.2. Contact the author

                1.3. Conventions

   2. HOWTO

   A. Links

1. Introduction

  1.1. This document's availability

   It is possible to read this document online at the URL:
   http://www.orsobruno.net/linux/docs/Debian-upgrade-without-Internet-HOWTO-en/index.html

   It is possible to download it (for offline reading and/or for printing
   and/or for modifying) in the formats HTML, TXT, PDF, XML (DocBook source)
   at URL: http://www.orsobruno.net/download/index.html#debup-nointernet-en

   It is also available the original Italian version

  1.2. Contact the author

   You can write to me at the e-mail address: jh@orsobruno.net

  1.3. Conventions

   I use in this document this conventions:

     o Xxx

       A software. Example: GNU Wget is available

     o xxx yyy

       A command and its options. Example: to use wget -O

     o xxx

       The name of a file. Example: /etc/hostname

     o xxx

       A string that must be replaced. Example: replace release with ...

     o xxx

       A string that must be unmodified. Example: replace ... with stable

     o xxx
 yyy

       The content of a file. Example: the content of my /etc/hosts is:

 127.0.0.1       localhost.localdomain   localhost
 192.168.1.1     linux.casamia           linux

     o xxx yyy

       An user's input and a computer's output. Example: if you type: ls
       nonexistent_file you read: ls: nonexistent_file: No such file or
       directory

     o prompt input
 output

       A terminal's screen. Example:

 user@machine:~$ ls nonexistent_file
 ls: nonexistent_file: No such file or directory

2. HOWTO

  Important!

   In the examples:

   RELEASENAME

           must be replaced with one of this strings:

              o stable

              o testing

              o unstable

           Remember that security's update are available only for stable and
           testing

   DEBIANMIRROR

           must be replaced with the name of Debian mirror faster for Caio
           (example: ftp.debian.org).

   Tizio is a Debian user and he wants to upgrade him distibution but he
   don't has an Internet access (or he has a slow and/or expansive access).
   Instead him friend Caio has a fast and "flat" access, but Caio uses
   another Linux distribution or an other operative system (he will must use
   only a program: GNU Wget).

   Tizio do not want to abuse of Caio (and of mirror's band) with a download
   of all CD's iso-images: they content programs that he will never use.

   Tizio must run the commands as root

   If Tizio has not Internet access he must run all the points below, instead
   if he has a slow access he can begin with point 3.

    1. Caio downloads the package's list:

 caio@quick:~$ mkdir per-tizio-1 ; cd per-tizio-1

 caio@quick:~/per-tizio-1$ wget -O main.Packages.gz http://DEBIANMIRROR/debian/dists/RELEASENAME/main/binary-i386/Packages.gz

 caio@quick:~/per-tizio-1$ wget -O contrib.Packages.gz http://DEBIANMIRROR/debian/dists/RELEASENAME/contrib/binary-i386/Packages.gz

 caio@quick:~/per-tizio-1$ wget -O non-free.Packages.gz http://DEBIANMIRROR/debian/dists/RELEASENAME/non-free/binary-i386/Packages.gz

 caio@quick:~/per-tizio-1$ wget http://DEBIANMIRROR/debian/dists/RELEASENAME/Release

 caio@quick:~/per-tizio-1$ wget -O security.main.Packages.gz http://security.debian.org/dists/RELEASENAME/updates/main/binary-i386/Packages.gz

 caio@quick:~/per-tizio-1$ wget -O security.contrib.Packages.gz http://security.debian.org/dists/RELEASENAME/updates/contrib/binary-i386/Packages.gz

 caio@quick:~/per-tizio-1$ wget -O security.non-free.Packages.gz http://security.debian.org/dists/RELEASENAME/updates/non-free/binary-i386/Packages.gz

 caio@quick:~/per-tizio-1$ wget -O security.Release http://security.debian.org/dists/RELEASENAME/updates/Release


       and he get them to Tizio

    2. Tizio expands the files *Packages.gz and copies all the files in
       /var/lib/apt/lists/ with the correct names:

 root@slow:~# gunzip *.Packages.gz

 root@slow:~# cp main.Packages /var/lib/apt/lists/DEBIANMIRROR_debian_dists_RELEASENAME_main_binary-i386_Packages

 root@slow:~# cp contrib.Packages /var/lib/apt/lists/DEBIANMIRROR_debian_dists_RELEASENAME_contrib_binary-i386_Packages

 root@slow:~# cp non-free.Packages /var/lib/apt/lists/DEBIANMIRROR_debian_dists_RELEASENAME_non-free_binary-i386_Packages

 root@slow:~# cp Release /var/lib/apt/lists/DEBIANMIRROR_debian_dists_RELEASENAME_Release

 root@slow:~# cp security.main.Packages /var/lib/apt/lists/security.debian.org_dists_RELEASENAME_updates_main_binary-i386_Packages

 root@slow:~# cp security.contrib.Packages /var/lib/apt/lists/security.debian.org_dists_RELEASENAME_updates_contrib_binary-i386_Packages

 root@slow:~# cp security.non-free.Packages /var/lib/apt/lists/security.debian.org_dists_RELEASENAME_updates_non-free_binary-i386_Packages

 root@slow:~# cp security.Release /var/lib/apt/lists/security.debian.org_dists_RELEASENAME_updates_Release

    3. Tizio adds the below lines (if he have not them) at the file
       /etc/apt/sources.list; he must control that they are after the lines
       about him CD-ROM:

 deb http://DEBIANMIRROR/debian RELEASENAME main contrib non-free
 deb http://security.debian.org/ RELEASENAME/updates main contrib non-free

       now he runs the command:

 root@slow:~# apt-get update

 root@slow:~# apt-get -y --print-uris dist-upgrade > packages_list.txt

       If he wants install or upgrade only some specific packages, he must
       replace: apt-get -y --print-uris dist-upgrade with: apt-get -y
       --print-uris install NAMES_OF_PACKAGES

    4. The file packages_list.txt contents some messages of apt (they are
       only in part in the below example), and the URIs of all the packages
       to be going install:

 Lettura della lista dei pacchetti in corso...
 Generazione dell'albero delle dipendenze in corso...
 I seguenti pacchetti NUOVI (NEW) saranno installati:
 apt-index-watcher [...]
 I seguenti pacchetti sono stati mantenuti alla versione attuale:
 gdk-imlib1 [...]
 I seguenti pacchetti saranno aggiornati:
 alsa-base [...]
 173 aggiornati, 4 installati, e 1 non aggiornati.
  necessario prendere 299MB/299MB di archivi.
 Dopo l'estrazione, verranno occupati 11,9MB di spazio su disco.
 'cdrom:[Debian GNU/Linux testing _Etch_ - Official Snapshot i386 Binary-2 (20060918)]/pool/main/r/root-tail/root-tail_1.2-2_i386.deb' root-tail_1.2-2_i386.deb 20952 8403dcbcf6ccdd43decf44ffe13
 1b5b9
 'http://ftp.it.debian.org/debian/pool/main/a/alsa-driver/alsa-base_1.0.12-1_all.deb' alsa-base_1.0.12-1_all.deb 166330 d07527f4d209e4887d0bcb907d135891
 [...]

       the format of line about packages is: 'URI' FILE_NAME FILE_DIMENSION
       FILE_MD5_HASH

       Tizio cancels the lines with apt's messages, the lines about packages
       that he has on CD-ROM and he must conserve only the URIs of packages
       that he must download:

 root@slow:~# cat packages_list.txt | egrep "^'http:" | sed "s/'//" | sed "s/'.*//" > url_list.txt

    5. Tizio gives url_list.txt to Caio, Caio runs:

 caio@quick:~$ mkdir per-tizio-2 ; cd per-tizio-2

 caio@quick:~/per-tizio-2$ wget -i url_list.txt

       and he copies the packages on one (or more) CD.

    6. Tizio receives from Caio the CD. It is not a Debian CD and he cannot
       use it directly, but he must copy the packages in
       /var/cache/apt/archives/ and he can install them (or he can create a
       local personal mirror with apt-move).

  Important

   The trick of manually to copy the files Packages in /var/lib/apt/lists/ is
   OK with apt-get (apt-get update gives an error message but the package's
   list is updated) but it doesn't work with dselect (the error message of
   update is the same but package's list are not updated). Why? I don't know
   :-(

A. Links

     o GNU Wget http://wget.sunsite.dk is available for almost modern
       variants of UNIX and also for Microsoft Windows and MS-DOS. The
       mirror's list for source code is available at
       http://www.gnu.org/order/ftp.html

       Binaries for Win32 and a HOWTO about compilation on Windows are
       available from http://www.christopherlewis.com/WGet/default.htm
