Appendiks C. Installation af Debian 2.1

I dette appendix vil vi gennemgå installation af Debian 2.1. Debian er en distribution, som er dannet af selve sjælen af den frie software verden. Det er ikke noget firma, som står bag Debian - men en global organisation. Debian er sværere end SuSE og Red Hat, men det er en distribution, der er præget af grundighed og højt teknisk niveau. Antallet af programmer, der er oversat til Debians pakkeformat er vildt højt - også højere end antallet af Red Hat/SuSE (RPM) pakker. En let introduktion til Debian kan læses på http://www.debian.org/intro/about.

C.1. Hvad er Debian

I modsætning til RedHat og SuSE distributionerne er Debian noget mere kompliceret at installere, men er uafhængig af firmaer og økonomiske interesser - og er således fint i tråd med Linux-ånden. Debian er ellers en udmærket distribution, men er måske mere for den erfarne Linux bruger. I det følgende vil vi prøve at forklare, hvordan du installerer Debian 2.1. Du bør have styr på valg af partitioner, IO adresse og IRQ på dit netkort og andre "mindre" ting, før du kaster dig ud i Debian.

En Debian distribution består i øjeblikket af to "binary" CD'ere plus eventuelt "non-free", "non-us" samt "contrib", som kan findes på Debians site: http://www.debian.org. Når du har fået fat i et sæt Debian CD'er, er det tid at gå igang.

Er du for utålmodig, er det muligt at downloade en "rescue boot" diskettefil og en "drivers" diskettefil fra en debian site, der så overføres til disketter via DOS programmet RAWRITE2. Desuden skal man også downloade base2_1.tgz (godt 9 MB).

Kan du ikke boote på CDROM, så brug rawrite som beskrevet under installation af Red Hat til at lave rescue disketten /boot/resc1440.bin. Har du en anden Linux-box, så brug dd if=/mnt/cdrom/boot/resc1440.bin of=/dev/fd0, hvis din Debian CDROM er mountet på /mnt/cdrom.

Der bootes fra CDROM eller diskette, og man får nu mulighed via et tekst baseret installations program at specificere alle de sædvanlige options, der skal vælges ved enhver Linux installation: tastatur, swap partition, destinations partition, formattere disse osv. Det vil vi ikke gå i detaljer med, da det er rimeligt nemt at foretage disse valg. Læs, hvad der står på skærmen - der er en del forklaring. De fleste valg sker ved at acceptere det der er valgt for dig.

Det er reelt ikke sværere end Red Hat eller SuSE - endnu. Du skal dog vide, at du i forvejen skal have delt harddisken (med FIPS under DOS) eller købt en ekstra disk til Linux.

Når man er færdig med denne indledende baseinstallation, får man mulighed for at starte dselect programmet med et valg af pakker, der skal tilføjes systemet. Her skal der lige gives et råd: start med at installere et minimums basis system, og tilføj kun de pakker, du synes er nødvendige. Hver Debian pakke har nemlig et konfigurations script, der køres ved installationen af denne. Det kan derfor være en sej proces at installere Debian, hvis man har valgt at installere et stort antal pakker.

C.1.1. Det skrækkelige program dselect

Man tilføjer systemet yderligere *.deb pakker med dselect programmet, som er en frontend til det egentlige installations program, som hedder dkpg. Ved start af dselect fremkommer nedenstående menu på skærmen:

Debian Linux `dselect' package handling frontend.

 * 0. [A]ccess      Choose the access method to use.                      
   1. [U]pdate      Update list of available packages, if possible.
   2. [S]elect      Request which packages you want on your system.
   3. [I]nstall     Install and upgrade wanted packages.
   4. [C]onfig      Configure any packages that are unconfigured.
   5. [R]emove      Remove unwanted software.
   6. [Q]uit        Quit dselect.

Use ^P and ^N, cursor keys, initial letters, or digits to select;
Press ENTER to confirm selection.   ^L to redraw screen.

Version 1.4.0.34 (i386 elf).  Copyright (C) 1994-1996 Ian Jackson.   This is
free software; see the GNU General Public Licence version 2 or later for
copying conditions.  There is NO warranty.  See dselect --licence for details.

Man starter med at vælge access metode, dvs. om man vil installere fra CD, harddisk, NFS server floppy, ftp server eller andet. Her vil de fleste nok vælge Multi-CD, idet der er to CDROM'er med Debian 2.1. Læs forklaringerne til de enkelte metoder, hvis du er i tvivl. Hvis du installerer fra en CD, fås nedenstående skærmbillede, hvor du først bliver bedt om at angive, hvor Debian CDROM'en findes, dvs. hvad block device CDROM drevet er tilsluttet (/dev/hdc, /dev/hdd, /dev/scd1 eller andet).

Derpå spørges der, hvor "top level" er, her skal man som regel indtaste directory navnet "debian". Programmet spørger herefter, hvor de andre fil områder fra Debian's site findes. Dette er lidt forvirrende, men indledningsvis skal man blot indtaste "none", med mindre man har kopieret CD'erne ind på harddisken.

I det følgende er vist en typisk dialog med dselect. Dog skal CDROM devicen naturligvis være den, du bruger, og ikke nødvendigvis /dev/hdd.

If you make a mistake, use the interrupt key (^C) to abort.

I see that /dev/cdrom exists and is a block device.
Last time you specified installation from /dev/scd1.
Insert the CD-ROM and enter the block device name [/dev/scd1]:  /dev/hdd
hdd: media changed

All directory names should be entered relative to the root of the CD-ROM.

I would like to know where on the CD-ROM the top level of the Debian
distribution is (eg. 'dists/stable') - this directory usually contains the
Packages-Master file.

If the CD-ROM is badly organised and doesn't have a straightforward copy of
the distribution you may answer 'none' and we'll go through the parts
I need individually.
Distribution top level ? [none] debian

Using /debian/main/binary-i386' as main binary dir.
Using /debian/main/binary-i386/Packages.gz' for main.
/debian/contrib/binary-i386' does not exist.

Which directory contains the *.deb packages from the contrib distribution
area (this directory is named Contrib/binary-i386' on the distribution site)
?
Say 'none' if this area is not available.
Enter _contrib_ binary dir. [/debian]
? none

Note: most CD-ROM distributions of Debian do not include programs
available in the 'non-free' directory of the distribution site.
This is because these programs have copyrights that prevent
distribution for profit on a CD-ROM - ie they are not free software.
If you wish to install these programs you'll have to get them from an
alternative source.

Which directory contains the *.deb packages from the non-free distribution
area (this directory is named 'Non-free/binary-i386' on the distribution
site) ? Say 'none' if this area is not available.
Enter _non-free_ binary dir. []
 ? none

Which directory contains the *.deb packages from the non-US distribution
area (this directory is named 'Non-US/binary-i386' on the distribution site)
?
Say 'none' if this area is not available.
Enter _non-US_ binary dir. []
 ? none

Which directory contains the *.deb packages from the non-US distribution
area (this directory is named 'Non-US/binary-i386' on the distribution site)
?
Say 'none' if this area is not available.
Enter _non-US_ binary dir. []
 ? none

Note: By default there is no 'Local' directory. It is intended for
packages you made yourself.

Which directory contains the *.deb packages from the local distribution
area (this directory is named 'Local/binary-i386' on the distribution site) ?
Say 'none' if this area is not available.
Enter _local_ binary dir. []
 ?  none

Hit RETURN to continue.

Derpå vælges punktet update, og efter et lille øjeblik er du klar til det egentlige; at vælge, hvilke pakker der skal installeres. Som det første får du et hjælpebillede op med en intro til dselect. Læs dette og de næste par hjælpebilleder. Det er lidt besværligt, men hjælpeteksten er nødvendig for at forstå 'dselect' programmet. Du kan nu prøve at taste <ENTER> og se, om de pakker der initielt er valgt, forårsager afhængigheds/versions konflikter. Hvis du ikke kan komme ud af select menuen med <ENTER>, kan du afslutte select delen med X. Læs hjælpeteksten. Derpå installeres de valgte *.deb pakker ved at vælge Install fra hovedmenuen. Se iøvrigt: http://www.debian.org/releases/2.1/i386/dselect-beginner), som er oversat til sidst i denne vejledning.

Nu kommer der en masse tekst rullende. Undertiden skal du svare på forskellige konfigurations spørgsmål, men ellers foregår konfigurationen i næste hovedmenupunkt, og set i sammenligning med Red Hat og SuSE er dette lidt besværligt.

C.1.2. dpkg for begyndere

For at konfigurere pakker til dit system skal du køre kommandoen dpkg --pending --configure. Det gør, at man får sat de enkelte programmer op til maskinen efter, at pakkerne er blevet installeret.

C.1.3. dselect for begyndere

Vi har set følgende dselect menu før, men lad os nu se på, hvad de enkelte punkter er.

     _________________________________________________________________

                dselect Documentation for Beginners - Chapter 2
                           Once dselect is Launched
     _________________________________________________________________

   Once in dselect you will get this screen:
     Debian Linux `dselect' package handling frontend.

     0.  [A]ccess  Choose the access method to use.
     1.  [U]pdate  Update list of available packages, if possible.
     2   [S]elect  Request which packages you want on your system.
     3.  [I]nstall Install and upgrade wanted packages.
     4.  [C]onfig  Configure any packages that are unconfigured.
     5.  [R]emove  Remove unwanted software.
     6.  [Q]uit    Quit dselect.

   Let's look at these one by one.
     _________________________________________________________________

C.1.3.1. Access

Under punktet Access kommer der endnu en menu frem, hvor man kan være access type.

  • Forkortelse - Beskrivelse.

  • cdrom - Installér fra en CDROM.

  • multi_cd - Installér fra et CDROM sæt.

  • nfs - Installér fra en NFS server.

  • multi_nfs - Installér fra en NFS server (som har CDROM sættet).

  • harddisk - Installér fra en hard disk partition, som ikke er mountet.

  • mounted - Installér fra et filesystem som er mountet.

  • multi_mount - Installér fra en partition, der er mountet, hvor indhold ændrer sig (dropper fil cache).

  • floppy - Installér fra en pile of floppy disks.

  • apt - Anden type installation [file,http,ftp].

I denne menu skal vi fortælle dselect, hvor vores pakker findes. Du kan bare ignorere den rækkefølge, menupunkterne kommer i, idet du bare skal vælge den rette installationsmetode. Det kan være, at du faktisk har et par muligheder ud over dem, der er vist, eller at de kommer i en lidt anden rækkefølge - det gør ikke så meget. Vi skal nu se på de enkelte metoder - resten bliver dog på engelsk, og er mest ment som en hjælp til den, som vil installere, til at kunne se det igennem, inden du installerer.

  • multi_cd : Quite large and powerful, this complex method is the recommended way of installing a recent version of Debian from a set of multiple binary CDs. Each of these CDs should contain information about the packages in itself and all prior CDs (in the file Packages.cd). When you first select this method, be sure the CD-ROM you will be using is not mounted. Place the last binary disk of the set (we don't need the source CDs) in the drive and answer the questions you are asked:

    • CD-ROM drive location

    • Confirmation that you are using a multi-cd set

    • The location of the Debian distribution on the disk(s)

    • [ Possibly ] the location(s) of the Packages file(s)

    Once you have updated the available list and selected the packages to be installed, the multi-cd method diverges from normal procedure. You will need to run an "install" step for each of the CDs you have in turn. Unfortunately due to the limitations of dselect it will not be able to prompt you for a new disk at each stage; the way to work for each disk is

    • + Insert the CD in your CD-ROM drive.

    • + From the main dselect menu, select "Install".

    • Wait until dpkg finishes installing from this CD (it may report installation successful, or possibly installation errors. Don't worry about these until later).

    • Hit [Return] to go back to the main dselect menu.

    • Repeat with the next CD in the set...

    It may be neccesary to run the installation step more than once to cover the order of package installation - some packages installed early may need to have later packages installed before they will configure properly.

    Running a "Configure" step is recommended, to help fix any packages that may end up in this state.

  • multi_nfs, multi_mount : These are very similar to the multi-cd method above, and are refinements on the theme of coping with changing media, for example if installing off a multi-cd set exported via NFS from another machine's CD-ROM drive.

  • apt : One of the best options for installation from a local mirror of the Debian archive, or from the network. This method uses the "apt" system to do complete dependancy analysis and ordering, so it's most likely to install packages in the optimal order.

    Configuration of this method is straight-forward; you may select any number of different locations, mixing and matching file: URLs (local disks or NFS mounted disks), http: URLs, or ftp: URLs. Note however that the HTTP and FTP options do not support local authenticating proxies.

    If you have proxy server for either http or ftp (or both), make sure you set the http_proxy or ftp_proxy environment variables, respectively. Set them from your shell before starting dselect, i.e.: # export http_proxy=http://gateway:3128/ # dselect

  • floppy : Caters for those people without CD-ROM or network access. Not recommended as a viable installation option anymore if you are using traditionally-sized floppies, but may work better for LS/120 or Zip drives. Specify the location of your floppy drive, then feed floppies. The first one should contain the Packages file. This method is slow and may be unreliable due to media problems.

  • nfs : DEPRECATED METHOD -- use apt or multi_nfs instead. Only try this method if all else fails.

    This is a simple installation method, with simple requirements: give it the address of the NFS server, the location of the Debian distribution on the server and (maybe) the Packages file(s). Then dselect will install the various sections in turn from the server. Slow but easy; does not use proper ordering, so it will take many runs of the "Configure" step. Obviously only appropriate for NFS based installation.

  • harddisk : DEPRECATED METHOD -- use apt or multi_mount instead. Only try this method if all else fails.

    Supply the block device of the hard drive partition to use, and as usual the locations of the Debian files on that partition. Slow and easy. Does not use proper ordering, so it will take many runs of the "Configure" step. Not recommended, since the "apt" method supports this functionality, with proper ordering.

  • mounted : DEPRECATED METHOD -- use apt or multi_mount instead. Only try this method if all else fails.

    Simply specify the location(s) of the Debian files in your filesystem. Possibly the easiest method, but slow. Does not use proper ordering, so it will take many runs of the "Configure" step.

  • cdrom : DEPRECATED METHOD -- use multi_cd instead.

    Designed for single-CD installations, this simple method will ask for the location of your CD-ROM drive, the location of the Debian distribution on that disk and then (if necessary) the location(s) of the Packages file(s) on the disk. Simple but quite slow. Does not use proper ordering, so it will take many runs of the "Configure" step. Not recommended, because it assumes the distribution is on a single CD-ROM, which is no longer the case. Use the "multi_cd" method instead.

If you run into any problems -- maybe Linux can not see your CD-ROM, your NFS mount is not working or you have forgotten which partition the packages are on -- you have a couple of options:

  • Start another shell. Fix the problem and then return to the main shell.

  • Quit dselect and run it again later. You might even need to shut down the computer to solve some problem. This is quite ok but when you come back to dselect run it as root. It will not be run automatically after the first time.

After you choose the access method dselect will get you to indicate the precise location of the packages. If you do not get this right the first time hit Control-C and return to the "Access" item.

Once you are through here you will be returned to the main screen.

C.1.3.2. Update

dselect will read the Packages or Packages.gz files from the mirror and create a database on your system of all available packages. This may take a while as it downloads and processes the files.

C.1.3.3. Select

Hang on to your hat. This is where it all happens. The object of the exercise is to select just which packages you wish to have installed.

Hit Enter. If you have a slow machine be aware that the screen will clear and can remain blank for 15 seconds so don't start bashing keys at this point.

The first thing that comes up on the screen is page 1 of the Help file. You can get to this help by hitting ? at any point in the "Select" screens and you can page through the help screens by hitting the . (full stop) key.

Before you dive in note these points:

  • To exit the "Select" screen after all selections are complete, hit Enter. This will return you to the main screen if there is no problem with your selection. Otherwise, you will be asked to deal with that problem. When you are happy with any given screen hit Enter to get out.

  • Problems are quite normal and are to be expected. If you select package A and that package requires package B to run, then dselect will warn you of the problem and will most likely suggest a solution. If package A conflicts with package B (i.e., if they are mutually exclusive) you will be asked to decide between them.

Let's look at the top two lines of the "Select" screen.

  • dselect - main package listing (avail., priority) mark:+/=/- verbose:v help:?

  • EIOM Pri Section Package Inst.ver Avail.ver Description

This header reminds us of some of the special keys:

  • + Select a package for installation.

  • = Place a package on hold -- useful on a broken package. You can reinstall an older version and place it on hold while you wait for a new one to appear.

  • - Remove a package.

  • _ Remove a package and its config files.

  • i,I Toggle/cycle info displays.

  • o,O Cycle through the sort options.

  • v,V A terse/verbose toggle. Use this key to unlock the meanings of EIOM on line two, but I'll give you a summary here anyway. (Note that upper and lower case keys are quite different in effect).

  • Flag Meaning Possible values

  • E Error Space, R, I

  • I Installed state Space, *, -, U, C, I

  • O Old mark *, -, =, _, n

  • M Mark *, -, =, _, n

Rather that spell all this out here I refer you to the Help screens where all is revealed. One example though.

You enter dselect and find a line like this:

     EIOM Pri  Section  Package   Description
       ** Opt  misc     loadlin   a loader (running under DOS) for LINUX kernel
This is saying that loadlin was selected when you last ran dselect and that it is still selected, but it is not installed. Why not? The answer must be that the loadlin package is not physically available. It is missing from your mirror.

The information which dselect uses to get all the right packages installed is buried in the packages themselves. Nothing in this world is perfect and it does sometimes happen that the dependancies built into a package are incorrect, with the result that dselect simply cannot resolve the situation. A way out is provided where the user can regain control and it takes the form of the commands Q and X which are available in the "Select" screen.

  • Q An override. Forces dselect to ignore the built in dependancies and to do what you have specified. The results, of course, will be on your own head.

  • X Use X if you get totally lost. It puts things back the way they were and exits.

  • Keys which help you not to get lost (!) are R, U and D.

  • R Cancels all selections at this level. Does not affect selections made at the previous level.

  • U If dselect has proposed changes and you have made further changes U will restore dselect's selections.

  • D Removes the selections made by dselect, leaving only yours.

An example follows. The boot-floppies package (not an example for beginners, I know, but it was choosen because it has a lot of dependencies) depends on these packages:

     * libc6-pic
     * slang1-pic
     * sysutils
     * makedev
     * newt0.25
     * newt0.25-dev
     * popt
     * zlib1g
     * zlib1g-dev
     * recode

The person maintaining boot-floppies also thinks that the following packages should be installed. These are not, however, essential:

     * lynx
     * debiandoc-sgml
     * unzip
So when I select boot-floppies I get this screen:
     dselect - recursive package listing mark:             +/=/- verbose:v help:?
     EIOM Pri Section Package Description

     dselect - recursive package listing                         mark:+/=/- verbose:v help:?
     EIOM Pri Section  Package      Description
       ** Opt admin    boot-floppie Scripts to create the Debian installation floppy set.
       _* Opt devel    newt0.25-dev Developer's toolkit for newt windowing library
       _* Opt devel    slang1-dev   The S-Lang programming library, development version.
       _* Opt devel    slang1-pic   The S-Lang programming library, shared library subset ki
(Other packages may or may not appear, depending on what is already in your system). You'll notice that all the required packages have been selected for me.

The R key puts things back to the starting point.

     dselect - recursive package listing mark:             +/=/- verbose:v help:?
     EIOM Pri Section Package Description

     dselect - recursive package listing                         mark:+/=/- verbose:v help:?
     EIOM Pri Section  Package      Description
       __ Opt admin    boot-floppie Scripts to create the Debian installation floppy set.
       __ Opt devel    newt0.25-dev Developer's toolkit for newt windowing library
       __ Opt devel    slang1-dev   The S-Lang programming library, development version.
       __ Opt devel    slang1-pic   The S-Lang programming library, shared library subset ki

   To decide now that you don't want boot-floppies, just hit Enter.

   The Dkey puts things the way I selected them in the first place:
     dselect - recursive package listing mark:             +/=/- verbose:v help:?
     EIOM Pri Section Package Description

     dselect - recursive package listing                         mark:+/=/- verbose:v help:?
     EIOM Pri Section  Package      Description
       _* Opt admin    boot-floppie Scripts to create the Debian installation floppy set.
       __ Opt devel    newt0.25-dev Developer's toolkit for newt windowing library
       __ Opt devel    slang1-dev   The S-Lang programming library, development version.
       __ Opt devel    slang1-pic   The S-Lang programming library, shared library subset ki
The U key restores dselect's selections:
     dselect - recursive package listing mark:             +/=/- verbose:v help:?
     EIOM Pri Section Package Description

     dselect - recursive package listing                         mark:+/=/- verbose:v help:?
     EIOM Pri Section  Package      Description
       _* Opt admin    boot-floppie Scripts to create the Debian installation floppy set.
       _* Opt devel    newt0.25-dev Developer's toolkit for newt windowing library
       _* Opt devel    slang1-dev   The S-Lang programming library, development version.
       _* Opt devel    slang1-pic   The S-Lang programming library, shared library subset ki

I suggest running with the defaults for now -- you will have ample opportunity of adding more later.

Whatever you decide, hit Enter to accept and return to the main screen. If this results in unresolved problems you will be bounced right back to another problem resolution screen.

So the R, U, and D keys are very useful in "what if" situations. You can experiment at will and then restore everything and start again. Don't look on them as being in a glass box labelled "Break In Emergency".

After making your selections in the "Select" screen, hit the I to give you a big window, t to take you to the beginning and then use the Page-Down key to look quickly through the settings. This way you can check the results of your work and spot glaring errors. Some people have deselected whole groups of packages by mistake and not noticed the error until too late. dselect is a very powerful tool so don't misuse it.

You should now have this situation:

     package category     status

     required             all selected
     important            all selected
     standard             mostly selected
     optional             mostly deselected
     extra                mostly deselected
Happy? Hit Enter to exit the "Select" process. You can come back and run "Select" again if you wish.

C.1.3.4. Install

dselect runs through the entire set of 2250 packages and installs those selected. Expect to get asked to make decisions as you go. It is often useful to switch to a different shell to compare, say, an old config with a new one. If the old file is conf.modules the new one will be conf.modules.dpkg-dist.

The screen scrolls past fairly quickly on a fast machine. You can stop/start it with Control-s/Control-q and at the end of the run you will get a list of any uninstalled packages. If you want to keep a record of everything that happens use normal Unix features like tee or script.

It can happen that a package does not get installed because it depends on some other package which is listed for installation but is not yet installed. The answer here is to run "Install" again. Cases have been reported where it was necessary to run it 4 times before everything slipped into place. This will vary by your acquisistion method.

C.1.3.5. Configure

Most packages get configured in step 3, but anything left hanging can be configured here.

C.1.3.6. Remove

Removes packages that are installed but no longer required.

C.1.3.7. Quit

I suggest running /etc/cron.daily/find at this point as you have a lot of new files on your system. Then you can use locate to get the location of any given file.