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
[email protected] ~ # 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.
[email protected] ~ # mkfs.ext4 /dev/sdx1
[email protected] ~ # mkfs.ext4 /dev/sdx2
Mount the created partition.
[email protected] ~ # mount /dev/sdx2 /mnt
[email protected] ~ # mkdir /mnt/boot
[email protected] ~ # mount /dev/sdx1 /mnt/boot
Time setting
[email protected] ~ # timedatectl set-ntp true
[email protected] ~ # timedatectl set-timezone Asia/Tokyo
Select a mirror list to install the ArchLinux package (select a Japanese server)
[email protected] ~ # vim /etc/pacman.d/mirrorlist
[email protected] ~ # 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
[email protected] ~ # pacstrap /mnt base linux vim dhcpcd
Create an fstab to determine the disk using the UUID.
[email protected] ~ # genfstab -U /mnt >> /mnt/etc/fstab
[email protected] ~ # 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
[email protected] ~ # arch-chroot /mnt
Time zone and time settings
[[email protected] /]# ln -sf /usr/share/zoneinfo/Asia/Tokyo > /etc/localtime
[[email protected] /]# hwclock --systohc
Setting the character code to use
[[email protected] /]# vim /etc/locale.gen
[[email protected] /]# cat /etc/locale.gen
en_US.UTF-8 UTF-8
ja_JP.UTF-8 UTF-8
[[email protected] /]# locale-gen
[[email protected] /]# vim /etc/locale.conf
[[email protected] /]# cat /etc/locale.conf
LANG=en_US.UTF-8
Hostname settings
[[email protected] /]# vim /etc/hostname
[[email protected] /]# cat /etc/hostname
myhostname
Network settings
[[email protected] /]# vim /etc/hosts
[[email protected] /]# cat /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 myhostname.localdomain myhostname
root password setting
[[email protected] /]# passwd
Bootloader installation and configuration
[[email protected] /]# pacman -S grub os-prober intel-ucode
[[email protected] /]# grub-install --target=i386-pc --recheck /dev/sdx
[[email protected] /]# grub-mkconfig -o /boot/grub/grub.cfg
Set to connect to the network at boot time
[[email protected] /]# systemctl enable dhcpcd
Log out of chroot and reboot
[[email protected] /]# exit
[email protected] ~ # umount -R /mnt
[email protected] ~ # reboot
Log in as root
myhostname login : root
passwd
Create a local user
[[email protected] ~]# useradd -m -G wheel -s /bin/bash myusername
[[email protected] ~]# passwd myusername
Install sudo so that users in the wheel group can use sudo.
[[email protected] ~]# pacman -S sudo
[[email protected] ~]# vim /etc/sudoers
[[email protected] ~]# 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
[[email protected] ~]# exit
myhostname login : myusername
passwd
Install and enable openssh
[[email protected] ~]# sudo pacman -S openssh
[[email protected] ~]# 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