E szakasz leírja, hogyan telepítsd a Debian GNU/Linux rendszeredet létező Unix vagy Linux rendszer alól a menü-vezérelt telepítő nélkül, amit már leírtunk e kézikönyvben. E „kereszt-telepítő” HOGYAN leírást seregnyi felhasználónk kérte, akik Debian GNU/Linux rendszerre váltanak mégpedig üzemszünet nélkül például Red Hat, Mandriva és SUSE disztribúciókról. A szakasz azért feltételezi legalább a legalapvetőbb *nix parancsok és fájlrendszer ismeretét. E szakaszban a $
a felhasználó mostani rendszerében, a #
a Debian chroot környezetben kiadott parancsot jelöli.
A Debian telepítés végeztével átviheted rá létező felhasználói adataidat (ha vannak), és folyamatosan életben tarthatod. Ezért ez egy „zéró leállású” Debian GNU/Linux telepítés. A különböző indító vagy telepítő médiával nem baráti hardverekkel is el lehet így bánni.
![]() |
Megjegyzés |
---|---|
Mivel ez nagyrészt manuális eljárás, tartsd észben, hogy sok alapbeállítást magadnak kell majd csinálnod a rendszeren, ez több Debian és Linux ismeretet igényel, mint egy általános telepítés. Ne várd el, hogy egy ilyen eljárás az általános telepítéssel megegyező rendszert eredményezzen. Jó azt is tudni, hogy ez a telepítés csak alaplépéseket ad a rendszer beállításához. További telepítés és/vagy beállítási lépések lehetnek szükségesek. |
With your current *nix partitioning tools, repartition the hard drive as needed, creating at least one filesystem plus swap. You need around 769MB of space available for a console only install, or about 2271MB if you plan to install X (more if you intend to install desktop environments like GNOME or KDE Plasma).
Ezután hozd létre a fájlrendszereket a partíciókon. Például egy ext3 fájlrendszer létrehozásához a /dev/sda6
partíción (ez a példa gyökér partíciónk):
# mke2fs -j /dev/sda6
Egy ext2 fájlrendszerhez hagyd el a -j
opciót.
Inicializáld és aktiváld a cserehelyet (cseréld a partíció számot tervezett Debian csere partíciódra):
# mkswap /dev/sda5
# sync # swapon /dev/sda5
Csatolj egy partíciót mint /mnt/debinst
(a csatolási pont, a leendő (/
) fájlrendszer az új rendszeren). A csatolási pont név teljesen önkényes. alább hivatkozunk rá.
# mkdir /mnt/debinst
# mount /dev/sda6
/mnt/debinst
![]() |
Megjegyzés |
---|---|
Ha a fájlrendszer részeit (például /usr) külön partícióra akarod, létre kell hoznod és csatolnod a könyvtárakat a következők előtt. |
A Debian telepítő által használt eszköz, mely a Debian alaprendszer telepítésének hivatalos módja a debootstrap. A wget és ar programokat használja, de amúgy csak a /bin/sh
és alapi Unix/Linux eszközöket használja[24]. Telepítsd a wget és ar programokat, majd töltsd le és telepítsd a debootstrap programot.
Vagy használd az alábbi eljárást kézi telepítésére. Készíts egy munka-könyvtárat a .deb kibontására:
# mkdir munka # cd munka
A debootstrap bináris a Debian archívumban van (a gépednek megfelelő fájlt válaszd). Töltsd le a debootstrap .deb fájlt innen: pool a munka könyvtárba és bontsd ki fájljait. Rendszergazda jog kell a fájlok telepítéséhez.
# ar -x debootstrap_0.X.X_all.deb # cd / # zcat /a-munka-útvonala/munka/data.tar.gz | tar xv
A debootstrap le tudja tölteni a szükséges fájlokat az archívumból. A lenti példában lévő http.us.debian.org/debian
bármilyen Debian archívum tükörre cserélhető, lehetőleg válassz közelit. A tükrök listája itt: http://www.debian.org/mirror/list.
If you have a bookworm Debian GNU/Linux installation image mounted at /cdrom
, you could substitute a file URL instead of the http URL: file:/cdrom/debian/
Substitute one of the following for ARCH
in the debootstrap command: amd64
,
arm64
,
armel
,
armhf
,
i386
,
mips64el
,
mipsel
,
ppc64el
,
s390x
.
# /usr/sbin/debootstrap --arch ARCH bookworm \ /mnt/debinst http://ftp.us.debian.org/debian
If the target architecture is different than the host, you should add the --foreign
option.
Now you've got a real Debian system, though rather lean, on disk. chroot into it:
# LANG=C.UTF-8 chroot /mnt/debinst /bin/bash
If the target architecture is different from the host, you will need to first copy qemu-user-static to the new host:
# cp /usr/bin/qemu-ARCH-static /mnt/debinst/usr/bin # LANG=C.UTF-8 chroot /mnt/debinst qemu-ARCH-static /bin/bash
After chrooting you may need to set the terminal definition to be compatible with the Debian base system, for example:
# export TERM=xterm-color
Depending on the value of TERM, you may have to install the ncurses-term
package to get support for it.
If the target architecture is different from the host, you need to finish the multi-stage boot strap:
/debootstrap/debootstrap --second-stage
Ezen a ponton a /dev/
csak nagyon alap eszközfájlokat tartalmaz. A telepítés következő lépéseihez további eszközfájlok kellhetnek. Ezt többféle módon is megoldhatod, hogy melyik módszert választod, az függ a telepítéshez használt rendszertől, hogy akarsz-e moduláris kernelt használni, és hogy dinamikus (például az udev
-vel) vagy statikus eszközfájlokat szeretnél használni az új rendszerrel.
Néhány az elérhető lehetőségek közül:
telepítsd a makedev csomagot és hozd létre a statikus eszközfájlok egy alaphalmazát(chroot után), így
# apt install makedev # mount none /proc -t proc # cd /dev # MAKEDEV generic
kézzel hozz létre csak bizonyos eszközfájlokat a MAKEDEV paranccsal
bindeld (bind mount) a /dev-et a gazda rendszerből a célrendszer /dev-jeként; jó tudni, hogy néhány csomag postinst szkriptjei megpróbálhatnak létrehozni eszköz fájlokat, ezért ez a lehetőség csak óvatosan használandó
You need to create /etc/fstab
.
# editor /etc/fstab
Here is a sample you can modify to suit:
# /etc/fstab: static file system information. # # file system mount point type options dump pass /dev/XXX / ext3 defaults 0 1 /dev/XXX /boot ext3 ro,nosuid,nodev 0 2 /dev/XXX none swap sw 0 0 proc /proc proc defaults 0 0 /dev/cdrom /media/cdrom iso9660 noauto,ro,user,exec 0 0 /dev/XXX /tmp ext3 rw,nosuid,nodev 0 2 /dev/XXX /var ext3 rw,nosuid,nodev 0 2 /dev/XXX /usr ext3 rw,nodev 0 2 /dev/XXX /home ext3 rw,nosuid,nodev 0 2
Use mount -a
to mount all the file systems you have specified in your /etc/fstab
, or, to mount file systems individually, use:
# mount /path # e.g.: mount /usr
Current Debian systems have mountpoints for removable media under /media
, but keep compatibility symlinks in /
. Create these as as needed, for example:
# cd /media # mkdir cdrom0 # ln -s cdrom0 cdrom # cd / # ln -s media/cdrom
You can mount the proc file system multiple times and to arbitrary locations, though /proc
is customary. If you didn't use mount -a
, be sure to mount proc before continuing:
# mount -t proc proc /proc
Az ls /proc
tele kell, hogy legyen. Ha üres, kívülről kell csatolnod:
# mount -t proc proc /mnt/debinst/proc
A /etc/adjtime
fájl harmadik sorába „UTC”-t vagy „LOCAL”-t írva szabható meg, hogy a rendszer a hardver órát az UTC vagy a helyi időre állítva értelmezi-e. Az alábbi paranccsal állítható ez be.
# editor /etc/adjtime
Itt egy minta:
0.0 0 0.0 0 UTC
Az alábbi paranccsal állítható be az időzóna.
# dpkg-reconfigure tzdata
To configure networking, edit /etc/network/interfaces
, /etc/resolv.conf
, /etc/hostname
and /etc/hosts
.
# editor /etc/network/interfaces
Here are some simple examples from /usr/share/doc/ifupdown/examples
:
###################################################################### # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) # See the interfaces(5) manpage for information on what options are # available. ###################################################################### # The loopback interface isn't really required any longer, but can be used # if needed. # # auto lo # iface lo inet loopback # To use dhcp: # # auto eth0 # iface eth0 inet dhcp # An example static IP setup: (network, broadcast and gateway are optional) # # auto eth0 # iface eth0 inet static # address 192.168.0.42 # network 192.168.0.0 # netmask 255.255.255.0 # broadcast 192.168.0.255 # gateway 192.168.0.1
Enter your nameserver(s) and search directives in /etc/resolv.conf
:
# editor /etc/resolv.conf
A simple example /etc/resolv.conf
:
search example.com nameserver 10.1.1.36 nameserver 192.168.9.100
Enter your system's host name (2 to 63 characters):
# echo DebianHostName > /etc/hostname
And a basic /etc/hosts
with IPv6 support:
127.0.0.1 localhost 127.0.1.1 DebianHostName # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
If you have multiple network cards, you should arrange the names of driver modules in the /etc/modules
file into the desired order. Then during boot, each card will be associated with the interface name (eth0, eth1, etc.) that you expect.
Debootstrap will have created a very basic /etc/apt/sources.list
that will allow installing additional packages. However, you may want to add some additional sources, for example for source packages and security updates:
deb-src http://ftp.us.debian.org/debian bookworm main deb http://security.debian.org/ bookworm-security main deb-src http://security.debian.org/ bookworm-security main
Make sure to run apt update
after you have made changes to the sources list.
To configure your locale settings to use a language other than English, install the locales
support package and configure it. Currently the use of UTF-8 locales is recommended.
# apt install locales # dpkg-reconfigure locales
To configure your keyboard (if needed):
# apt install console-setup # dpkg-reconfigure keyboard-configuration
A billentyűzet nem kerül beállításra a chroot környezetben, de az újraindítás után igen.
A rendszer indításához kell egy Linux kernel és egy boot betöltő. Az elérhető elő-csomagolt kernelek ezzel találhatod meg:
# apt search linux-image
Ezután telepítsd a választott kernel csomagot a csomagneve használatával.
# apt install linux-image-arch-etc
To make your Debian GNU/Linux system bootable, set up your boot loader to load the installed kernel with your new root partition. Note that debootstrap does not install a boot loader, but you can use apt inside your Debian chroot to do so.
Check info grub
for instructions on setting up the bootloader. If you are keeping the system you used to install Debian, just add an entry for the Debian install to your existing grub2 grub.cfg
.
Installing and setting up grub2
is as easy as:
# apt install grub-pc
# grub-install /dev/sda
# update-grub
The second command will install grub2 (in this case in the MBR of sda
). The last command will create a sane and working /boot/grub/grub.cfg
.
Jó tudni, hogy ez feltételezi, hogy egy /dev/sda
eszközfájl létre lett hozva. Vannak más módok is a grub2 telepítésre, de azok nem tartoznak e függelék hatókörén.
In case you can login to the system via console, you can skip this section. If the system should be accessible via the network later on, you need to install SSH and set up access.
# apt install ssh
Root login with password is disabled by default, so setting up access can be done by setting a password and re-enable root login with password:
# passwd # editor /etc/ssh/sshd_config
This is the option to be enabled:
PermitRootLogin yes
Access can also be set up by adding an ssh key to the root account:
# mkdir /root/.ssh # cat << EOF > /root/.ssh/authorized_keys ssh-rsa .... EOF
Lastly, access can be set up by adding a non-root user and setting a password:
# adduser joe # passwd joe
As mentioned earlier, the installed system will be very basic. If you would like to make the system a bit more mature, there is an easy method to install all packages with „standard” priority:
# tasksel install standard
Of course, you can also just use apt to install packages individually.
A telepítés után a letöltött csomagok a /var/cache/apt/archives/
könyvtárban vannak. Ezek teljes törlésével felszabadítható egy kis hely például így:
# apt clean