Author: Jesús E.
Category: tutorials
Date: 2019-11-11 08:41
Diaspora: https://diasp.org/u/heckyel
Image: 2019/11/hyperbola-base.jpg
Lang: en
Mastodom: https://masto.nobigtech.es/@heckyel
Save_as: hyperbola-installation-guide/index.html
Slug: guia-de-instalacion-de-hyperbola
Tags: hyperbola, guia
Title: Hyperbola installation guide [Legacy/MBR-DOS mode]
URL: hyperbola-installation-guide/

[TOC]

First we must build a Hyperbola installation device,
it can be on a [USB][usb-boot]{:target='_blank' rel='noopener noreferrer'}
memory or [CD][cd-boot]{:target='_blank' rel='noopener noreferrer'}.

There is also an [installation video][video-guide]{:target='_blank' rel='noopener noreferrer'}
that will be updated.

### First steps

We check if there is an Internet connection

    :::console
    # ping -c 3 gnu.org

Partition disk

    :::console
    # cfdisk

- In case of the partition chosen as **swap** go to "Type" option and select **82 (Linux swap)** from list.
- In case of the partition chosen as **/boot**, select **"bootable"**

example:

    :::bash
    sda1=/boot
    sda2=/
    sda3=/home
    sda4=swap

    Recommendations:
    /boot   = 300MB
    /       = 40GB
    /home   = customized
    swap    = equivalent to RAM

#### Wi-fi connection

`wifi` detect

    :::console
    # iw dev

Enable device of network

    :::console
    # ip link set <device-name> up

Enable Internet with `wpa_supplicant`

    :::console
    # wpa_supplicant -B -i <device-name> -c <(wpa_passphrase "ssid" "psk")

Renew IPv4 with `dhcpcd`

    :::console
    # dhcpcd <device-name>

### Partition Formatting

- `/boot`, **ext4** will be used

        :::console
        # mkfs -t ext4 /dev/sda1

- `/`, **ext4** will be used

        :::console
        # mkfs -t ext4 /dev/sda2

- `/home`, **ext4** will be used

        :::console
        # mkfs -t ext4 /dev/sda3

- `swap`, **mkswap** will be used

        :::console
        # mkswap /dev/sda4

- Enable swap partition

        :::console
        # swapon /dev/sda4

### Organization of Partitions

- Mount root in /mnt

        :::console
        # mount /dev/sda2 /mnt

- Make directories of other partitions

    - boot

            :::console
            # mkdir /mnt/boot

    - home

            :::console
            # mkdir /mnt/home

- Mount other partitions

    - Mount boot

            :::console
            # mount /dev/sda1 /mnt/boot

    - Mount home

            :::console
            # mount /dev/sda3 /mnt/home

### Base System Installation

Update keys of hyperiso:

    :::console
    # pacman -Sy hyperbola-keyring

Install base packages:

    :::console
    # pacstrap /mnt base base-devel grub-bios wpa_supplicant iw kernel-firmware ldns xenocara-input-synaptics

> Install `xenocara-input-synaptics` only on laptops

### Main Configuration

- Generate fstab file

        :::console
        # genfstab -U -p /mnt >> /mnt/etc/fstab

- Inside chroot and configure base system

        :::console
        # arch-chroot /mnt

- Set hostname, to edit `/etc/hostname` file:

    Example:

        :::console
        # echo hyperpc > /etc/hostname

- Set localtime

        :::console
        # ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime

- Update system time to UTC (Optional)

        :::console
        # hwclock --systohc --utc

- Enable our location, uncomment

        :::console
        # sed -e 's|^#en_US.UTF-8 UTF-8|en_US.UTF-8 UTF-8|g' -i /etc/locale.gen

- Set location preferences

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

- Generate location

        :::console
        # locale-gen

- If you need to change keymap, configure in `/etc/conf.d/keymaps` file

        :::console
        # sed -e 's/^keymap="us"/keymap="uk"/g' -i /etc/conf.d/keymaps

- Install Grub

        :::console
        # grub-install --target=i386-pc --recheck /dev/sda

- Create grub.cfg file

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

- Edit ramdisk

        :::console
        # nano -w /etc/mkinitcpio.conf
        -----------------------------
        HOOKS="base udev autodetect modconf block filesystems keyboard fsck"

- Generate ramdisk

        :::console
        # mkinitcpio -p linux-libre-lts

- Set root user password

        :::console
        # passwd

- Configure [wpa_supplicant][wpa_link]{:target='_blank' rel='noopener noreferrer'}

        :::console
        # nano -w /etc/wpa_supplicant/wpa_supplicant.conf

    and inside:

        :::bash
        ctrl_interface=/var/run/wpa_supplicant
        ctrl_interface_group=wheel
        update_config=1

        network = {
            ssid="lynx"
	        psk="your-pass"
        }

    Add to service by default

        :::console
        # rc-update add wpa_supplicant default

- [DHCPCD][dhcpcd_link]{:target='_blank' rel='noopener noreferrer'}

    Add to service by default

        :::console
        # rc-update add dhcpcd default

- Close chroot

        :::console
        # exit

- Unmount partitions

        :::console
        # umount '/mnt/{boot,home,}'

- Reboot

        :::console
        # reboot

### Adding a user

- Create user group, for example: `libre`

        :::console
        # groupadd libre

- Create user `freedom` and add it to basic groups

        :::console
        # useradd -m -G audio,disk,games,http,input,lp,network,optical,power,scanner,storage,sys,video,wheel -g libre -s /bin/bash freedom

- Assign password

        :::console
        # passwd freedom

- Edit `/etc/sudoers` file

        :::console
        # sed -i /etc/sudoers -e 's|^# %wheel ALL=(ALL) ALL|%wheel ALL=(ALL) ALL|g'

- Reboot pc

        :::console
        # reboot

- Upgrade system

        :::console
        $ sudo pacman -Syu

### BASE graphical interface

#### Install video package (depending trademark of your video card)

Check video trademark:

    :::console
    # lspci | grep -e VGA

Install one, depending of trademark:

AMD:

    :::console
    # pacman -S xorg-video-amdgpu

Ati:

    :::console
    # pacman -S xenocara-video-ati

Intel:

    :::console
    # pacman -S xorg-video-intel

Nvidia:

    :::console
    # pacman -S xorg-video-nouveau

Vesa (generic):

    :::console
    # pacman -S xenocara-video-vesa

#### Xenocara components

    :::console
    # pacman -S xenocara-server xenocara-xinit xenocara

#### Mesa demos

    :::console
    # pacman -S mesa mesa-demos

#### Setting in keyboard language for Xenocara

Syntax of X configuration files is explained in
[Xenocara#Configuration][xe-conf]{:target='_blank' rel='noopener noreferrer'}.
Method creates configuration for entire system, which is
maintained after reboot.

Here's an example:

    :::console
    # nano -w /etc/X11/xorg.conf.d/00-keyboard.conf

and inside write:

    :::bash
    :::bash
    Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout"  "us,uk"
        Option "XkbModel"   "pc105"
        Option "XkbVariant" "deadtilde,dvorak"
        Option "XkbOptions" "grp:alt_shift_toggle"
    EndSection

XkbOptions can receive various parameters for example:

`"grp:alt_shift_toggle,compose:rwin,lv3:ralt_switch,numpad:pc"`

We have 2 keyboard layouts: English US (us) and English UK (uk),
and to go from one to the other just use the `ALT+SHIFT`
key combination.

- Check keyboard settings:

        :::console
        # setxkbmap -print -verbose 10

- Typefaces

        :::console
        # pacman -S ttf-liberation ttf-bitstream-vera ttf-dejavu ttf-droid

Next, we will proceed to create the personal folders.
In case you have planned to install **GNOME** or **PLASMA KDE**
as a desktop environment, skip this step, since the
**GNOME** or **PLASMA KDE** installation automatically
generates this directories.

- Directory generator installation:

        :::console
        # pacman -S xdg-user-dirs

- Automatic directory creation:

        :::console
        # xdg-user-dirs-update

#### Audio support

Install `pulseadio`

    :::console
    # pacman -S pulseaudio pulseaudio-alsa alsa-utils pavucontrol

Add audio service to default

    :::console
    # rc-update add alsasound default

#### Configure pulseaudio

    :::console
    # sed -e 's/^; autospawn = yes/autospawn = yes/g' -i /etc/pulse/client.conf

### Officially supported desktop environments

#### Install MATE

MATE desktop environment is the continuation of GNOME 2 (Based on Gnome 2).
It provides an intuitive and attractive environment. MATE is actively being
developed to add support for new technologies, while preserving the
traditional desktop experience.

- Installation

        :::console
        # pacman -S mate mate-extra

Where:

+ mate: contains basic desktop environment and applications necessary for the standard MATE experience.
+ mate-extra: contains a set of packages and optional tools, like a screensaver, a calculator,
an editor and other non-problematic applications that go well with the MATE desktop.

#### Install XFCE

Xfce is a lightweight desktop environment for UNIX-like systems.
Its goal is to be fast and use few system resources, while
remaining visually attractive and easy to use.

- Installation

        :::console
        # pacman -S xfce4 xfce4-goodies

Where:

+ xfce4: is basic group of xfce4 packages.
+ xfce4-goodies: is a group of additional packages, such as panel plugins,
notifications and other system tools.

#### Install LXDE

LXDE is a free desktop environment. Abbreviation means
«Lightweight X11 Desktop Environment»

- Installation

        :::console
        # pacman -S lxde

#### Install KDE Plasma

KDE is a software project that currently comprises a
desktop environment known as Plasma, a collection of
libraries and frameworks (KDE Frameworks) and also a
large number of applications (KDE Applications).

The desktop environment created by KDE primarily for GNU/Linux systems,
KDE Plasma 5, is successor to KDE Plasma Workspaces and is primarily
released on July 15, 2014.

- Installation

        :::console
        # pacman -S plasma kde-applications plasma-wayland-session

Where:

+ plasma: contains group of packages to install desktop. with some basic applications and tools.
+ kde-applications: installs all KDE applications contained in group (kcal, amarok, etc).
+ plasma-wayland-session: enable support for Wayland in Plasma.

#### How to start Xenocara?

- Write a `~/.xinitrc` file (option 1)

    Uncomment your desktop installed, example file `~/.xinitrc`:

        :::bash
        #!/bin/sh
        #
        # ~/.xinitrc
        #
        # Executed by startx (run your window manager from here)
        #
        # exec enlightenment_start
        # exec i3
        # exec mate-session
        # exec xmonad
        # exec startlxqt
        # exec startlxde
        # exec awesome
        # exec bspwm
        # exec gnome-session
        # exec gnome-session --session=gnome-classic
        # exec startkde
        exec startxfce4
        # exec startfluxbox
        # exec openbox-session
        # exec cinnamon-session
        # exec pekwm
        # exec catwm
        # exec dwm
        # exec startede
        # exec icewm-session
        # exec jwm
        # exec monsterwm
        # exec notion
        # exec startdde #deepin-session

    Then from a tty, you can run `startx` and your desktop will start.

- Install login manager (option 2)

    Example: `lightdm`

        :::console
        # pacman -S lightdm lightdm-gtk-greeter

    Add to service by default

        :::console
        # rc-update add lightdm default

- Reboot

        :::console
        # reboot

### Tools

#### Disks

- gvfs to mount disks

        :::console
        # pacman -S gamin gvfs

#### Net

- dhcpcd-ui for IP management

        :::console
        # pacman -S dhcpcd-ui

#### Key manager

- gnome-kering

        :::console
        # pacman -S gnome-keyring

#### Volume applet

- Volume icon

        :::console
        # pacman -S volumeicon

#### Synchronize Local Time

Install NTP

    :::console
    # pacman -S ntp

Synchronize Time

    :::console
    # ntpdate -u hora.roa.es

#### File compressors

Normally we come across files compressed in ZIP, RAR and/or another
format that are usually exchanged on the Internet. In many desktop
environments, usually include theirs (File Roller in GNOME, Engrampa
in MATE, Ark in KDE, and XArchiver in XFCE/LXDE). To improve functionality
of these file compressors, we will add support for 7Z, RAR, ZIP and others.

- GZip (known with extension ".tar.gz"):

        :::console
        # pacman -S zlib haskell-zlib

- BZip2:

        :::console
        # pacman -S bzip2

- RAR:

        :::console
        # pacman -S unar

- 7Zip:

        :::console
        # pacman -S p7zip lrzip

- ZIP:

        :::console
        # pacman -S zip libzip unzip

#### Partition detector

- Udisk utility:

        :::console
        # pacman -S udevil autofs

- Reading and writing NTFS file systems:

        :::console
        # pacman -S ntfs-3g

- FAT32 file system read and write:

        :::console
        # pacman -S fatsort exfat-utils dosfstools

- Reading and writing XFS file systems:

        :::console
        # pacman -S xfsprogs

#### Multimedia support
To play multimedia files, you need to be able to have the codecs and player.
To do this, we will proceed to install ffmpeg and gstreamer codecs, in addition
to players.
Here I suggest some players that you may find useful.

- Codecs:

        :::console
        # pacman -S ffmpeg gstreamer gst-libav gst-plugins-bad gst-plugins-good gst-plugins-ugly gst-plugins-base gstreamer-vaapi gst-transcoder ffms2 x264 libvorbis libvpx libtheora opus vorbis-tools

- Audacious player:

        :::console
        # pacman -S audacious

- SMPlayer:

        :::console
        # pacman -S smplayer smplayer-themes smplayer-skins

- VLC player:

        :::console
        # pacman -S vlc

- MPV player:

        :::console
        # pacman -S mpv

- Lightweight image viewer

        :::console
        # pacman -S viewnior

- PDF viewer

        :::console
        # pacman -S epdfview

#### Aplicaciones UXP
There are browsers included by desktop environments like GNOME with Epiphany
or KDE with Konqueror. However, thanks to the developers, in Hyperbola
we have **[Iceweasel-UXP][iceweasel-uxp]{:target='_blank' rel='noopener noreferrer'}**
a web browser, **[Iceape-UXP][iceape-uxp]{:target='_blank' rel='noopener noreferrer'}**
internet suite and a email-manager called
**[Icedove-UXP][icedove-uxp]{:target='_blank' rel='noopener noreferrer'}**.

- Iceweasel-UXP:

        :::console
        # pacman -S iceweasel-uxp

- Iceape-UXP:

        :::console
        # pacman -S iceape-uxp

- Icedove-UXP:

        :::console
        # pacman -S icedove-uxp

#### LibreOffice
In general, when using an Operating System, at least you have an office suite.
In GNU/Linux, it's customary to have one. Fortunately in Hyperbola, Libreoffice
is presented in its stable version. For install, run:

    :::console
    # pacman -S libreoffice-still

##### Spell check
To check spelling you will need hunspell and a hunspell dictionary (such as hunspell-en_US, hunspell-es, etc)

    :::console
    # pacman -S hunspell hunspell-en_US

##### Hyphenation and justification
To have provide rules you also need `hyphen` + a set of rules (hyphen-en, hyphen-de, etc)

    :::console
    # pacman -S hyphen hyphen-en

##### Synonyms
For Synonyms option you will need `mythes` + a mythes synonym library (`mythes-en` `mythes-es`)

    :::console
    # pacman -S mythes mythes-en

#### Security
Security is important when browsing the Internet, that's why Hyperbola provides
a tool called **[firejail][firejail]{:target='_blank' rel='noopener noreferrer'}**
in combination with a graphical interface
**[firetools][firetools]{:target='_blank' rel='noopener noreferrer'}**.

    :::console
    # pacman -S firejail firetools

#### Social
Hyperbola have programs for communication:

- Gajim

        :::console
        # pacman -S gajim python2-axolotl

- Tox
    - qtox:

            :::console
            # pacman -S qtox

    - toxic:

            :::console
            # pacman -S toxic

#### Identifying keycodes

Showkey utility reports key codes for the virtual console. showkey waits
for a key to be pressed and, if there is none for 10 seconds, closes.
To run showkey you need to be in a virtual console, not in a graphical
environment:

    :::console
    # showkey --keycodes

[video-guide]: https://lablibre.tuxfamily.org/hyperbola-gnu-linux-libre-base/
[firejail]: https://github.com/netblue30/firejail
[firetools]: https://l3net.wordpress.com/projects/firejail/#firetools
[usb-boot]: https://wiki.hyperbola.info/doku.php?id=en:guide:beginners#write_the_image_to_your_usb
[cd-boot]: https://wiki.hyperbola.info/doku.php?id=en:guide:beginners#burn_the_image_to_your_optical_disk
[wpa_link]: https://wiki.archlinux.org/index.php/WPA_supplicant
[dhcpcd_link]: https://wiki.archlinux.org/index.php/Dhcpcd
[iceweasel-uxp]: https://wiki.hyperbola.info/iceweasel-uxp
[iceape-uxp]: https://wiki.hyperbola.info/iceape-uxp
[icedove-uxp]: https://wiki.hyperbola.info/icedove-uxp
[xe-conf]: https://fedoraproject.org/wiki/Input_device_configuration#xorg.conf.d
