2. HOWTO

Important!

In the examples:

RELEASENAME

must be replaced with one of this strings:

  • stable

  • testing

  • 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 :-(

Debian upgrade without Internet HOWTO

Version 1.01 ~ 15 november 2006