Arch linux: Difference between revisions
custom repository |
bootloader |
||
Line 119: | Line 119: | ||
Server= http://repo.archlinux.fr/$arch | Server= http://repo.archlinux.fr/$arch | ||
</code> | </code> | ||
Save changes and exit,and of course if you are editing a file you are expected to save it, so I might not always write save changes. | |||
Run pacman to get yaourt <code>pacman -Sy yaourt </code> Yaourt is basically the Arch Linux Users version of pacman. It is slighltly different, more on that later. | |||
Setup root password <code> passwd </code> | |||
Simply type in “passwd” and confirm password | |||
Add a regular user | |||
<code> useradd -m -g users -G wheel,storage -s /bin/bash axon </code> -m flag is to create -g is the group flag -G on the other hand is the secondary group. Wheel is the Arch equivalent of nano, storage gives access to removable devices, and bash is the shell environment. Now set up a password for the user, <code>passwd axon </code> | |||
Sudo Permissions: | |||
We need to make sure to edit one file so that the sudo password is asked everytime when doing a sudoers task. | |||
<code> EDITOR=nano.visudo </code> find %wheel and add on the line below <code> Defaults root pw </code> Now the sudo password will be prompted when doing sudeoers task. | |||
At this point you might have to restart the system, you may encounter some error messages in the next step just reboot, remount and get chroot back in if it happens. | |||
'''Bootloader installation and configuration''' | |||
<code> mount -t efivarfs efivarfs /sys/firmware/efi/efivars </code> This should return that it's busy or already in use,it's a good thing if that happens, otherwise you need to recheck all the steps. | |||
Now install the bootloader <code> bootctl install </code> | |||
<code> blkid </code> Make a note of the UUID of /dev/sda3. The following steps must be done exactly this way except you will have a very different UUID. | |||
<code> blkid -s PARTUUID -o value /dev/sda3 > /boot/loader/entries/arch.conf </code> You just outputted the UUID in arch.conf. | |||
<code> nano /boot/loader/entries/arch.conf </code> You need to edit this configuration file. You will see the UUID generated and nothing else on it. | |||
Above the uuid type in | |||
<code> | |||
title Arch Linux | |||
linux /vmlinuz-linux | |||
initrd /initramfs-linux.img | |||
options root=PARTUUID=*UUID* rw” | |||
</code>Save and exit. Vmlinuz is the name of a linux kernel executable. You should know that kernel is like the heart of an OS. Vmlinuz is compressed and bootale. Initrd is a scheme for temporary root file system into memory, which may be used as part of the Linux startup process. initrd and initramfs refer to two different methods of achieving this. |
Revision as of 23:22, 5 May 2017
Arch Linux is a Unix like linux distribution. Arch started it’s journey in 2002, and is usually used by advanced users. Arch Linux is not super user friendly to begin, and therefore not recommended for rookies. However, the deal with Arch Linux is that it’s free of bloat-wares and uses a very minimalistic approach, moreover it pushes to user to put great effort into understanding how the system works.
The main reasons to install Arch Linux are as follows: 1. Arch Linux is community based, and not market based. It doesn’t need to bother about the markets and customers, in fact it’s all about the development process. Furthermore, Arch doesn’t need to be patched, it is kind of like a stock Android, where the user uses what the upstream developed. Arch Linux probably has the best community support of all the linux distros, and the Arch WIKI contains pretty much everything a user might require.
2. Arch has massive software repositories. Arch has pretty much every application that is available through the packaging system on other distros, if not more. Arch calls it the Arch User Repository. It is a repository maintained by users, whereby users can compile and install packages from the source. Of course, users can also use Yaort command, if they prefer.
3. Support for majority of desktop environments. Mainstream linux distro like Ubuntu uses Unity uptill 16.10, and Unity by far the slowest desktop environment I’ve used. Although, users have the option to install Plasma, XFCE, MATE. Other environments like Gnome doesn’t work well on ubuntu. However, as of Ubuntu 17.04, Ubuntu has switched back to Gnome. Arch Linux supports LXDE,XFCE,Gnome,Mate and Cinnamon, and nothing seems to make it laggy, or break it.
4. Total User Control. Arch puts you in the pilot’s chair. The user has the ability to build everything from scratch, hence they can choose whatever they want instead of having to deal with unnecessary packages.
5. Rolling Releases. Unlike other distros, you do not come across a major update every 6 months. Arch uses rolling updates. That means, you are always running the latest packages, both desktop and kernel, as you don’t have to wait for a new distro, and you automatically get the latest packages.
How to install Arch Linux on VirtualBox for a EFI System
This is a long process, but first of all you need to get the official Arch Linux ISO from [1] On Virtual Box you will need to create a EFI enabled virtual machine. In my case, I used 20GB dynamically allocated hard drive, 1.5GB RAM and 85% Processor power. Once that's all done,mount the ISO and fire up the virtual machine.
Once inside the virtual machine, you will see a promt like root@archoiso ~ #
first thing you want to do is check whether the internet is working by simply doing ping -c 3 www.google.com
Creating file systems, formatting and mounting I recommend cgdisk or gdisk for EFI systems, it is very user friendly and straightforward. FIrst of all you need to check your block devices and partitions.
lsblk
to view block devices
cgdisk /dev/sda
In my case it was /dev/sda
Now you need to start creating the partitions. You basically need just 3 partitions, boot, swap and root. For all of the partitions leave the first sector empty. Now create a partition.
Remember first sector empty
KGMTP 512MB
512MB is enough for a EFI boot.
Hexcode: L to view all. Go with ef00
Partition name : boot
Create another partition /dev/sda2
Size in sectors(KMGTP): 2GB The rule is to allocate around 1.5 times the RAM for your Swap partition, so in my case it was 2GB approx.
Hexcode: 8200
Partition name : swap
Create the final partition /dev/sda3
Size in sectors(KMGTP): leave blank By leaving blank it will allocate the remaining space to this partition.
Hexcode: 8300
This is the main linux file system and is suitable for our root partition.
Partition name : root
lsblk
To verify the partitions exist
Formatting:
Format boot partition mkfs.fat -F32 /dev/sda1
FAT32 is used for EFI boot.
Format swap partion mkswap /dev/sda2
Intialize swap swapon /dev/sda2
Format root partition mkfs.ext4 /dev/sda3
Ext4 journaling system is used for root.
Mounting:
Mount root mount /dev/sda3 /mnt
Now make directory mkdir /mnt/boot
Mount boot mount /dev/sda1 /mnt/boot
Mirrorlist (Optional)
Now you have the option to rank the mirrorlist, even though you do not really have to do this. To do so you need to edit /etc/pacman.d/mirrorlist
and uncomment the mirrors you want to rank. I sugguest uncommenting at least 20 countries. Use rankmirrors -n 5 /etc/pacman.d/mirrorlist
to rank the top five mirrors , could take a few minutes.
Install base packages, Generate fstab
To install base packages pacstrap -i /mnt base base-devel
These are the core packages of an Arch Linux Installation.
FSTAB basically lists all the partitions and data sources and show how they are being used.
To generate fstab genfstab -U /mnt >> /mnt/etc/fstab
Check if fstab generated in /mnt/etc
Basic configurations
First of all you need to get inside the newly installed system arch-chroot /mnt
You should see a slightly different prompt now.
Change language to EN_US:
Use the command nano /etc/locale.gen
Uncomment en_US.UTF-8
There should be two of these
Generate the locale locale-gen
Now the output needs to be saved echo LANG=en_US.UTF-8 > /etc/locale.conf
and exported export LANG=en_US.UTF-8
Set up the time :
Now change to Tallinn by creating a soft link ln -s /usr/share/zoneinfo/Europe/Tallinn > /etc/localtime
This might already exists
Now set hardware clock to utc hwclock –systohc –utc
Set up the hostname:
setup the hostname echo bossman-arch > /etc/hostname
Double check to see if hostname exists
Enable multilib and create custom repository: (Optional Step)
Type in nano /etc/pacman.conf
Find and uncomment multlib, not the testing, just the multilib and line beneath of course. Multilib makes sure you have access to 32bit programs
In the same file, all the way in the bottom add a custom repository :
[archlinuxfr]
SigLevel= Never
Server= http://repo.archlinux.fr/$arch
Save changes and exit,and of course if you are editing a file you are expected to save it, so I might not always write save changes.
Run pacman to get yaourt pacman -Sy yaourt
Yaourt is basically the Arch Linux Users version of pacman. It is slighltly different, more on that later.
Setup root password passwd
Simply type in “passwd” and confirm password
Add a regular user
useradd -m -g users -G wheel,storage -s /bin/bash axon
-m flag is to create -g is the group flag -G on the other hand is the secondary group. Wheel is the Arch equivalent of nano, storage gives access to removable devices, and bash is the shell environment. Now set up a password for the user, passwd axon
Sudo Permissions: We need to make sure to edit one file so that the sudo password is asked everytime when doing a sudoers task.
EDITOR=nano.visudo
find %wheel and add on the line below Defaults root pw
Now the sudo password will be prompted when doing sudeoers task.
At this point you might have to restart the system, you may encounter some error messages in the next step just reboot, remount and get chroot back in if it happens.
Bootloader installation and configuration
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
This should return that it's busy or already in use,it's a good thing if that happens, otherwise you need to recheck all the steps.
Now install the bootloader bootctl install
blkid
Make a note of the UUID of /dev/sda3. The following steps must be done exactly this way except you will have a very different UUID.
blkid -s PARTUUID -o value /dev/sda3 > /boot/loader/entries/arch.conf
You just outputted the UUID in arch.conf.
nano /boot/loader/entries/arch.conf
You need to edit this configuration file. You will see the UUID generated and nothing else on it.
Above the uuid type in
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=PARTUUID=*UUID* rw”
Save and exit. Vmlinuz is the name of a linux kernel executable. You should know that kernel is like the heart of an OS. Vmlinuz is compressed and bootale. Initrd is a scheme for temporary root file system into memory, which may be used as part of the Linux startup process. initrd and initramfs refer to two different methods of achieving this.