SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

Arch Linux Recommendations

Procedure

Set the console keyboard layout

loadkeys jp106

Update the system clock

timedatectl set-timezone Asia/Tokyo
timedatectl # 確認

Partition the disk

fdisk -l # 確認

Delete partition

fdisk /dev/nvme0n1
Command (m for help): p # パーティション確認
Command (m for help): d # パーティション削除
Command (m for help): w # 書き込み

Create partition

fdisk /dev/nvme0n1
Command (m for help): g # GPT作成

EFI system partition (1GiB)

Command (m for help): n
Partition number: 1
First sector: (Enter)
Last sector: +1G

Command (m for help): t
Partition number: 1
Type: 1   # EFI System

Linux swap (4GiB)

Command (m for help): n
Partition number: 2
First sector: (Enter)
Last sector: +4G

Command (m for help): t
Partition number: 2
Type: 19  # Linux swap

Linux x86-64 root / (all remaining)

Command (m for help): n
Partition number: 3
First sector: (Enter)
Last sector: (Enter)

Confirm partitions

Command (m for help): w # 書き込み

Format the partitions

# EFI
mkfs.fat -F 32 /dev/nvme0n1p1

# swap
mkswap /dev/nvme0n1p2

# root
mkfs.ext4 /dev/nvme0n1p3

Mount the file systems

# root
mount /dev/nvme0n1p3 /mnt

# EFI
mount --mkdir /dev/nvme0n1p1 /mnt/boot

# swap
swapon /dev/nvme0n1p2

Install essential packages

pacstrap -K /mnt base linux linux-firmware
pacman -S amd-ucode

Text editor

pacman -S vi
echo "set number" >> ~/.vimrc # 行番号表示

Configure the system

# フスタブ
genfstab -U /mnt >> /mnt/etc/fstab

# クルート
arch-chroot /mnt

# 時間
ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
hwclock --systohc

# ローカリゼーション
locale-gen
cat /etc/locale.conf # 中身確認
echo "LANG=en_US.UTF-8" > /etc/locale.conf # 上書き保存
cat /etc/vconsole.conf # 中身確認
echo "KEYMAP=jp106" > /etc/vconsole.conf # 上書き保存

# ネットワーク構成
echo "yourhostname" > /etc/hostname

# ルートパスワード
passwd

# ブートローダー(GRUB)
pacman -S grub efibootmgr os-prober
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

# リブート
exit
reboot

# ログイン
root

Reference

Installation guide - ArchWiki
https://wiki.archlinux.org/title/Installation_guide