Differences between revisions 6 and 7
Revision 6 as of 2015-04-08 13:02:41
Size: 42007
Editor: ?AlexanderAlemayhu
Comment:
Revision 7 as of 2015-04-09 17:22:11
Size: 41855
Editor: ?AlexanderAlemayhu
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
== Støtte for 4 GB minne <-- inn under konfigurasjonstyring ==

Brukertilfelle: Fordi det er begrenset plass på Skolelinux/Debian-edu CD-en er det bare lagt med en Linux-kjerne, altså minste felles multiplum. Det betyr at det er lagt med en kernel som ''virker'' på flest mulig typer maskinvare.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

Hvilken type kernel som kjører finner man ut med kommandoen '''uname -a'''. Kommandoen kan brukes senere for å sikre at man har oppgradert til ønsket kjerne. Da kan det se slik ut:
== Support for 4 GB memory <--include in configuration management ==

User Case: Because there is limited space on the Skolelinux/Debian-Edu CD only one Linux kernel is included, i.e. the lowest common denominator. That means it is added a kernel ''working'' at as many as possible different types of hardware.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

The type of kernel running, you find with the command '''uname -a'''. The command can be used later to ensure you have upgraded to the required core. Then it may look like this:
Line 17: Line 17:
Her kjøres en 386-kjerne, som burde virke på omtrent alt av PC-er. Men den er ikke optimal for to prosessorkjerner eller mer enn 940 MB minne.

Ønskes en kjerne for nye tjenermaskiner med masse minne og flere prosessorer, kan du laste ned og installere dette etterpå. Pakkesystemet til Debian gjør dette enkelt.

Se på [[#UsefulCommands--apt-get|Seksjon 8.9]] for en mer detaljert beskrivelse av '''apt-get''' og '''dpkg'''.

'''smp''' er nøkkelordet man må se etter når man vil ha en Linux-kjerne med støtte for mere minne enn 940MB minne og doble prosessorer. Forkortelsen smp står for ''Symmetric Multi-Processors''. Kommandoen kjøres fra et [[#UsefulCommands--shell|skall]] som lister ut antall kjerner klar for installasjon:
Here runs a 386-core, which should work on just about all of PCs. But it is not optimal for two processor cores or more than 940MB.

If you want a kernel for new servers with plenty of memory and multiple processors, you can download and install it afterwards. The package system of Debian makes this easy.

Look at [[#UsefulCommands--apt-get|Section 8.9]] for a more detailed description of '''apt-get''' and '''dpkg'''.

'''smp''' is the keyword to look for when you want a Linux kernel with support for more RAM than 940MB of memory and dual processors. The acronym stands for mp''Symmetric Multi-Processors''. The command is run from a [[#UsefulCommands--shell|shell]] which lists the number of cores ready for installation:
Line 27: Line 27:
. Når dette skrives får man følgende utlisting: . At the time this is written the following is listed:
Line 43: Line 43:
Det er ikke behov for å oppgi en bestemt kjerne-versjon som 2.4.27 eller 2.6.8. Bare bruk 2.4 eller 2.6. Dette koker ned til There is no need to specify a specific kernel version like 2.4.27 or 2.6.8. Just use 2.4 or 2.6. This boils down to
Line 53: Line 53:
Nå trenger man kun å vite hva slags prosessor man har som f.eks. 686 (Intel), k7 (AMD), AMD64 eller EM64T

Straks man vet vilken kjerne som passer på maskinen kan den installeres med kommandoen
Now you just need to know what kind of processor you have eg. 686 (Intel), k7 (AMD) AMD64 or EM64T

As soon as which kernel fit the machine best it can be intsalled using the command
Line 59: Line 59:
Er det en Intel Xeon i maskinen kan man bruke If the machine contain an Intel Xeon one can use
Line 63: Line 63:
Bruker man en 2.4-kjerne If a 2.4 kernel is used
Line 71: Line 71:
Når man installerer ny kjerne kan man se noe som dette: When you install the new kernel, you may see something like this:
Line 115: Line 115:
Som det vises ble det spurt om å installere kernel-image-2.6-686-smp, og det ble automatisk oversatt til å installere kernel-image-2.6.8-2-686-smp. Det ble også foreslått å installere noen andre pakker som kan være nyttige. As it appears, you were asked to install kernel-image-2.6-686-smp, and it automatically translated to install kernel-image-2.6.8-2-686-smp. It was also proposed to install any other packages that might be useful.
Line 123: Line 123:
Bygge av kjerne på en Skolelinux/Debian-edu-maskin er eneste gang man bever omstart. Når man installerer andre program er det ikke behov for omstart. Building a core at a Skolelinux / Debian-Edu machine, is the only time you ever need a restart. When installing other programs there is no need for a restart.
Line 133: Line 133:
Etter installasjon av smp-kjerne, og omstart er utført, kan man kjøre kommandoen '''free''' og '''cat /proc/cpuinfo'''. Då kan man se om den nye kjernen bruker alt minne og begge prosessorer. After installation of smp kernel and rebooted, you can run the command '''free''' and '''cat /proc/cpuinfo'''. Then you can see if the new kernel uses all memory and both processors.
Line 142: Line 142:
Her er en nedkortet utskrift som har fjernet unødvendig utskrift. Here is a shortened printing with the unnecessary printing removed .
Line 184: Line 184:
Man kan arbeide med pakkeadministrasjon på kommandolinja. Det er flere grafiske program også som f.eks. KPackage [[#UsefulCommands--kpackage|7]] eller Webmin [[#UsefulCommands--webmin|12]] You can work with package management at the command line. It is more graphical applications like for example KPackage [[#UsefulCommands--kpackage|7]] or Webmin [[#UsefulCommands--webmin|12]]
Line 207: Line 207:
Merk at linjene ''uten'' skigard ( # ) forran kan brukes som referanse til pakkearkiv. Eksemplet vise at man kun får pakker fra CD-rommen som ble brukt under installsjon. Andre arkiv er ikke aktivisert. Skal man gjøre dette bør man åpne for sikkerhetsoppgraderinger. Så kan man prøve seg på andre arkiver for flere pakker. Note that the lines ''witout'' hashtag (#) can be used as reference to the package archive. The example show that one only gets packets from the cdrom used during installation. Other archives are not activiated. When doing this, one should open for security upgrades. So you can try other archives for more packages.
Line 230: Line 230:
Legges det til en ny linje i denne fila må man også oppdatere databasen som har informasjon om hva som er tilgjengelig.

Se [[#UsefulCommands--sources.list|Kapittel 13]] for andre linjer som kan legges inn som kilde for pakker.
If you add a new line to this file, you must update the database with information about what that is available.

See [[#UsefulCommands--sources.list|chapter 13]] for other lines to add as package sources.
Line 236: Line 236:
Linkene til pakkearkiv har en bestemt utforming. Følger man ikke dette får man feilmelding ved oppdatering med oppfordring om å rette feilen. Links to package archive have a specific design. Failure to follow this gives error messages when updating, with a request to correct the error.
Line 248: Line 248:
Utvalget av tilgjengelige pakker oppdateres stadig. Det mest vanlige er at det kommer sikkerhetsoppdateringer. Nye versjoner av programvaren kan også bli lagt ut. Derfor må man oppdatere informasjonen om pakkearkivene. Dette gjøres med følgende kommando The range of available packages is constantly updated. The most common is new security updates. New versions of the software can also be posted. Therefore, one must update the package archives. This is done with the following command
Line 289: Line 289:
Alle pakkene som allerede er installert kan oppgraderes til nyere versjoner med kommandoen All installed packages can be upgraded to newer versions using the command
Line 308: Line 308:
Bare trykk '''Enter''' eller 'Y' og så '''Enter'''. Pakkene vil lastes ned og installeres automatisk. Man vil få en endringslogg i det oppgraderingen starter.

Straks man har oppgradert kan man slette pakkene som er lasted ned i katalogen `/var/cache/apt/archives/`. Bruk kommandoen
Just press '''Enter''' or 'Y' and '''Enter'''. The packages will be downloaded and installed automatically. One will get a change log when the upgrade begins.

Once you have upgraded, you can delete the packages downloaded in the directory`/var/cache/apt/archives/`. Use the command
Line 314: Line 314:
for å rydde i arkivet. Dette bør gjøres av og til. Ellers blir `/var` fylt opp. to clear the archive. This should be done occasionally. Otherwise `/var` becomes filled up.
Line 318: Line 318:
Noen ganger er det greit å se hva som kommer til å skje ''før'' man oppgraderer. Man vil gjøre en vurdering om det er behov for å laste ned flere store pakker. Kanskje må man vente til det er mer tilgjengelig nettkapasitet. Kjører man Sometimes it's okay to see what is going to happen ''before'' upgrading. If judging whether it is necessary to download several large packages, maybe you need to wait until there is more bandwidth available. If you run
Line 322: Line 322:
vil man simulere hva som vil skje, uten at det faktisk skjer. Er dette for mye informasjon på skjermen kan man kjøre if one will simulate what will happen, without it actually happens. Is it too much information on the screen, one can run
Line 326: Line 326:
Ser det greit ut, kan man kjøre kommandoen igjen uten paramteret '''--simulate'''

Det går også å bruke '''aptitude dist-upgrade''' i kombinasjon med '''apt-get upgrade'''.
If it look good, one can run the command again without the '''--simulate''' parameter

It is also possible to use '''aptitude dist-upgrade''' in combination with '''apt-get upgrade'''.
Line 332: Line 332:
Noen ganger vil man få en melding om endringer som berører pakker som skal oppgraderes eller installeres, som her Sometimes you will get a message about changes affecting packages to upgrade or install, as here
Line 426: Line 426:
== Vis tilgjengelig informasjon om pakker ==

Brukertilfelle: Ønsker å få opplysninger om pakken. Det kan være avhengigheter til andre pakker ol.
== Show available information about packages ==

User case: Want to get information about the package. There may be dependencies to other packages etc..
Line 442: Line 442:
vil gi detaljer om pakken. gives details about the package.
Line 464: Line 464:
Så man ser pakken kdissert ikke er installert, men tilgjengelig for installasjon i versjon 0.3.8-1 fra `http://ftp.debian.org One sees package kdissert is not installed, but available for installation in version 0.3.8-1 from `http://ftp.debian.org
Line 469: Line 469:
Brukertilfelle: Ønsker å installere et program eller programpakke.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

Når man har funnet pakken som skal installeres, kjøres kommandoen

'''apt-get install <pakkenavn>'''

Ønsker man å se hva som skjedde under installasjon bør man kjøre en simulering først med kommandoen

'''apt-get install <pakkenavn> --simulate'''
Use case: Want to install a program or a program package.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

When you have found the package to be installed, run the command

'''apt-get install <package name>'''

If you want to see what happened during the installation one should run a simulation first with the command

'''apt-get install <package name> --simulate'''
Line 509: Line 509:
Brukertilfelle: Ønsker å fjerne bestemte pakker som ikke skal brukes.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

For å finne en bestemt pakke som skal fjernes brukes kommandoer som er nevnt over.

Når man har funnet navnet på pakken kjører man kommandoen
User case: Want to remove certain packages that will not be used.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

To find a specific package to be removed, use the commands listed above.

When you have found the name of the package run the command
Line 521: Line 521:
Ønsker man å se hva om skjer ved pakkefjerning kan man simulere dette med kommandoen If you want to see what happens when you remove the package, you may simulate this with the command
Line 545: Line 545:
== Installer bestemt versjon av en pakke ==

Brukertilfelle: Ønsker en bestemt versjon av en pakke. Det kan f.eks være en tidligere utgave av et program.
== Install a specific package version ==

User case: Want a specific version of a package. It can for example be a previous release of a program.
Line 613: Line 613:
Brukertilfelle: Noen ganger er det ønsket å laste ned en pakke fra andre som ikke ligger i et Debian nettarkiv. Operas nettleser et en slik pakke.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

Last ned pakken fra hjemmesiden til de som har laget programmet. Det kan f.eks være Opera. Programmet installeres med følgende kommando:

'''dpkg -i <pakkens fulle filnavn>'''

. Ønsker man først å simulere dette prøv

'''dpkg --no-act -i <pakkens fulle filnavn>'''
User case: Sometimes it is wanted to download a package from others, not located in a Debian web archives. Opera browser a such a package.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

Download the package from the home page of the creators of the program. This could for example be Opera. The program is installed using the following command:

'''dpkg -i <full path to package>'''

. If you first want to simulate this try

'''dpkg --no-act -i <full path to package>'''
Line 644: Line 644:
dpkg krever mer håndtering enn apt-get fordi den ikke håndterer pakkeavhengigheter. Det betyr at man kanskje må kjøre '''apt-get''' umiddelbart etterpå med ekstra paramter. F.eks. hjelper det å kjøre '''apt-get --fix-broken''' for å ordne opp dpkg require more handling than apt-get because it does not handle package dependencies. Meaning you may need to run '''apt-get''' immediately afterwards with additional parameter. For example. It helps to run '''apt-get --fix-broken''' to sort it out
Line 721: Line 721:
Rustet med forskjellige kommandoer fra tidligere i kapitlet, kan man nå bekrefte at Opera allerede er installert Armed with different commands from earlier in this chapter, we can now confirm that Opera is already installed
Line 743: Line 743:
Man får en oversikt med kommandoen You get an overview with the command
Line 758: Line 758:
== Finn hvilken pakke en fil kom fra ==

Brukertilfelle: Ønsker å finne pakken en fil har kommet fra.
== Find which package a file came from ==

User case: Want to find the package a file came from.
Line 782: Line 782:
Bruker man kommandoen When using the command
Line 788: Line 788:
finner man hvilken pakke filen kom fra. Så kan man pakke ut pakken å få tilbake systemfilen slik vi viser videre.

Først må man få tak i den aktuelle deb-pakken. Man kan gjøre dette ved å plassere det i `/tmp`-katalogen. Man kan pakke ut filene i denne katalogen med kommandoen

'''dpkg --vextract <packagename> /tmp'''
finding which package a file came from. One can extract the package to get back the systems file like we show here.

First you need to fetch the deb package in question. This can be done by placing it in the `/tmp` directory. Use this command to unpack the files in this directory

'''dpkg --vextract <package name> /tmp'''
Line 800: Line 800:
Brukertilfelle: Noen pakker blir stadig installert. Andre pakker vil man unngå å laste ned fra Internett.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

Kommandoen '''apt-get''' gjør det enkelt å installere pakker fra Internett. Men '''apt-get''' vil også bruke betydelig med nettkapasitet når program lastes ned fra debian-arkiv på Internett. Derfor kan man sende '''apt-get''' avgårde til et lokalt pakkearkiv. På den måten kan man installere pakker som allerede er lastet ned med enkel bruk av '''apt-get'''. Dette gir ''rask'' installasjon.
Use case: Some packages are often installed. For others it is useful to avoid downloading them from the Internet.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

The '''apt-get''' command make it easy to install packages from the Internet. But '''apt-get''' will use significant network capasity when programs are downloaded from Debian archives on the Internet. Because of this it is possible to tell '''apt-get''' to use a local package repository. This way it is possible to install already downloaded packages simply by using '''apt-get'''. This provides ''quick'' installation.
Line 825: Line 825:
Brukertilfelle: Noen ganger er det nødvendig å logge inn på Coyote Linux uten nettleser tilgjengelig. Kanskje kommandolinjen er å foretrekke?. Da kan man bruke ssh for å koble til Coyote Linux. Use case: Some times it is required to log into Coyote Linux when no web browser is available. Perhaps the command line is prefered? Then ssh can be used to connect to Coyote Linux.
Line 852: Line 852:
Man vil ha omtrent samme valg som når man er logget inn på Coyote Linux med vev-administrasjon. Se [[#UsefulCommands--clgui|Seksjon 3.7]] for en kort beskrivelse av meyvalgene. The options will be approximately the same as those provided when logged into Coyote Linux for web administration. See [[#UsefulCommands--clgui|secton 3.7]] for a quick description of the meny choices.
Line 856: Line 856:
Ser du dette når man forsøker å logge inn på Coyote Linux If you see this when you try to log into Coyote Linux
Line 888: Line 888:
'''Nyttige kommando i Coyote Linux''' '''Useful commands in Coyote Linux'''
Line 892: Line 892:
Nyttig for å finne ut om nettverket fungerer. Kommandoen ser om det er tilkobling til Skolelinux/Debian-edu-hovedtjener Useful to figure out if the network is working. The command check if there is a connection to the Skolelinux / Debian Edu main server.
Line 902: Line 902:
Denne kommandoen gir tiden Coyote Linux har kjørt siden forrige omstart. This command give the duration since last reboot for Coyote Linux.
Line 913: Line 913:
Viser ekstra informasjon om network cardene. Show extra information about the network cards.
Line 945: Line 945:
Denne kommandoen lister opp driver-moduler. Det er nyttig når man vil se hvilke moduler som er i bruk med network carder. This command list up driver modules. This is useful to see which modules are used by network cards.
Line 963: Line 963:
Er nyttig for å finne hvor Internett-pakker tar veien. Ved eventuelle problemer er det kjent å se hvor Internett-pakkene tar veien. Is useful to figure out where the Internet packages move. If there are problems, it is useful to see the path Internet packages use.
Line 967: Line 967:
Enda en kommando som gir informasjon om tilstanden til network carder. Another command giving information about the state of the network cards.

Useful commands

Support for 4 GB memory <--include in configuration management

User Case: Because there is limited space on the Skolelinux/Debian-Edu CD only one Linux kernel is included, i.e. the lowest common denominator. That means it is added a kernel working at as many as possible different types of hardware.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

The type of kernel running, you find with the command uname -a. The command can be used later to ensure you have upgraded to the required core. Then it may look like this:

tjener:~# uname  -a
Linux tjener.intern 2.6.8-2-386 #1 Thu May 19 17:40:50 JST 2005 i686 GNU/Linux

Here runs a 386-core, which should work on just about all of PCs. But it is not optimal for two processor cores or more than 940MB.

If you want a kernel for new servers with plenty of memory and multiple processors, you can download and install it afterwards. The package system of Debian makes this easy.

Look at Section 8.9 for a more detailed description of apt-get and dpkg.

smp is the keyword to look for when you want a Linux kernel with support for more RAM than 940MB of memory and dual processors. The acronym stands for mpSymmetric Multi-Processors. The command is run from a shell which lists the number of cores ready for installation:

apt-cache search kernel-image | grep smp

. At the time this is written the following is listed:

kernel-image-2.4-686-smp - Linux kernel image for version 2.4 on PPro/Celeron/PII/PIII/P4 SMP
kernel-image-2.4-k7-smp - Linux kernel image for version 2.4 on AMD K7 SMP
kernel-image-2.4.27-2-686-smp - Linux kernel image for version 2.4.27 on PPro/Celeron/PII/PIII/P4 SMP
kernel-image-2.4.27-2-k7-smp - Linux kernel image for version 2.4.27 on AMD K7 SMP
kernel-image-2.6-686-smp - Linux kernel image for version 2.6 on PPro/Celeron/PII/PIII/P4 SMP.
kernel-image-2.6-amd64-k8-smp - Linux kernel image for version 2.6 on AMD64 SMP systems
kernel-image-2.6-em64t-p4-smp - Linux kernel image for version 2.6 on Intel EM64T SMP systems
kernel-image-2.6-k7-smp - Linux kernel image for version 2.6 on AMD K7 SMP.
kernel-image-2.6.8-11-amd64-k8-smp - Linux kernel image for version 2.6.8 on AMD64 SMP systems
kernel-image-2.6.8-11-em64t-p4-smp - Linux kernel image for version 2.6.8 on Intel EM64T SMP systems
kernel-image-2.6.8-2-686-smp - Linux kernel image for version 2.6.8 on PPro/Celeron/PII/PIII/P4 SMP.
kernel-image-2.6.8-2-k7-smp - Linux kernel image for version 2.6.8 on AMD K7 SMP.

There is no need to specify a specific kernel version like 2.4.27 or 2.6.8. Just use 2.4 or 2.6. This boils down to

kernel-image-2.4-686-smp - Linux kernel image for version 2.4 on PPro/Celeron/PII/PIII/P4 SMP
kernel-image-2.4-k7-smp - Linux kernel image for version 2.4 on AMD K7 SMP
kernel-image-2.6-686-smp - Linux kernel image for version 2.6 on PPro/Celeron/PII/PIII/P4 SMP.
kernel-image-2.6-amd64-k8-smp - Linux kernel image for version 2.6 on AMD64 SMP systems
kernel-image-2.6-em64t-p4-smp - Linux kernel image for version 2.6 on Intel EM64T SMP systems
kernel-image-2.6-k7-smp - Linux kernel image for version 2.6 on AMD K7 SMP.

Now you just need to know what kind of processor you have eg. 686 (Intel), k7 (AMD) AMD64 or EM64T

As soon as which kernel fit the machine best it can be intsalled using the command

apt-get install kernel-image-2.6-<your processor type>-smp

If the machine contain an Intel Xeon one can use

apt-get install kernel-image-2.6-686-smp

If a 2.4 kernel is used

apt-get install kernel-image-2.4-<your processor type>-smp

With an AMD Athlon(TM) MP 2000 it is possible to use

apt-get install kernel-image-2.6-k7-smp

When you install the new kernel, you may see something like this:

tjener:~# apt-get update
tjener:~# apt-get install kernel-image-2.6-686-smp
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  kernel-image-2.6.8-2-686-smp
Suggested packages:
  lilo kernel-doc-2.6.8 kernel-source-2.6.8
Recommended packages:
  irqbalance
The following NEW packages will be installed:
  kernel-image-2.6-686-smp kernel-image-2.6.8-2-686-smp
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.3MB of archives.
After unpacking 44.9MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ftp.debian.org sarge/main kernel-image-2.6.8-2-686-smp 2.6.8-16 [15.3MB]
Get:2 http://ftp.debian.org sarge/main kernel-image-2.6-686-smp 101 [2154B]
Fetched 15.3MB in 1m13s (208kB/s)
Selecting previously deselected package kernel-image-2.6.8-2-686-smp.
(Reading database ... 80762 files and directories currently installed.)
Unpacking kernel-image-2.6.8-2-686-smp (from .../kernel-image-2.6.8-2-686-smp_2.6.8-16_i386.deb) ...
Selecting previously deselected package kernel-image-2.6-686-smp.
Unpacking kernel-image-2.6-686-smp (from .../kernel-image-2.6-686-smp_101_i386.deb) ...
Setting up kernel-image-2.6.8-2-686-smp (2.6.8-16) ...
File descriptor 3 left open
File descriptor 4 left open
File descriptor 5 left open
File descriptor 6 left open
File descriptor 7 left open
    Finding all volume groups
    Finding volume group &quot;vg_data&quot;
    Finding volume group &quot;vg_system&quot;
Searching for GRUB installation directory ... found: /boot/grub .
Testing for an existing GRUB menu.list file... found: /boot/grub/menu.lst .
Searching for splash image... none found, skipping...
Found kernel: /boot/vmlinuz-2.6.8-2-686-smp
Found kernel: /boot/vmlinuz-2.6.8-2-386
Updating /boot/grub/menu.lst ... done
Setting up kernel-image-2.6-686-smp (101) ...

As it appears, you were asked to install kernel-image-2.6-686-smp, and it automatically translated to install kernel-image-2.6.8-2-686-smp. It was also proposed to install any other packages that might be useful.

Reboot the machine with the command: shutdown -r now

Exception handling

To activate a new kernel the machine need to be rebooted.

Building a core at a Skolelinux / Debian-Edu machine, is the only time you ever need a restart. When installing other programs there is no need for a restart.

Verification

When running the command uname -a after installation, the following is displayed

tjener:~# uname  -a
Linux tjener.intern 2.6.8-2-686-smp #1 SMP Thu May 19 17:27:55 JST 2005 i686 GNU/Linux

After installation of smp kernel and rebooted, you can run the command free and cat /proc/cpuinfo. Then you can see if the new kernel uses all memory and both processors.

ltspserver00:~# free
             total       used       free     shared    buffers     cached
Mem:       4074752    4045556      29196          0     339248    2327780
-/+ buffers/cache:    1378528    2696224
Swap:      1835000       5852    1829148

Here is a shortened printing with the unnecessary printing removed .

ltspserver00:~# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.66GHz

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.66GHz

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.66GHz

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.66GHz

Update configuration database

Administrating packages (apt-get)

Use case: Installing new programs or updtae programs

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

To install packages one need to tell from where they should be fetched. In other words, which package archive to use.

One can specify package archives in the file

You can work with package management at the command line. It is more graphical applications like for example KPackage 7 or Webmin 12

This section provide a quick introduction to using the command line for administrating packages.

This is the content of a file with references to package repositories on the Internet or from a CD ROM:

#deb file:///cdrom/ sarge main local

deb cdrom:[Debian GNU/Linux edu _Sarge_ - Unofficial i386 Binary-1 (20050808)]/ unstable contrib local main non-free

 1. deb http://security.debian.org/ stable/updates main contrib non-free
 1.deb http://security.debian.org/ sarge/updates main contrib non-free
   1. Use (by uncommenting) either http or ftp, NOT both
   1. http based apt source: ----------------
 1. deb http://ftp.debian.org/debian/ sarge main contrib non-free
 1. deb http://non-us.debian.org/debian-non-US/ sarge/non-US main contrib non-free
 1. deb http://ftp.skolelinux.no/skolelinux/ sarge local
   1. ftp based apt source: -----------------
 1. deb ftp://ftp.debian.org/debian/ sarge main contrib non-free
 1. deb ftp://non-us.debian.org/debian-non-US/ sarge/non-US main contrib non-free
 1. deb ftp://ftp.skolelinux.no/skolelinux/ sarge local

Note that the lines witout hashtag (#) can be used as reference to the package archive. The example show that one only gets packets from the cdrom used during installation. Other archives are not activiated. When doing this, one should open for security upgrades. So you can try other archives for more packages.

As a start it should look something like this:

#deb file:///cdrom/ sarge main local

 1.deb cdrom:[Debian GNU/Linux edu _Sarge_ - Unofficial i386 Binary-1 (20050808)]/ unstable contrib local main non-free

 1.deb http://security.debian.org/ stable/updates main contrib non-free
deb http://security.debian.org/ sarge/updates main contrib non-free
   1. Use (by uncommenting) either http or ftp, NOT both
   1. http based apt source: ----------------
deb http://ftp.debian.org/debian/ sarge main contrib non-free
deb http://non-us.debian.org/debian-non-US/ sarge/non-US main contrib non-free
deb http://ftp.skolelinux.no/skolelinux/ sarge local
   1. ftp based apt source: -----------------
 1. deb ftp://ftp.debian.org/debian/ sarge main contrib non-free
 1. deb ftp://non-us.debian.org/debian-non-US/ sarge/non-US main contrib non-free
 1. deb ftp://ftp.skolelinux.no/skolelinux/ sarge local

Note that there is a # sign in front of the line containing "deb: cdrom". There is no need to load packages from a CD-ROM when one can get everything from the Internet.

If you add a new line to this file, you must update the database with information about what that is available.

See chapter 13 for other lines to add as package sources.

Exception handling

Links to package archive have a specific design. Failure to follow this gives error messages when updating, with a request to correct the error.

Kommentartegnet ( # ) er også på plass forran flere linjer i fila. Teknikken med "å kommentere ut", er typisk for de fleste oppsettsfiler i Linux. Andre symbol som kan være i bruk er semikollon ( ; ) og doble skråstreker ( // ). Men her er det altså skigard som gjelder, og fjernes dette gjelder det som står på linja.

Update the package archive

Use case: Update the package repository with a summary of updated programs.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

The range of available packages is constantly updated. The most common is new security updates. New versions of the software can also be posted. Therefore, one must update the package archives. This is done with the following command

tjener:~# apt-get update
Get:1 http://ftp.skolelinux.no sarge/local Packages [17.4kB]
Ign http://ftp.skolelinux.no sarge/local Release
Get:2 http://non-us.debian.org sarge/non-US/main Packages [20B]
Get:3 http://non-us.debian.org sarge/non-US/main Release [102B]
Get:4 http://non-us.debian.org sarge/non-US/contrib Packages [20B]
Get:5 http://non-us.debian.org sarge/non-US/contrib Release [105B]
Get:6 http://non-us.debian.org sarge/non-US/non-free Packages [20B]
Get:7 http://non-us.debian.org sarge/non-US/non-free Release [106B]
Get:8 http://ftp.debian.org sarge/main Packages [3347kB]
Get:9 http://security.debian.org sarge/updates/main Packages [155kB]
Get:10 http://security.debian.org sarge/updates/main Release [110B]
Get:11 http://security.debian.org sarge/updates/contrib Packages [538B]
Get:12 http://security.debian.org sarge/updates/contrib Release [113B]
Get:13 http://security.debian.org sarge/updates/non-free Packages [20B]
Get:14 http://security.debian.org sarge/updates/non-free Release [114B]
Get:15 http://ftp.debian.org sarge/main Release [95B]
Get:16 http://ftp.debian.org sarge/contrib Packages [56.2kB]
Get:17 http://ftp.debian.org sarge/contrib Release [98B]
Get:18 http://ftp.debian.org sarge/non-free Packages [58.4kB]
Get:19 http://ftp.debian.org sarge/non-free Release [99B]
Fetched 3635kB in 23s (157kB/s)
Reading Package Lists... Done

This command must be executed before an upgrade or before adding new packages.

Exception handling

Verification

Update to new packages

Use case: Updating the installed packages to a newer version if one is available

Author: Klaus Ade Johnstad

Co-author: Knut Yrvin

All installed packages can be upgraded to newer versions using the command

apt-get upgrade

tjener:~# apt-get upgrade
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be upgraded:
  apache apache-common apache2-utils bsdutils cfengine cfengine-doc courier-authdaemon courier-base courier-imap courier-imap-ssl courier-ldap
  courier-ssl cpio debian-edu-config debian-edu-install education-common education-main-server education-networked education-tasks libapr0 libice6
  libmysqlclient12 libpam-ldap libpcre3 libsensors3 libsm6 libsnmp-base libsnmp5 libssl0.9.7 libungif4g libx11-6 libxext6 libxft1 libxi6 libxmu6 libxmuu1
  libxp6 libxpm4 libxrandr2 libxt6 libxtrap6 libxtst6 localization-config lynx mount mysql-common ntp ntp-refclock ntp-server ntpdate openssl python2.3
  slbackup snmp squid squid-common tcpdump util-linux xdebconfigurator xfree86-common xlibs xlibs-data
62 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 23.7MB of archives.
After unpacking 225kB disk space will be freed.
Do you want to continue? [Y/n]

Just press Enter or 'Y' and Enter. The packages will be downloaded and installed automatically. One will get a change log when the upgrade begins.

Once you have upgraded, you can delete the packages downloaded in the directory/var/cache/apt/archives/. Use the command

apt-get clean

to clear the archive. This should be done occasionally. Otherwise /var becomes filled up.

Warning

Sometimes it's okay to see what is going to happen before upgrading. If judging whether it is necessary to download several large packages, maybe you need to wait until there is more bandwidth available. If you run

apt-get upgrade --simulate

if one will simulate what will happen, without it actually happens. Is it too much information on the screen, one can run

apt-get upgrade --simulate | more

If it look good, one can run the command again without the --simulate parameter

It is also possible to use aptitude dist-upgrade in combination with apt-get upgrade.

Exception handling

Sometimes you will get a message about changes affecting packages to upgrade or install, as here

kdeaddons (4:3.1.0-4) unstable; urgency=low

  * Rebuilt against libvorbis0a (closes: #184713).
  * Removed alpha compile flags.
  * Fresh admin/ sync.

 -- Ben Burton &lt;bab@debian.org&gt;  Sun, 16 Mar 2003 16:00:19 +1100

kdeaddons (4:3.1.0-2) unstable; urgency=low

  * First KDE3 upload to debian!
  * Applied Ewald Snel's patch for xine support.
  * Rolled the epoch to aid upgrades from the unofficial repository on
    ftp.kde.org.. *sigh*

Use Space on the keyboard to browse through the message. Then you will see

quanta (1:3.0pr1-1) unstable; urgency=low

  * New upstream release.
  * Built for KDE3.

 -- Ben Burton &lt;benb@acm.org&gt;  Wed,  4 Sep 2002 10:36:12 +1000

(END)

Press the q key to quit and you get

Fetched 60.2MB in 11m24s (87.9kB/s)
Reading changelogs... Done
apt-listchanges: Do you want to continue? [Y/n]?

To continue you need to press Y for Yes.

Verification

Summary of installed packages

Use case: Want a summary of installed packages

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

To get a summary of the installed packages run this command

dpkg --list | more

Vær klar over at de to første bokstavene til pakken: "ii" betyr at en pakke er fullt installert.

To get the status of one particular package one can use grep to search for it:

tjener:~# dpkg --list | grep apache
ii  apache         1.3.33-6       versatile, high-performance HTTP server
ii  apache-common  1.3.33-6       support files for all Apache webservers
ii  apache2-utils  2.0.54-4       utility programs for webservers

Find the name of a particular package

Use case: Often it is hard to remember the name of a package.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

To find a particular package one can use a search term with this command:

apt-cache search <pakkenavn>

Try this if there is too much text on the screen

apt-cache search <package name>|more

The two symbols < and > must not be used. They are only used in this example.

tjener:~# apt-cache search apache
apache - versatile, high-performance HTTP server
apache-common - support files for all Apache webservers
apache-dbg - debug versions of the Apache webservers
apache-dev - development kit for the Apache webserver
apache-doc - documentation for the Apache webserver
apache-perl - versatile, high-performance HTTP server with Perl support
apache-ssl - versatile, high-performance HTTP server with SSL support
apache-utils - utility programs for webservers (transitional package)

As the screen dump show there are a lot more related to apache than the packages already installed.

Show available information about packages

User case: Want to get information about the package. There may be dependencies to other packages etc..

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

The command

apt-cache showpkg <package name>

and

<apt-cache policy <package name>

gives details about the package.

tjener:~# apt-cache showpkg kdissert
Package: kdissert
Versions:
0.3.8-1(/var/lib/apt/lists/ftp.debian.org_debian_dists_sarge_main_binary-i386_Packages)

Reverse Depends:
Dependencies:
0.3.8-1 - kdelibs4 (2 4:3.3.2-4.0.2) libc6 (2 2.3.2.ds1-4) libgcc1 (2 1:3.4.1-3) libqt3c102-mt (2 3:3.3.3) libstdc++5 (2 1:3.3.4-1)
Provides:
0.3.8-1 -
Reverse Provides:
tjener:~# apt-cache policy  kdissert
kdissert:
  Installed: (none)
  Candidate: 0.3.8-1
  Version Table:
     0.3.8-1 0
        500 http://ftp.debian.org sarge/main Packages

One sees package kdissert is not installed, but available for installation in version 0.3.8-1 from `http://ftp.debian.org sarge/main`

Installation of packages

Use case: Want to install a program or a program package.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

When you have found the package to be installed, run the command

apt-get install <package name>

If you want to see what happened during the installation one should run a simulation first with the command

apt-get install <package name> --simulate

tjener:~# apt-get install  aterm --simulate
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
  aterm
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst aterm (0.4.2-11 Debian:3.1r0/stable)
Conf aterm (0.4.2-11 Debian:3.1r0/stable)
tjener:~# apt-get install  aterm
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
  aterm
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 91.6kB of archives.
After unpacking 287kB of additional disk space will be used.
Get:1 http://ftp.debian.org sarge/main aterm 0.4.2-11 [91.6kB]
Fetched 91.6kB in 1s (71.0kB/s)
Selecting previously deselected package aterm.
(Reading database ... 32924 files and directories currently installed.)
Unpacking aterm (from .../aterm_0.4.2-11_i386.deb) ...
Setting up aterm (0.4.2-11) ... 

Removal of installed packages

User case: Want to remove certain packages that will not be used.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

To find a specific package to be removed, use the commands listed above.

When you have found the name of the package run the command

apt-get remove <package name>

If you want to see what happens when you remove the package, you may simulate this with the command

apt-get remove <package name> --simulate

tjener:~# apt-get remove  aterm --simulate
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be REMOVED:
  aterm
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Remv aterm (0.4.2-11 Debian:3.1r0/stable)
tjener:~# apt-get remove  aterm
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be REMOVED:
  aterm
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 287kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 32936 files and directories currently installed.)
Removing aterm ...

Install a specific package version

User case: Want a specific version of a package. It can for example be a previous release of a program.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

When installing a package with the command

apt-get install <package name>

then the newest package is installed. Some times an older version instead of the newest version is wanted.

apt-get install <package name>=older_version_number

To get an older version of the Webmin backup module one can run

apt-cache showpkg webmin-slbackup

to get a summary of the available version

tjener:~#  apt-cache policy webmin-slbackup
webmin-slbackup:
  Installed: 0.0.10-1
  Candidate: 0.0.10-1
  Version Table:
 *** 0.0.10-1 0
        500 http://ftp.skolelinux.no sarge/local Packages
        100 /var/lib/dpkg/status
     0.0.9-1 0
        500 http://ftp.debian.org sarge/main Packages

Here one can see there are two versions available. Both 0.0.9-1 and 0.0.10-1

If the 0.0.9-1 version of the program is wanted it can be installed using the following command

apt-get install webmin-slbackup=0.0.9-1

tjener:~# apt-get install webmin-slbackup=0.0.9-1 --simulate
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be DOWNGRADED:
  webmin-slbackup
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Inst webmin-slbackup [0.0.10-1] (0.0.9-1 Debian:3.1r0/stable)
Conf webmin-slbackup (0.0.9-1 Debian:3.1r0/stable)
tjener:~# apt-get install webmin-slbackup=0.0.9-1
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be DOWNGRADED:
  webmin-slbackup
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 22.0kB of archives.
After unpacking 131kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ftp.debian.org sarge/main webmin-slbackup 0.0.9-1 [22.0kB]
Fetched 22.0kB in 0s (23.6kB/s)
dpkg - warning: downgrading webmin-slbackup from 0.0.10-1 to 0.0.9-1.
(Reading database ... 32924 files and directories currently installed.)
Preparing to replace webmin-slbackup 0.0.10-1 (using .../webmin-slbackup_0.0.9-1_all.deb) ...
Unpacking replacement webmin-slbackup ...
Setting up webmin-slbackup (0.0.9-1) ...

Install a package using dpkg

User case: Sometimes it is wanted to download a package from others, not located in a Debian web archives. Opera browser a such a package.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

Download the package from the home page of the creators of the program. This could for example be Opera. The program is installed using the following command:

dpkg -i <full path to package>

. If you first want to simulate this try

dpkg --no-act -i <full path to package>

tjener:~# dpkg --install --no-act opera_8.51-20051114.5-sharedqt_en_sarge_i386.deb
Selecting previously deselected package opera.
(Reading database ... 32924 files and directories currently installed.)
Unpacking opera (from opera_8.51-20051114.5-shared-qt_en_sarge_i386.deb) ...
tjener:~# dpkg --install  opera_8.51-20051114.5-shared-qt_en_sarge_i386.deb
Selecting previously deselected package opera.
(Reading database ... 32924 files and directories currently installed.)
Unpacking opera (from opera_8.51-20051114.5-shared-qt_en_sarge_i386.deb) ...
dpkg: dependency problems prevent configuration of opera:
 opera depends on libqt3c102-mt; however:
  Package libqt3c102-mt is not installed.
dpkg: error processing opera (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 opera

dpkg require more handling than apt-get because it does not handle package dependencies. Meaning you may need to run apt-get immediately afterwards with additional parameter. For example. It helps to run apt-get --fix-broken to sort it out

tjener:~# apt-get install --fix-broken --simulate
Reading Package Lists... Done
Building Dependency Tree... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libaudio2 liblcms1 libmng1 libqt3c102-mt libxcursor1 libxft2
Suggested packages:
  nas liblcms-utils libqt3c102-mt-psql libqt3c102-mt-mysql libqt3c102-mt-odbc
The following NEW packages will be installed:
  libaudio2 liblcms1 libmng1 libqt3c102-mt libxcursor1 libxft2
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Inst libaudio2 (1.7-2 Debian:3.1r0/stable) [opera ]
Inst liblcms1 (1.13-1 Debian:3.1r0/stable) [opera ]
Inst libmng1 (1.0.8-1 Debian:3.1r0/stable) [opera ]
Inst libxcursor1 (1.1.3-1 Debian:3.1r0/stable) [opera ]
Inst libxft2 (2.1.7-1 Debian:3.1r0/stable) [opera ]
Inst libqt3c102-mt (3:3.3.4-3 Debian:3.1r0/stable)
Conf libaudio2 (1.7-2 Debian:3.1r0/stable)
Conf liblcms1 (1.13-1 Debian:3.1r0/stable)
Conf libmng1 (1.0.8-1 Debian:3.1r0/stable)
Conf libxcursor1 (1.1.3-1 Debian:3.1r0/stable)
Conf libxft2 (2.1.7-1 Debian:3.1r0/stable)
Conf libqt3c102-mt (3:3.3.4-3 Debian:3.1r0/stable)
Conf opera (8.51-20051114.5 )
tjener:~# apt-get install --fix-broken
Reading Package Lists... Done
Building Dependency Tree... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libaudio2 liblcms1 libmng1 libqt3c102-mt libxcursor1 libxft2
Suggested packages:
  nas liblcms-utils libqt3c102-mt-psql libqt3c102-mt-mysql libqt3c102-mt-odbc
The following NEW packages will be installed:
  libaudio2 liblcms1 libmng1 libqt3c102-mt libxcursor1 libxft2
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 3489kB of archives.
After unpacking 8753kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ftp.debian.org sarge/main libaudio2 1.7-2 [71.5kB]
Get:2 http://ftp.debian.org sarge/main liblcms1 1.13-1 [123kB]
Get:3 http://ftp.debian.org sarge/main libmng1 1.0.8-1 [171kB]
Get:4 http://ftp.debian.org sarge/main libxcursor1 1.1.3-1 [23.7kB]
Get:5 http://ftp.debian.org sarge/main libxft2 2.1.7-1 [54.4kB]
Get:6 http://ftp.debian.org sarge/main libqt3c102-mt 3:3.3.4-3 [3045kB]
Fetched 3489kB in 16s (212kB/s)
Selecting previously deselected package libaudio2.
(Reading database ... 33027 files and directories currently installed.)
Unpacking libaudio2 (from .../libaudio2_1.7-2_i386.deb) ...
Selecting previously deselected package liblcms1.
Unpacking liblcms1 (from .../liblcms1_1.13-1_i386.deb) ...
Selecting previously deselected package libmng1.
Unpacking libmng1 (from .../libmng1_1.0.8-1_i386.deb) ...
Selecting previously deselected package libxcursor1.
Unpacking libxcursor1 (from .../libxcursor1_1.1.3-1_i386.deb) ...
Selecting previously deselected package libxft2.
Unpacking libxft2 (from .../libxft2_2.1.7-1_i386.deb) ...
Selecting previously deselected package libqt3c102-mt.
Unpacking libqt3c102-mt (from .../libqt3c102-mt_3%3a3.3.4-3_i386.deb) ...
Setting up libaudio2 (1.7-2) ...

Setting up liblcms1 (1.13-1) ...

Setting up libmng1 (1.0.8-1) ...

Setting up libxcursor1 (1.1.3-1) ...

Setting up libxft2 (2.1.7-1) ...

Setting up libqt3c102-mt (3.3.4-3) ...

Setting up opera (8.51-20051114.5) ...

Armed with different commands from earlier in this chapter, we can now confirm that Opera is already installed

tjener:~# apt-cache policy opera
opera:
  Installed: 8.51-20051114.5
  Candidate: 8.51-20051114.5
  Version Table:
 *** 8.51-20051114.5 0
        100 /var/lib/dpkg/status
tjener:~# dpkg --list|grep opera

ii opera 8.51-20051114. The Opera Web Browser

Search through files in a package

Use case: Want to find a program name or file in a package

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

You get an overview with the command

dpkg --listfiles <package name>

tjener:~# dpkg --listfiles opera
/usr/bin
/usr/bin/opera
.
.
.
/etc
/etc/opera6rc
/etc/opera6rc.fixed

Find which package a file came from

User case: Want to find the package a file came from.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

dpkg --search <filename>

This can look like this

tjener:~# dpkg --search /etc/opera6rc.fixed
opera: /etc/opera6rc.fixed

Unpackaging files from a package without installing the package

Use case: Perhaps an important system file was deleted by accident, and there is no backup.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

When using the command

dpkg --search <filename>

Warning: Never unpack packages in the root directory

finding which package a file came from. One can extract the package to get back the systems file like we show here.

First you need to fetch the deb package in question. This can be done by placing it in the /tmp directory. Use this command to unpack the files in this directory

dpkg --vextract <package name> /tmp

. Then the required directories will be created in /tmp and the files are placed there.

dpkg --vextract <package name> /tmp

Make your own package mirror

Use case: Some packages are often installed. For others it is useful to avoid downloading them from the Internet.

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

The apt-get command make it easy to install packages from the Internet. But apt-get will use significant network capasity when programs are downloaded from Debian archives on the Internet. Because of this it is possible to tell apt-get to use a local package repository. This way it is possible to install already downloaded packages simply by using apt-get. This provides quick installation.

mkdir /var/www/dpkg

cp /var/cache/apt/archives/*.deb /var/www/dpkg

cd /var/www/

dpkg-scanpackages dpkg /dev/null | gzip -9c > dpkg/Packages.gz

After this a new line is added to the file /etc/apt/sources.list:

deb file:///var/www dpkg/

And then the command apt-get update must be executed as usual to update the packages in the database.

Secure login on firewall (ssh)

Use case: Some times it is required to log into Coyote Linux when no web browser is available. Perhaps the command line is prefered? Then ssh can be used to connect to Coyote Linux.

If you are logged into a machine in a Skolelinux / Debian Edu network you can use

ssh -l root 10.0.2.1

to log in on Coyote Linux

If you are outside a Skolelinux / Debian Edu network, the value 10.0.2.1 can be replaced with the appropriate value for the network card with the WAN in. In this case it might be ssh -l root 192.168.1.10

Here you will meet the same options as are present when logged into the Coyote Linux web administration. This is presented in a text based menu.

               Coyote Linux Gateway -- Configuration Menu


  1) Edit main configuration file         2) Change system password
  3) Edit rc.local script file            4) Custom firewall rules file
  5) Edit firewall configuration          6) Edit port forward configuration

  c) Show running configuration           f) Reload firewall
  r) Reboot system                        w) Write configuration to disk

  q) quit                                 e) Exit
  ----------------------------------------------------------------------------
  Selection:

The options will be approximately the same as those provided when logged into Coyote Linux for web administration. See secton 3.7 for a quick description of the meny choices.

Når man velger q) quit vil man ende opp med en kommandolinje i Coyote Linux. Må man tilbake til hovedmenyen i Coyote Linux, skriver man menu og trykker Enter.

If you see this when you try to log into Coyote Linux

klaus@tjener:~$ ssh 10.0.2.1 -l root
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
34:b7:a3:9b:06:4c:e2:30:1b:0d:03:45:7b:22:b7:dd.
Please contact your system administrator.
Add correct host key in /skole/tjener/home0/klaus/.ssh/known_hosts to get rid of this message.
Offending key in /skole/tjener/home0/klaus/.ssh/known_hosts:27
RSA host key for 10.0.2.1 has changed and you have requested strict checking.
Host key verification failed.

Er det mest sannsynlig at man tidligere har logget inn fra en annen maskin, med IP-adressen 10.0.2.1, eller man har endret network card i Coyote Linux. Det kan også være attakk fra en ukjent mellomman. Løsningen er å fjerne nøkkelen, i dette tilfellet linje nummer 27 i fila /skole/tjener/home0/klaus/.ssh/known_hosts.

Exception handling

Verification

Update configuration database

Statusoversikt for brannmur (Coyote)

Brukertilfelle: Hvilke kommandoer kan brukes for å få meny eller få en oversikt over tilstanden til brannmuren?

Main author: Klaus Ade Johnstad

Useful commands in Coyote Linux

  • ping

Useful to figure out if the network is working. The command check if there is a connection to the Skolelinux / Debian Edu main server.

coyote# ping -c5 10.0.2.2
PING 10.0.2.2 (10.0.2.2): 56 data bytes
64 bytes from 10.0.2.2: icmp_seq=0 ttl=64 time=0.9 ms
64 bytes from 10.0.2.2: icmp_seq=1 ttl=64 time=0.5 ms
  • uptime

This command give the duration since last reboot for Coyote Linux.

   coyote# uptime\n  2:37pm  up 80 days,  7:55, load average: 0.00, 0.00, 0.00
  • dmesg

Denne kommandoen skriver ut informasjon om Linux-kernen som er kjører på maskinen. Man får ut ting som minne, prosessor, network carder. Er det for mye utdata fra dmesg kan man kjøre dette gjennom et såkalt bla-program som f.eks. «more», og bruk Mellomrom for å lese alt, dmesg|more

  • ifconfig

Show extra information about the network cards.

coyote# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:FC:F8:D2:44
          inet addr:10.0.2.1  Bcast:10.0.3.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:314723 errors:0 dropped:0 overruns:0 frame:0
          TX packets:312105 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:53700845 (51.2 MiB)  TX bytes:277496136 (264.6 MiB)
          Interrupt:11 Base address:0x7000

eth1      Link encap:Ethernet  HWaddr 00:E0:18:A8:B1:BA
          inet addr:192.168.100.133  Bcast:192.168.100.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:307395 errors:0 dropped:0 overruns:0 frame:0
          TX packets:281202 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:272404311 (259.7 MiB)  TX bytes:47880640 (45.6 MiB)
          Interrupt:10 Base address:0xb800 Memory:e3000000-e3000038

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:14565 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14565 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1290756 (1.2 MiB)  TX bytes:1290756 (1.2 MiB)
  • lsmod

This command list up driver modules. This is useful to see which modules are used by network cards.

coyote# lsmod
Module                  Size  Used by
eepro100               17516   1
3c59x                  24408   1
mii                     1852   0 [eepro100]
ip_nat_quake3           1608   0 (unused)
ip_nat_mms              2448   0 (unused)
ip_nat_h323             2044   0 (unused)
ip_nat_amanda           1020   0 (unused)

Dette er en listing som viser at driver-modulenene for network card er lastet. For Intel pro100 er det modulen eepro100 og 3Com har modulen 3c59x (som gjelder for kort med typebetegnelse 3c590, 3c595, 3c900, 3c905). Se Seksjon 3.12

  • route
  • traceroute

Is useful to figure out where the Internet packages move. If there are problems, it is useful to see the path Internet packages use.

  • showcfg

Another command giving information about the state of the network cards.

Coyote running configuration display utility.

Internet    (eth1): UP
LAN network (eth0): UP

-------------Internet configuration--------------
IP Address   192.168.100.133 (Static)
Netmask      255.255.255.0
Gateway      192.168.100.2
----------------LAN configuration----------------
IP Address   10.0.2.1
Netmask      255.255.254.0
Broadcast    10.0.3.255
----------------DNS configuration----------------
domain localdomain
nameserver 213.184.200.1
nameserver 213.184.200.2
-------------------------------------------------
10:51am up 7 days, 20:53, load average: 0.00, 0.00, 0.00

Press enter to return to system menu.
  • free

The command is used to see how much memory is availalbe and how much is used. This machine has 32 MB memory.

coyote# free
              total         used         free       shared      buffers
  Mem:        30860         6004        24856            0            0
 Swap:            0            0            0
Total:        30860         6004        24856
  • menu

This commands starts the Coyote Linux Menu

               Coyote Linux Gateway -- Configuration Menu


  1) Edit main configuration file         2) Change system password
  3) Edit rc.local script file            4) Custom firewall rules file
  5) Edit firewall configuration          6) Edit port forward configuration

  c) Show running configuration           f) Reload firewall
  r) Reboot system                        w) Write configuration to disk

menu

This command starts the Coyote Linux menu

   Coyote Linux Gateway -- Configuration Menu\n\n\n  1) Edit main configuration file         2) Change system password\n  3) Edit rc.local script file            4) Custom firewall rules file\n  5) Edit firewall configuration          6) Edit port forward configuration\n\n  c) Show running configuration           f) Reload firewall\n  r) Reboot system                        w) Write configuration to disk
  • reboot

coyote#reboot

This command do a reboot of Coyote Linux

  • shutdown

coyote#halt

Here Coyote Linux is turned off

Next

Use case:

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

Exception handling

Verification

Update configuration database

Last

Use case:

Author: Klaus Ade Johnstad.

Co-author: Knut Yrvin

Exception handling

Verification

Update configuration database