User:Erkexzcx

From ArchWiki
Jump to: navigation, search

First of all, this is unofficial Arch Linux installation guide. Arch Linux is not beginners distribution, so if you find it hard to follow this guide - just leave it.

Installation

Get internet access

Test internet connection

type this command:

# ping -c 3 www.google.com

if you see a responses from a Google's server - you have Internet access. Move on...

Connect to a WiFi

type this command and at the end press TAB and Enter:

# wifi-menu wlp

Tab should complete the name of wifi interface for you automatically. Follow the instructions and connect to a wifi. Use ping command to test internet connection.

To see a list of all possible devices, type:

# iw dev

Partitions

To avoid partitioning below (which, some users find extremelly difficult), go ahead and install another disctribution in a graphical way - User:Erkexzcx#Dualboot. For example, install Ubuntu and imagine that you are installing Arch Linux. When you finished, just start from User:Erkexzcx#Mount_partitions, but don't forget to do steps at User:Erkexzcx#Dualboot.

Identify partitions

use

# lsblk

and

# lsblk -f

to see the advanced information about your partitions and hard drives visible to your system.

Destroy a partition table

This completelly destroys data on your hard drive for sure :)

# sgdisk --zap-all /dev/sda

Create a partition table

Create 2 partitions:

  • Linux filesystem
  • SWAP

You might not need SWAP, but I would suggest to google what are benefits of installing&using SWAP.

Type command

# cgdisk /dev/sda

Follow the instructions. Select unallocated space, give a bit to SWAP (people say it must be twice bigger than your amount of RAM) and the rest of it for Linux filesystem. At the end - write the changes and quit

Format partitions

The new created partitions are unusable until you format them into a needed format.

Format the linux filesystem partition into EXT4 format:

# mkfs.ext4 /dev/sda1

Also, format the SWAP partition if you created it:

# mkswap /dev/sda2

Mount partitions

Mount the linux partition (EXT4) on /mnt:

# mount /dev/sda1 /mnt

Then mount swap partition:

# swapon /dev/sda2

Install base Arch system

Install base packages to the hard drive. This is basically the whole base Arch Linux system:

# pacstrap -i /mnt base base-devel
Tip: Leave all default and keep pressing Enter

Generate fstab

fstab is a file, which is read by a system on every boot at a very early stage. The file contains what and how must be mounted before booting up.

Generate current mounts into a file using this command:

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

Enter the chroot mode

Chroot mode is kind of switching from live USB arch Linux boot into a booted system state. This basically allows you to gain more control over your "installed" system rather than just configuring it from your live usb.

Enter Chroot mode now:

# arch-chroot /mnt /bin/bash

Configuration in chroot mode

Setting locale and stuff

Set the US locale to your system.

Uncomment #en_US.UTF-8 UTF-8 to en_US.UTF-8 UTF-8:

# nano /etc/locale.gen

Then apply changes to the system:

# locale-gen

Also, export this for some reason... o.O

# echo LANG=en_US.UTF-8 > /etc/locale.conf

Set the correct timezone

Just run this and follow the steps:

# tzselect

So, the operation is simple as this. Remember to use Tab button and ls if needed:

# ln -sf /usr/share/zoneinfo/Zone/SubZone /etc/localtime

Example:

# ln -sf /usr/share/zoneinfo/Europe/Vilnius /etc/localtime

Set the hardware clock

Just type this command:

# hwclock --systohc --utc

Set the system's hostname

Hostname is kind of a system's name in the network. When seeing only IP address, this will be visible instead. It can be anything you want, just ensure it's just one word (lowercase letters are acceptable).

Let's say, I want my hostname to be CUNTDESTROYER so this is what I do:

# echo CUNTDESTROYER > /etc/hostname

and there:

/etc/hosts
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost CUNTDESTROYER
::1   localhost.localdomain localhost CUNTDESTROYER

Network

We will definitely need network. After we boot straight to the system (not live, but on our computer's physical hard drive), we won't have wifi-menu, so we need to install it first!

Install required software:

# pacman -S iw wpa_supplicant dialog

Set the password

Our root user needs password!

Enter this command and follow the instructions:

# passwd

Install bootloader

The bootloader is called GRUB.

Install it:

# pacman -S grub
Tip: In addition, install os-prober if you have more than 1 existing OS in your system (not needed for virtualbox if you ever thought.)
Note: If you ever see the error while executing one of these commands below, GRUB, for some reason, is not going to work. Use Syslinux, which usually work in these kind of cases.

Install itself a grub bootloader into the system:

# grub-install --recheck /dev/sda

And generate configuration file for GRUB:

# grub-mkconfig -o /boot/grub/grub.cfg

Reboot

You might want to continue in chroot mode (if you are on virtualbox), so you can download and install all the required stuff so you can boot straight into a GUI, otherwise you will need to configure internet.

Exit the chroot mode:

# exit

Unmount the mounted partitions (skip if fails):

# umount /mnt

Reboot computer:

# reboot

post installation

If you got tired of coding all the way to here, these are the critical things you need to get right now:

  1. Working graphical user interface
  2. Get internet working in a GUI.

First login

After you boot the system, you will need to enter just a single existing account:

Username: root

Password: Your previously created password

Internet access (to install GUI)

As you are now logged in, test if you have working Internet connection:

# ping -c 3 www.google.com

if no, identify the WiFi interfaces:

# iw dev
Note: Tab and Enter method will not work. It only works in live system, so type manually.

You will see something similar to wlp4s0 and enp5s0. The wireless adapter interface always starts with w and Ethernet (cable) adapter interface starts with e.

So connect to the Internet using Wi-Fi interface:

# wifi-menu interface

Install X server

To be able to see graphcical desktop environment, we need a host for it. This is the software, called X Server and it used to host a desktop environment:

Install it:

# pacman -S xorg-server xorg-server-utils xorg-xinit

It might ask you what GPU (or just video - whatever) drivers you are about to use. Just use default selected.

Install preferred DE

You might test other DEs later, but for now, let's install XFCE4.

For the list of Desktop Environments, see Desktop_environment. You are on your own to read Arch wiki to install any other WM or DE.

Install Xfce:

# pacman -S xfce4 xfce4-goodies

Internet browser

In addition, after we boot, we probably need Internet browser to find some information straight from the computer:

# pacman -S firefox
Note: google-chromeAUR is not available via pacman! You might consider using chromium browser, which is open source version of Chrome without closed source features.

Network (in GUI)

Also, we would like to configure network from Desktop Environment rather than from terminal. So install:

# pacman -S network-manager-applet networkmanager gnome-keyring

Then we must enable Network Manager so we can control it through applet in the Desktop Environment:

# systemctl enable NetworkManager.service

Login manager

Then, let's install a Login manager (tired of terminal typing, yep?):

# pacman -S lxdm

Also, enable it:

# systemctl enable lxdm.service

Tell the computer what DE you are using:

~/.xinitrc
#!/bin/bash

# Start XFCE4
exec startxfce4

Regular user

Using root is not a good idea. Your system should crash and get unusable in a weeks, so new regular user is needed:

# useradd -m -G wheel,games,rfkill,users,uucp,audio,camera,disk,floppy,lp,network,optical,power,scanner,storage,sys,video -s /bin/bash user

If any of these groups does not exist, add them:

# groupadd group

Uncomment the line containing %wheel group, so your user will be able to manage system on his behalf, not just as root.

# nano /etc/sudoers

So your user is in wheel group and will be allowed to execute root (sudo) commands.

In section Login manager you typed this already, but type again as regular user (when typed as root, this will be created at /root/.xinitrc and when typing as a regular user will be at /home/user/.xinitrc. These are separate directories and both must contain the same):

~/.xinitrc
#!/bin/bash

# Start XFCE4
exec startxfce4

Sound

I would suggest you to reboot the PC so you will boot right to the GUI Desktop Environment :)

Enable multilib, so you can install 32bit packages on 64bit system. Uncomment the [multilib] section (both lines):

/etc/pacman.conf
[multilib]
Include = /etc/pacman.d/mirrorlist

Then update the packages DB, so pacman will be able to install 32bit packages:

# pacman -Syu

Then install required packages:

# pacman -S pulseaudio pavucontrol pulseaudio-alsa lib32-alsa-plugins lib32-libpulse alsa-utils gstreamer0.10-plugins

Reboot the PC. Open terminal and configure settings (unmute, increase volume to 100%):

$ alsamixer
$ pavucontrol

working FN buttons

For the most part, your system is ready 2 use, but some FN action buttons might not work. Here is what I recomment:

  1. Ensure, that the FN+<BUTTON> produces output (check with xev.
  2. Ensure, that button is binded in your DE settings (shortcuts).
  3. Google for your laptop's model in Arch Linux (via google). You might find useful information like this page!

AUR

Arch is mostly proud of Arch Wiki and AUR. AUR let's use use scripts, created by community, to install stuff, not even created for Arch Linux (let's say, Ubuntu DEB packages), in a specific way. The script can be downloaded from the aur website and installed, but I will show you how to do this quickly and merge with pacman:

Install yajl (this is a dependency):

# pacman -S yajl

Install package query: Open this link and click on the right hand side Download snapshot. Do the same for https://aur.archlinux.org/packages/yaourt/

Go to your download folder on your system and extract both these files using this command:

$ tar -xvzf archive.tar.gz

Then go to the each folder and execute the following command:

$ makepkg
# pacman -U *.tar.xz

Slowly install yaourt-gui package by following the instructions after installing via this command:

$ yaourt -S yaourt-gui

Then open yaourt-gui (it's terminal GUI):

$ yaourt-gui

Then enter number 20 and press Enter. Find these lines and (un)comment (and edit) just like this:

# Prompt
NOCONFIRM=0
UP_NOCONFIRM=1     # No prompt while build upgrades (including -Sbu)
BUILD_NOCONFIRM=1  # Only prompt for editing files
PU_NOCONFIRM=1     # Add --noconfirm to $PACMAN -U
EDITFILES=0
NOENTER=1

Save it and you are ready to forget pacmanpackage manager. Use yaourt-gui to install files both from AUR and official repositories.

Post reboot

Login manager produces login loops

Just when in login manager, make sure you selected XFCE4 rather than Default session.