Thursday, June 1, 2023

Manual install debian or arch linux from scratch

Boot  Arch linux image from USB. Use rufus to burn it windows, balenaetcher or dd in linux.
dd if=~/Download/arch.iso of=/dev/sdb bs=1M status=progress oflag=direct

* Install base packages distro

Wifi - internet
iwctl station wlan0 connect SSDID_name

Partition
lsblk
cfdsik -> sda1 100-200MB efi , sda2 20GB
mkfs.ext4 /dev/sda2
mount /dev/sda2 /mnt/linux

Install:
- from arch: pacman -Sy debootstrap
- from debian: apt install debootstrap arch-install-scripts

Install debian: debootstrap --arch amd64 stable /mnt/linux

genfstab /mnt/linux >> /mnt/linux/etc/fstab
Chroot into the new install
arch-chroot /mnt/linux     --- this will auto mount /dev /proc etc from current system

[manual without arch-chroot]
sudo mount -t proc /proc /mnt/linux/proc
sudo mount -o bind /dev /mnt/linux/dev
sudo mount -o bind /sys /mnt/linux/sys
chroot
[/manual]

Set Time Zone:
ln -sf /usr/share/zoneinfo/Europe/Bucharest /etc/localtime
date

apt install sudo
passwd   --- create password for root or you cant login after reboot

adduser username
usermod -aG sudo user

Kernel
apt install linux-image-amd64
or 
copy /boot/vmlinuz 
copy /usr/lib/modules/uname -r/ /mnt/linux/.... same path

Install GRUB
mount /dev/sda1 /mnt/efi
grub-install --boot-directory=/mnt/efi --efi-directory=/mnt/efi --target=x86_64-efi
ln -s /boot/vmlinuz-xxxx vmlinuz
ln -s /boot/initrd-xxxx initrd
nano /mnt/efi/grub/grub.cfg
menuentry 'Linux' {
    set root ='hd0,gpt2'
    linux    /boot/vmlinuz root=/dev/sda2 ro
    initrd    /boot/initrd
}

WIFI

nano /etc/apt/sources.list - add non-free-firmware
apt update
apt install firmware-misc-nonfree    --- othter wifi boards - realtek asus
apt install firmware-iwlwifi    --- mostly intel wifi boards

apt install iwd (alternative is wpa_supplicant)
Enable dhcp client + dns
/etc/iwd/main.conf
[General]
EnableNetworkConfiguration=true
/etc/resolv.conf
nameserver 1.1.1.1

nano /etc/hostname
nano /etc/hosts    - 127.0.0.1 hostname


Reboot

sudo dpkg-reconfigure locales

* Video system

You can install here a desktop/login manager - gdm3, lightdm etc OR just use xinit without an GUI interface
apt install xfce4   --- it will install xorg as a requirement

Xwayland works with gdm3 and gnome only for now.
Xfce4 works with lightdm and xorg/x11.

Change active Display Manager:
sudo dpkg-reconfigure gdm3
sudo dpkg-reconfigure lightdm

To start video mode:
systemctl start lightdm 

sudo apt install wget
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i google.....deb
sudo apt -f install  --- to fix dependencies error from above

Change console FONT size

Go to directory /usr/share/kbd/consolefonts - and ls to see all available fonts

then setfont iso01-12x22.psfu.gz 
or any other fonts you like from there

dpkg-reconfigure console-setup


https://www.linuxfromscratch.org/

ArchLinux - https://wiki.archlinux.org/title/Installation_guide

https://gist.github.com/myTerminal/4f1d26eaf32cdc5bcc9fb19f594c03d2

https://www.debian.org/releases/stretch/amd64/apds03.html.en

https://wiki.debian.org/Debootstrap

On xfce4 time will not update after sustend on the gui - but time sync works fine


No comments:

Post a Comment