docs: update Archguide

This commit is contained in:
Administrator 2019-11-05 23:46:28 +00:00 committed by FOSC
parent baa8a5ce95
commit cda9c8cb30

View File

@ -2,7 +2,7 @@
title: Arch Linux Install guide
description:
published: true
date: 2019-11-05T23:07:39.276Z
date: 2019-11-05T23:46:27.064Z
tags:
---
@ -58,22 +58,71 @@ Check your internet connectivity with `ping` before continuing.
## Actual install
To install packages to a folder instead of normally, `pacstrap` is used. Here a good set of packages to get a running system is provided.
> This can also be used to fix a broken system, such as one turned off during an update, by reinstalling damaged packages.
{.is-info}
`pacstrap /mnt base base-devel linux linux-firmware f2fs-tools xorg-server gnome gnome-extra firefox networkmanager htop zsh grml-zsh-config`
`pacstrap /mnt base base-devel linux linux-firmware f2fs-tools nano xorg-server gnome gnome-extra firefox networkmanager htop zsh grml-zsh-config`
## Chrooting
*The art of running a process as if it was in another system.*
It's time to enter the freshly installed Arch rootfs!
`arch-chroot /mnt /bin/zsh`
## Making the system bootable
Run `bootctl install`
systemd-boot will be the bootloader used. It boots entries stored at `/boot/loader/entries/` and is configured at `/boot/loader/loader.conf`.
Copy an example boot entry to the correct place and then edit it.
```
cp /usr/share/systemd/bootctl/arch.conf /boot/loader/entries/
nano /boot/loader/entries/arch.conf
```
You will need to edit the `options` line so your kernel is told where to find your Arch partition. In this guide, the file would end up like this:
```
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=/dev/sda2 rw
```
> Once this is done, your Arch install is fully bootable!
{.is-success}
However, don't reboot just yet. There are still some things to do before getting into a properly running system.
While we are in the subject of the kernel options cmdline, let's enter...
#### The PARTUUID dilemma
> Using partition names to boot instead of their unique indetifiers will cause the OS not to boot if (when) the partition count or disk order of the computer changes. It may change even across reboots. To avoid this issue, extract your partition's `PARTUUID` using `blkid` and edit your options line accordingly.
{.is-danger}
```
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=PARTUUID="9b505600-2d6a-3660-b0c3-d2dfd653c5fd" rw
```
> As long as your firmware doesn't change disk order randomly, **and you know what to touch if it breaks**, this step can be done later.
{.is-info}
## Configuring the system so it's usable
### Language
At least a language needs to be generated and set as the preferred system language.
```
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
locale-gen
```
## Users
### Users
Change `root`'s password and its shell, then add your user and change their password too.
```
passwd
chsh root -s /bin/zsh
@ -82,20 +131,78 @@ useradd -m -G wheel -s /bin/zsh user
passwd user
```
## Enable services
### Enabling services
Upon bootup, NetworkManager will manage our network interfaces and a graphical login screen provided by GDM will be shown.
```systemctl enable NetworkManager gdm```
## Bootloader
`refind-install`
## Restart
> And we are truly done!
{.is-success}
```
exit
reboot
```
# btw I use arch
*but it sucks, blackscreens and lasts 5 minutes on battery*
Unless some major hardware quirks are happening (damn you, NVIDIA!) you should be able to start using your computer now.
What to do now is heavily dependent on your hardware and desktop environment. A few common tips are provided.
## Time
Use the `timedatectl` tool.
```
timedatectl set-timezone Europe/Madrid
timedatectl set-ntp true
```
## I forgot to install a terminal emulator
You always have the TTYs.
Press `ctrl+alt+F4` and login normally.
## Package management
Read the [pacman rosetta](https://wiki.archlinux.org/index.php/Pacman/Rosetta).
TL;DR, `pacman -Syu thingy1 thingy2 ...` to install thingy1 and thingy2.
## Laptops
### TLP
This daemon tunes tunables inside the heavily tunable Linux kernel so you have a semblance of battery life.
Install `tlp` and enable it, which is quirky.
```
systemctl enable --now tlp tlp-sleep
systemctl mask systemd-rfkill
```
### NVIDIA Optimus
Install `nvidia` and `nvidia-utils` as normal.
These by default will hijack your screen and run everything with the NVIDIA card. The NVIDIA control panel allows you to turn the GPU off completely.
> However, this doesn't really work on some laptops, which will just blackscreen or exhibit buggy behavior.
{.is-warning}
Install `bumblebee` so the integrated graphics have priority and activate its service: `systemctl enable bumblebeed`.
To run programs with the NVIDIA card, run `optirun program`. For Steam games, change their executable command line to `optirun %command%`.
Finally, to allow the card to turn off completely when unused, install `bbswitch`.
> Even LESS laptops will like that. The workaround involves editing your kernel cmdline options to blacklist a little bit of Windows-specific BIOS code.
{.is-danger}
More information [can be found at the usual place](https://wiki.archlinux.org/index.php/NVIDIA_Optimus)
## Kernel cmdline
Basically edit your boot options to be 'rw root=/dev/sda2', as sometimes rEFInd doesn't make this automatically
`nano /boot/refind_linux.conf`
## Git out
`exit`
`reboot`