Install debian from running linux

Install debian from running linux

Here is a sample you can modify to suit:

Use mount -a to mount all the file systems you have specified in your /etc/fstab , or, to mount file systems individually, use:

Current Debian systems have mountpoints for removable media under /media , but keep compatibility symlinks in / . Create these as as needed, for example:

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:

The command ls /proc should now show a non-empty directory. Should this fail, you may be able to mount proc from outside the chroot:

D.3.4.2.В Setting Timezone

An option in the file /etc/default/rcS determines whether the system will interpret the hardware clock as being set to UTC or local time. The following command allow you to set that and choose your timezone.

D.3.4.3.В Configure Networking

To configure networking, edit /etc/network/interfaces , /etc/resolv.conf , /etc/hostname and /etc/hosts .

Here are some simple examples from /usr/share/doc/ifupdown/examples :

Enter your nameserver(s) and search directives in /etc/resolv.conf :

A simple example /etc/resolv.conf :

Enter your system’s host name (2 to 63 characters):

And a basic /etc/hosts with IPv6 support:

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.

D.3.4.4.В Configure Apt

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:

Make sure to run aptitude update after you have made changes to the sources list.

D.3.4.5.В Configure Locales and Keyboard

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.

To configure your keyboard (if needed):

Note that the keyboard cannot be set while in the chroot, but will be configured for the next reboot.

D.3.5.В Install a Kernel

If you intend to boot this system, you probably want a Linux kernel and a boot loader. Identify available pre-packaged kernels with:

If you intend to use a pre-packaged kernel, you may want to create the configuration file /etc/kernel-img.conf before you do so. Here’s an example file:

For detailed information about this file and the various options, consult its man page which will be available after installing the kernel-package package. We recommend that you check that the values are appropriate for your system.

Then install the kernel package of your choice using its package name.

If you did not create a /etc/kernel-img.conf before installing a pre-packaged kernel, you may be asked some questions during its installation that refer to it.

D.3.6.В Set up the Boot Loader

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, though you can use aptitude inside your Debian chroot to do so.

Check info grub or man lilo.conf 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 grub menu.lst or lilo.conf . For lilo.conf , you could also copy it to the new system and edit it there. After you are done editing, call lilo (remember it will use lilo.conf relative to the system you call it from).

Читайте также:  Whatsapp business для компьютера windows 10

Installing and setting up grub is as easy as:

The second command will install grub (in this case in the MBR of hda ). The last command will create a sane and working /boot/grub/menu.lst .

Here is a basic /etc/lilo.conf as an example:

Depending on which bootloader you selected, you can now make some additional changes in /etc/kernel-img.conf .

For the grub bootloader, you should set the do_bootloader option to “ no ”. And to automatically update your /boot/grub/menu.lst on installation or removal of Debian kernels, add the following lines:

For the lilo bootloader, the value of do_bootloader needs to remain “ yes ”.

D.3.7.В Finishing touches

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:

Of course, you can also just use aptitude to install packages individually.

After the installation there will be a lot of downloaded packages in /var/cache/apt/archives/ . You can free up some diskspace by running:

[23] These include the GNU core utilities and commands like sed , grep , tar and gzip .

Источник

Install debian from running linux

This section explains how to install Debian GNU/Linux from an existing Unix or Linux system, without using the menu-driven installer as explained in the rest of the manual. This “ cross-install ” HOWTO has been requested by users switching to Debian GNU/Linux from Red Hat, Mandriva, and SUSE. In this section some familiarity with entering *nix commands and navigating the file system is assumed. In this section, $ symbolizes a command to be entered in the user’s current system, while # refers to a command entered in the Debian chroot.

Once you’ve got the new Debian system configured to your preference, you can migrate your existing user data (if any) to it, and keep on rolling. This is therefore a “ zero downtime ” Debian GNU/Linux install. It’s also a clever way for dealing with hardware that otherwise doesn’t play friendly with various boot or installation media.

As this is a mostly manual procedure, you should bear in mind that you will need to do a lot of basic configuration of the system yourself, which will also require more knowledge of Debian and of Linux in general than performing a regular installation. You cannot expect this procedure to result in a system that is identical to a system from a regular installation. You should also keep in mind that this procedure only gives the basic steps to set up a system. Additional installation and/or configuration steps may be needed.

D.3.1.В Getting Started

With your current *nix partitioning tools, repartition the hard drive as needed, creating at least one filesystem plus swap. You need around 613MB of space available for a console only install, or about 2133MB if you plan to install X (more if you intend to install desktop environments like GNOME or KDE Plasma).

Next, create file systems on the partitions. For example, to create an ext3 file system on partition /dev/sda6 (that’s our example root partition):

To create an ext2 file system instead, omit -j .

Initialize and activate swap (substitute the partition number for your intended Debian swap partition):

Mount one partition as /mnt/debinst (the installation point, to be the root ( / ) filesystem on your new system). The mount point name is strictly arbitrary, it is referenced later below.

If you want to have parts of the filesystem (e.g. /usr) mounted on separate partitions, you will need to create and mount these directories manually before proceding with the next stage.

D.3.2.В Install debootstrap

The utility used by the Debian installer, and recognized as the official way to install a Debian base system, is debootstrap . It uses wget and ar , but otherwise depends only on /bin/sh and basic Unix/Linux tools [27] . Install wget and ar if they aren’t already on your current system, then download and install debootstrap .

Читайте также:  Включение smb1 windows 10 powershell

Or, you can use the following procedure to install it manually. Make a work folder for extracting the .deb into:

The debootstrap binary is located in the Debian archive (be sure to select the proper file for your architecture). Download the debootstrap .deb from the pool, copy the package to the work folder, and extract the files from it. You will need to have root privileges to install the files.

D.3.3.В Run debootstrap

debootstrap can download the needed files directly from the archive when you run it. You can substitute any Debian archive mirror for http.us.debian.org/debian in the command example below, preferably a mirror close to you network-wise. Mirrors are listed at http://www.debian.org/mirror/list.

If you have a stretch Debian GNU/Linux CD 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 , mips , mips64el , mipsel , powerpc , ppc64el , or s390x .

If the target architecture is different than the host, you should add the —foreign option.

D.3.4.В Configure The Base System

Now you’ve got a real Debian system, though rather lean, on disk. chroot into it:

If the target architecture is different from the host, you will need to first copy qemu-user-static to the new host:

After chrooting you may need to set the terminal definition to be compatible with the Debian base system, for example:

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:

D.3.4.1.В Create device files

At this point /dev/ only contains very basic device files. For the next steps of the installation additional device files may be needed. There are different ways to go about this and which method you should use depends on the host system you are using for the installation, on whether you intend to use a modular kernel or not, and on whether you intend to use dynamic (e.g. using udev ) or static device files for the new system.

A few of the available options are:

install the makedev package, and create a default set of static device files using (after chrooting)

manually create only specific device files using MAKEDEV

bind mount /dev from your host system on top of /dev in the target system; note that the postinst scripts of some packages may try to create device files, so this option should only be used with care

Источник

Install debian from running linux

В этом разделе объясняется, как установить Debian GNU/Linux из существующей системы Unix или Linux без использования управляемой из меню программы установки, основанной на библиотеке ncurses, как это описывается в остальном руководстве. Это « междистрибутивное » HOWTO попросили пользователи, переходящие на Debian GNU/Linux из Redhat, Mandriva и SUSE. В этом разделе подразумевается наличие некоторого опыта работы с командами *nix и навигации по файловой системе. Здесь символ $ означает команду, вводимую в текущей пользовательской системе, а # относится к команде, вводимой в Debian chroot.

Как только вы получите новую систему Debian, настроенную по вашим предпочтениям, вы можете перенести свои данные (если они есть) в неё и продолжать работу. Поэтому такая установка Debian GNU/Linux считается « с нулевым временем простоя » (zero downtime). Также это мудрый способ работы с аппаратурой, которая не может нормально работать с разными загрузочными или установочными носителями.

Так как это, по большей части, ручная процедура, вы должны помнить, что вам придётся сделать множество начальных настроек системы самостоятельно, которые также требуют больше знаний о Debian и Linux в общем, чем при выполнение обычной установки. Вы не должны ожидать, что эта процедура настроит вам систему так, как это делается при обычной установке. Также вы должны помнить,что эта процедура выполняет только основные этапы настройки системы. Может потребоваться дополнительная установка и/или настройка.

D.3.1. Начинаем

With your current *nix partitioning tools, repartition the hard drive as needed, creating at least one filesystem plus swap. You need around 613MB of space available for a console only install, or about 2133MB if you plan to install X (more if you intend to install desktop environments like GNOME or KDE Plasma).

Затем создайте файловые системы на разделах. Например, чтобы создать файловую систему ext3 на разделе /dev/sda6 (это корневой раздел в нашем примере):

Чтобы создать файловую систему ext2, не указывайте параметр -j .

Проинициализируйте и активируйте раздел подкачки (замените номер раздела на свой):

Смонтируйте один раздел как /mnt/debinst (точка установки, она будет корневой ( / ) файловой системой в вашей новой системе). Имя точки монтирования абсолютно произвольное.

Примечание

Если вы хотите монтировать некоторые файловые системы (например, /usr) с отдельных разделов, то нужно создать и смонтировать эти каталоги вручную, перед тем как перейти к следующему этапу.

D.3.2. Установка debootstrap

Утилита, которой пользуется программа установки Debian и которая признана официальным способом установки базовой системы Debian является debootstrap . Она использует wget и ar , но зависит только от /bin/sh и часто используемых инструментов Unix/Linux [23] . Установите wget и ar , если их ещё нет в системе, а затем загрузите и установите debootstrap .

Или вы можете использовать следующую процедуру установки вручную. Создайте рабочий каталог для распаковки в него .deb:

Двоичный файл debootstrap расположен в архиве Debian (убедитесь, что вы выбрали правильный файл, соответствующий вашей архитектуре). Скачайте debootstrap .deb из пула, скопируйте пакет в рабочий каталог и извлеките из него файлы. Для установки файлов вам потребуются привилегии суперпользователя (root).

D.3.3. Запуск debootstrap

Команда debootstrap может скачивать необходимые файлы прямо из архива. В примере ниже вы можете заменить http.us.debian.org/debian на любой сервер-зеркало архива Debian, лучше всего использовать из наиболее близкой к вам сети. Список серверов http://www.debian.org/mirror/list.

Если у вас есть компакт-диск с stretch Debian GNU/Linux, смонтированный в /cdrom , вы можете подставить URL типа file вместо http URL: file:/cdrom/debian/

Substitute one of the following for ARCH in the debootstrap command: amd64 , arm64 , armel , armhf , i386 , mips , mips64el , mipsel , powerpc , ppc64el , or s390x .

If the target architecture is different than the host, you should add the —foreign option.

D.3.4. Настройка базовой системы

Now you’ve got a real Debian system, though rather lean, on disk. chroot into it:

If the target architecture is different from the host, you will need to first copy qemu-user-static to the new host:

After chrooting you may need to set the terminal definition to be compatible with the Debian base system, for example:

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:

D.3.4.1. Создание файлов устройств

В данный момент /dev/ содержит только основные файлы устройств. Для следующих этапов установки могут потребоваться дополнительные файлы устройств. Есть несколько способов их создания; выбор более подходящего зависит от: a) системы, с которой производится установка; б) будет ли использоваться модульность ядро; в) используются в новой системе динамические (например, посредством udev ) или статические файлы устройств.

Некоторые доступные способы:

установка пакета makedev и создание используемого по умолчанию набора статических файлов устройств (после выполнения chroot)

создание вручную только выбранных файлов устройств с помощью MAKEDEV

привязка смонтированного /dev имеющейся системы поверх /dev в устанавливаемой системе; заметим, что сценарии postinst некоторых пакетов могут пытаться создавать файлы устройств, поэтому данный параметр нужно использовать осторожно

Источник

Читайте также:  Презентация microsoft powerpoint для windows 10
Оцените статью
Примечание