User:Stempit/Notes

From ArchWiki
Jump to navigation Jump to search

Description

This is my helpful notes. If you think that some commands is wrong or may be better, edit it and help me please.

Install

My basic install

This is my typical ArchLinux install commands. Based on Installation guide (Русский).

Preparation

Ok, get last LiveCD, write on CD or USB, and boot it!

Initial

Check connection, usually all is ok:

# ping ya.ru

Update system clock:

# timedatectl set-ntp true

Check drives:

# fdisk -l

Partition drive:

# cfdisk /dev/sdX
Note: Grub need +1MB bios boot partition for GPT

Format partitions:

# mkfs.ext4 /dev/sdXY
# mkswap /dev/sdXZ

Run swap

# swapon /dev/sdXZ

Mount

# mount /dev/sdXY /mnt
# mount /dev/sdXX /mnt/boot

Install base

# pacstrap /mnt base

Generate fstab

# genfstab -U /mnt >> /mnt/etc/fstab

Check it and add discard and noatime options for partitions on SSD:

# nano /mnt/etc/fstab

Chroot

Go chroot

# arch-chroot /mnt

Set time

# ln -sf /usr/share/zoneinfo/Europe/Kirov /etc/localtime
# hwclock --systohc

Localization (based on Internationalization (Русский)). Firstly, generate locales:

# nano /etc/locale.gen
en_US.UTF-8
ru_RU.UTF-8
# locale-gen

Add locale and fonts to vconsole:

# nano /etc/vconsole.conf
LOCALE="ru_RU.UTF-8"
KEYMAP="ru"
HARDWARECLOCK="UTC"
TIMEZONE="Europe/Kirov"
FONT="cyr-sun16"
CONSOLEFONT="cyr-sun16"
CONSOLEMAP=""
USECOLOR="yes"
# nano /etc/locale.conf
LANG=ru_RU.UTF-8
LC_MESSAGES=ru_RU.UTF-8

Set hostname

# nano /etc/hostname
myhostname
# nano /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
127.0.1.1 myhost.localdomain myhost

Network settings

# ls /sys/class/net/
# cp /etc/netctl/examples/ethernet-dhcp /etc/netctl/
# nano /etc/netctl/ethernet-dhcp
Inteface=ens3
# netctl enable ethernet-dhcp
# systemctl enable dhcpcd

Make initramfs

# mkinitcpio -p linux

Install bootloader (I prefer GRUB and rEFInd)

 # pacman -s grub
 # grub-install /dev/sda
 # grub-mkconfig -o /boot/grub/grub.cfg

Finish

 # passwd
 # CTRL+D
 # reboot

User creation

Root is good, but... Usually I create a user. And I use sudo for extend privilegues. Firstly install sudo:

# pacman -S sudo

And edit sudoers file. I prefer allow run sudo with password for group. Uncomment line:

# EDITOR=nano visudo
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL

Now create user:

# useradd -m -g users -G wheel,power,audio,storage,cups -s /bin/bash username

And set his password:

# passwd username

Well, now we can logout and login as user.

Diskless system

For diskless system installation I use wiki article Diskless_system and other russian article, it's simple and fast. DHCP server installed on router, I skip this step. And I prefer tftp-hpa tftp server.

Packages

In different systems I use different packages, but I have small list of packages, which installed on most systems: