Install Arch Linux under the following conditions.
conditions
/ dev / sdx
(x depends on the environment)/ dev / sdx1
is / boot
and / dev / sdx2
is/
Download the ISO file ʻarchlinux-year.month.day-x86_64.iso` from the official Download ArchLinux page.
Write the ISO file to the USB memory using the dd
command.
# dd bs=4M if=/path/to/archlinux.iso of=/dev/sdy status=progress && sync
When the USB installation media is complete, boot the live environment from the USB installation media.
Create partition
root@archiso ~ # parted /dev/sdx
(parted)mklabel msdos
(parted)mkpart primary ext4 1MiB 100MiB //[/boot]For directories
(parted)mkpart primary ext4 100MiB 100% //[/]For directories
(parted)q
Initialize the created partition.
root@archiso ~ # mkfs.ext4 /dev/sdx1
root@archiso ~ # mkfs.ext4 /dev/sdx2
Mount the created partition.
root@archiso ~ # mount /dev/sdx2 /mnt
root@archiso ~ # mkdir /mnt/boot
root@archiso ~ # mount /dev/sdx1 /mnt/boot
Time setting
root@archiso ~ # timedatectl set-ntp true
root@archiso ~ # timedatectl set-timezone Asia/Tokyo
Select a mirror list to install the ArchLinux package (select a Japanese server)
root@archiso ~ # vim /etc/pacman.d/mirrorlist
root@archiso ~ # cat /etc/pacman.d/mirrorlist
##
## Arch Linux repository mirrorlist
## Filtered by mirror score from mirror status page
## Generated on 20xx-xx-xx
##
## Japan
Server = http://mirrors.cat.net/archlinux/$repo/os/$arch
## Japan
Server = http://ftp.tsukuba.wide.ad.jp/Linux/archlinux/$repo/os/$arch
## Japan
Server = http://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch
## other country
...
Installation of base system and required packages
root@archiso ~ # pacstrap /mnt base linux vim dhcpcd
Create an fstab to determine the disk using the UUID.
root@archiso ~ # genfstab -U /mnt >> /mnt/etc/fstab
root@archiso ~ # cat /mnt/etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sdx2
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / ext4 rw,relatime 0 1
# /dev/sdx1
UUID=yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy /boot ext4 rw,relatime 0 2
Chroot to the installed environment
root@archiso ~ # arch-chroot /mnt
Time zone and time settings
[root@archiso /]# ln -sf /usr/share/zoneinfo/Asia/Tokyo > /etc/localtime
[root@archiso /]# hwclock --systohc
Setting the character code to use
[root@archiso /]# vim /etc/locale.gen
[root@archiso /]# cat /etc/locale.gen
en_US.UTF-8 UTF-8
ja_JP.UTF-8 UTF-8
[root@archiso /]# locale-gen
[root@archiso /]# vim /etc/locale.conf
[root@archiso /]# cat /etc/locale.conf
LANG=en_US.UTF-8
Hostname settings
[root@archiso /]# vim /etc/hostname
[root@archiso /]# cat /etc/hostname
myhostname
Network settings
[root@archiso /]# vim /etc/hosts
[root@archiso /]# cat /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 myhostname.localdomain myhostname
root password setting
[root@archiso /]# passwd
Bootloader installation and configuration
[root@archiso /]# pacman -S grub os-prober intel-ucode
[root@archiso /]# grub-install --target=i386-pc --recheck /dev/sdx
[root@archiso /]# grub-mkconfig -o /boot/grub/grub.cfg
Set to connect to the network at boot time
[root@archiso /]# systemctl enable dhcpcd
Log out of chroot and reboot
[root@archiso /]# exit
root@archiso ~ # umount -R /mnt
root@archiso ~ # reboot
Log in as root
myhostname login : root
passwd
Create a local user
[root@myhostname ~]# useradd -m -G wheel -s /bin/bash myusername
[root@myhostname ~]# passwd myusername
Install sudo so that users in the wheel group can use sudo.
[root@myhostname ~]# pacman -S sudo
[root@myhostname ~]# vim /etc/sudoers
[root@myhostname ~]# cat /etc/sudoers
...
##
## User privilege specification
##
root ALL=(ALL) ALL
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL
...
Login as a local user
[root@myhostname ~]# exit
myhostname login : myusername
passwd
Install and enable openssh
[myusername@myhostname ~]# sudo pacman -S openssh
[myusername@myhostname ~]# sudo systemctl enable sshd
I installed Arch Linux in the environment booted by BIOS boot and set it up to the point where it can be operated from the outside with ssh. Detailed explanation is [Installation Guide-ArchWiki](https://wiki.archlinux.jp/index.php/%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3 See% 83% BC% E3% 83% AB% E3% 82% AC% E3% 82% A4% E3% 83% 89).
Recommended Posts