An Interest In:
Web News this Week
- March 22, 2024
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
Installing Arch Linux
Introduction
Hello, here I will share how I installed Arch Linux on a new PC I got. Obviously the installation varies on numerous factors but I will share my method and hopefully it helps you (and future me).
Installation
First you need to download the Arch Linux ISO file which can be found here:
https://archlinux.org/download/
Next if your installing on a PC you will need to create a bootable media, if your using a virtual environment this is not necessary but the steps to do this can be found here:
https://dev.to/ethand91/how-to-create-a-bootable-usb-device-on-macos-3bke
Setting the keyboard layout
The default layout is US, but if your like me and need to change the keyboard layout you can do so via the following commands:
# List the available layoutsls /usr/share/kbd/keymaps/**/*.map.gz# Set the keyboard layoutloadkeys jp106
Connecting to the internet
This will vary depending on if your using a ethernet cable, in my case I'm using Wifi so I use the following to connect to the internet:
iwctl[iwctl] device list[iwctl] station wlan0 scan[iwctl] station wlan0 get-networks[iwctl] station wlan0 connect [network name]# You can check if you're connected via:ping google.com
Updating the system clock
You can update the system clock via:
timedatectl set-ntp true
Partitioning the disks
The devices can be found in /dev directory.
Partitioning can be done via the fdisk command:
# List the devicesfdisk -l# Create the EFI partition (NOTE: you do not need to do this if a EFI partition is already available)[fdisk] n[fdisk] ENTER[fdisk] +300M[fdisk] ENTER# Create the swap partition[fdisk] n[fdisk] ENTER[fdisk] +1G[fdisk] ENTER# Create the root partition, here we will use all the remaining space[fdisk] n[fdisk] ENTER[fdisk] ENTER# Finally save the partitions and exit fdisk via Ctrl-D[fdisk] w
Format the partitions
Now that the partitions have been created we need to format them:
# Format the EFI partition (NOTE: only do this if you created the partition in the above step)mkfs.fat -F 32 [EFI]# Initialize the swap partitionmkswap [swap]# Create an Ext4 file systemmkfs.ext4 [root]
Mount the file systems
Next we need to mount the root volume and enable the swap volume:
mount [root] /mntswapon [swap]
Installing the required packages
Next we need to install the essential packages and some optional ones, I prefer vim but you can use any IDE you want.
pacstrap /mnt base linux-lts linux-lts-headers linux-firmware vim wget
Configure the system
Next we need to generate an fstab file and change root into the new system.
genfstab -U /mnt >> /mnt/etc/fstab (NOTE: check the fstab file for errors)arch-chroot /mnt
Setting the timezone
The timezone can be configured via the following commands:
ln -sf /usr/share/zoneinfo/Japan /etc/localtimehwclock --systohc
Localization
Next we need to generate the locales and keymap.
# Uncomment any need locales from the following file:vim /etc/locale.gen (LANG=ja_JP.UTF-8)# Set the keyboard layoutvim /etc/vconsole.conf (KEYMAP=jp106)
Network Configuration
Create the following file and give the machine a unique name.
vim /etc/hostname
Setting the root password
The root password can be changed via the following simple command
passwd
Installing and configuring the boot loader
Next we need to install and configure a bootloader, for this I will be using GRUB and machine has an Intel CPU you will need to enable the AMD microcode updates if you have an AMD CPU.
pacman -S intel-ucodepacman -S grub efibootmgr# Configure EFIgrub-install --target=x86_64-efi --efi-directory=/mnt/efi --bootloader-id=GRUBgrub-mkconfig -o /boot/grub/grub.cfg
Creating the users
Next we need to create a user that will use the machine, we will also install sudo and add the user to the sudoers list.
useradd -m [user]passwd [user]usermod -aG wheel [user]# Install and enable sudopacman -S sudovim /etc/sudoers (Uncomment wheel)
Setting up the Graphical User Interface
Next we need to setup the Graphical User Interface.
pacman -S xorg xorg-serverpacman -S gnome gnome-tweaks# Enable the servicesystemctl enable gdm
(Optional) Enabling Japanese Fonts
Since I'm using a Japanese keyboard etc the fonts also need to be installed and configured, if you do not need them please skip to the next step.
pacman -S adobe-source-han-sans-jp-fontspacman -S fcitx-im fcitx-configtool fcitx-mozc fcitxvim /home/[user]/.xprofileexport GTK_IM_MODULE=fcitxexport QT_IM_MODULE=fcitxexport XMODIFIERS="@im=fcitx"
Installing the Network Manager
Next we need to install and enable the network manager
pacman -S networkmanagersystemctl enable NetworkManager
Installing misc packages
pacman -S networkmanagersystemctl enable NetworkManagerpacman -S nvidia-ltspacman -S base-develpacman -S bluezsystemctl enable bluetooth
Now we can finally install any optional packages, since I have a Nvidia Graphics card I will also install the drivers.
# Graphic card driverspacman -S nvidia-lts# Development packagespacman -S base-devel# Bluetoothpacman -S bluezsystemctl enable bluetooth
Feel free to add any other packages you may need.
Conclusion
Here I have shown how I install Arch Linux, feel free to use it as a reference and if you have any improvements please let me know.
Also side note I'm still working on my WebRTC Android Tutorial, however the API has changed slightly and my schedule is hectic. Please wait a little longer if you are following my WebRTC tutorial.
Like me work? I post about a variety of topics, if you would like to see more please like and follow me.
Also I love coffee.
Original Link: https://dev.to/ethand91/installing-arch-linux-1d3p
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To