arch_based - ovigia/distrosnetinstall GitHub Wiki

ARCH BASED DISTROS

ARCH LINUX INSTALAÇÃO

Terminal colors are numbered 0-7, for black, red, green, yellow, blue, magenta, cyan, and white respectively, and 8-15 for the corresponding bold colors.

Instaladores

Instalação via qemu-kvm

criar imagem/filesystem

qemu-img create archlinux.img -f qcow2 10G

converter img qcow2 em vbox vdi

qemu-img convert -O vdi test.qcow2 test.vdi

arrancar iso com hd/archlinux.img - http://www.linux-kvm.org/page/SPICE

kvm -cdrom archlinux.iso -hda archlinux.img -m 512 -boot d -vga std (qxl) -full-screen -name "fbsd"

kvm -cdrom /dev/cdrom -hda archlinux.img -m 512 -boot d

Instalação

  1. boot via archlinux.iso
  2. loadkeys pt-latin9 > teclado português qwerty com ç e @ ; setfont /usr/share/kbd/consolefonts/sun12x22.psfu.gz
  3. ver se temos rede ping -c 3 sapo.pt; ip addr show
  4. configurar a data timedatectl set-ntp true; `
  5. criar o disco virtual de 10G sda com o cfdisk e escolher dos; apenas uma partição / com 9G e 1G de swapp
  6. formatar a partição / e activar a swap
mkfs.ext4 /dev/sdX1

mkswap /dev/sdX2
swapon /dev/sdX2

swapfile

dd if=/dev/zero of=swapfile bs=1M count=512
chmod 600 swapfile
mkswap swapfile
swapon swapfile

vim /etc/fstab

/swapfile  none  swap  sw  0  0  
  1. montar os filesystems
mount /dev/sda1 /mnt
mkdir /mnt/home
mount /dev/sda3 /mnt/home
  1. optimizar mirror.list
pacman -S reflector

reflector -c "Portugal" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirror.list

no vim :%s/Server/#Server/g

pacman -Syy

  1. instalação do sistema

pacstrap -i /mnt base base-devel linux linux-firmware vim nano bash-completion linux-headers

  1. criar o fstab

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

  1. configurar sistema

arch-chroot /mnt

11.1. configurar timezone / fuso horário

ln -sf /usr/share/zoneinfo/Europe/Lisbon /etc/localtime

11.2. configurar relógio

hwclock --systohc --utc

11.3. localização, instalação do idioma

vi /etc/locale.gen

en_GB.UTF-8

locale-gen

11.4. idioma para PT

LANG="pt_PT.UTF-8" > /etc/locale.conf export LANG="pt_PT.UTF-8"

11.5. definição do teclado da consola

echo "KEYMAP=pt-latin9" > /etc/vconsole.conf

11.6. configuração do hostname e hosts

echo Archlinux > /etc/hostname

nano /etc/hosts

127.0.0.1 localhost
::1     localhost
127.0.0.1 Archlinux.localdomain Archlinux

11.7. configuração da rede

pacman -S networkmanager

systemctl enable NetworkManager

no portátil será necessário instalar wpa_supplicant

11.8. initramfs (geralmente não é necessário)

mkinitcpio -p linux

11.9. criação da passwd de root

passwd

11.10. configuração do grub

pacman -S grub
grub-install /dev/sda

vim /etc/default/grub

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

>caso seja necessário por haver outro OS instalado

pacman -S os-prober

11.11. instalar bash-completion

pacman -S bash-completion

11.12. criação da conta normal

useradd -m -g users -G audio,video,network,wheel,storage -s /bin/bash rik

passwd rik

11.13. configurar o sudo

EDITOR=vim visudo

apagar o comentário atrás de

%wheel ALL=(ALL) ALL

ou

%wheel ALL = (ALL) NOPASSWD: ALL

11.14. Enable SSD Trim

https://old.reddit.com/r/archlinux/comments/4x3vzw/the_first_things_you_do_after_installing_arch/d6cl2ak/

sudo systemctl enable fstrim.timer

11.15. configuração da tmpfs

  1. ambiente gráfico

pacman -S pulseaudio pulseaudio-alsa xorg xorg-xinit

como backup, instalar o linux-lts

pacman -S linux-lts

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

pode-se depois remover o kernel anterior

sudo pacman -Rs linux

Your screen resolution may be incorrect. Run xrandr and identify your display. Then run xrandr --output <source_name> --mode 2560x1440 --rate <refresh_rate> For me it is xrandr --output DP1-8 --mode 2560x1440 --rate 59.95. If you have multiple monitors, check out the documentation. The xrandr setting isn't permanent for now, we'll get to that later.

instalar microcódigo

sudo pacman -S intel-ucode
sudo grub-mkconfig -o /boot/grub/grub.cfg`

instalar fontes favoritas

sudo pacman -S ttf-linux-libertine ttf-inconsolata ttf-ubuntu-font-family

yay -S nerd-fonts-complete

instalar windowmanager bspwm e lightdm

sudo pacman bspwm sxhkd compton dmenu

instalar icones e themes

sudo pacman -S lxappearance arandr mate-backgrounds mate-icon-theme-faenza mate-themes

instalar termite e pcmanfm

sudo pacman -S termite pcmanfm sxiv feh vifm

configuração do compton

cp /etc/xdg/compton.conf ~/.config/compton

em vbox e qemu comentar o #vsync = "opengl"

configuração de fontconfig usando github de luke smith

configuração de polybar

yay -S polybar


ligar o dhcp

systemctl enable dhcpcd@placa de rede dada pelo ip a show

PACOTES INSTALADOS

pacman -S \
	\htop
	\neofetch
	\vim
	\spice-vdagent
	\git
	\bash-completion
	\w3m
	\xdg-user-dirs >xdg-user-dirs-update
	\pulseaudio
	\pulseaudio-alsa
	\pavucontrol
	\alsa-utils alsa-plugins alsa-lib alsa-firmware
	\gstreamer
	\gst-plugins-good gst-plugins-bad gst-plugins-base gst-plugins-ugly
	\volumeicon
	\playerctl
	\xorg
	\xorg-xinit
	\bspwm
	\sxhkd
	\xdo
	\rxvt-unicode
	\dmenu
	\compton
	\lxappearance
	\lxrandr
	\pcmanfm
	\mate-backgrounds
	\mate-themes
	\mate-icon-theme-faenza
	\nitrogen
	\feh
	\sxiv
	\firefox >escolhida a família de fontes Ubuntu
	\font-manager
	\mlocate
	\mpv
	\youtube-dl
	\ttf-inconsolata
	\dzen2
	\net-tools
	\xf86-video-qxl
	\asciiquarium
	\toilet
	\cmatrix
	\sl
	\lemonbar-xft-git >via yay, para o panel funcionar
	\intel-ucode
        \p7zip
        \acpi
        \lm_sensors
        \mlocate
        \

INSTALAR O YAY - AUR

git clone https://aur.archlinux.org/yay.git

cd yay

makepkg -si
yay -S compton-conf

\nerd-fonts-complete
\polybar

INSTALAR BSPWM

pacman -S xorg xorg-xinit xterm xdg-user-dirs bspwm sxhkd compton xdo lxappearance rxvt-unicode arandr git

copiar exemplos e chmod u+x

echo "exec bspwm" > ~/.xinitrc

bspc config focus_follows_pointer true

PANEL

ps aux | grep panel
pkill panel
~/.config/panel/panel

xset +fp /path/to/terminus/font
xset fp rehash

FONTS

Some of us hate downloadable web fonts so here's how you can stop websites (including techpowerup) from forcing their glorious fonts down your throat.

sem systemd usando console-setup

CHARMAP="UTF-8"
CODESET="Lat7"
FONTFACE="Terminus"
FONTSIZE="28x14"

~/.Xresources - invoke in ~/.xinitrc with xrdb

If you have installed the fonts into ~/.fonts and issued the command fc-cache -f -v

I call the terminals in a graphical session X terminals, and terminal emulators is my catch-all name for both console and X terminals.

ver as fontes com gucharmap

1) Mozilla Firefox

Open about:config
Set "gfx.downloadable_fonts.enabled" to false.

2) Google Chrome
Right Click Chrome's launcher icon, click "Properties".

At the end of the launcher string add the following:

" --disable-remote-fonts" (without quotes).

Janelas

You can indeed have persistent floating windows in bspwm. They are called sticky windows. You can toggle the sticky flag for a window using bspc node -g sticky.

TERMINAL

! special
*.foreground:   #c5c8c6
*.background:   #1d1f21
*.cursorColor:  #c5c8c6

! black
*.color0:       #282a2e
*.color8:       #373b41

! red
*.color1:       #a54242
*.color9:       #cc6666

! green
*.color2:       #8c9440
*.color10:      #b5bd68

! yellow
*.color3:       #de935f
*.color11:      #f0c674

! blue
*.color4:       #5f819d
*.color12:      #81a2be

! magenta
*.color5:       #85678f
*.color13:      #b294bb

! cyan
*.color6:       #5e8d87
*.color14:      #8abeb7

! white
*.color7:       #707880
*.color15:      #c5c8c6

#### exemplo autostart
(sleep 1s && nitrogen --restore) &
(sleep 3s && conky) &
(sleep 1s && tint2) &
(sleep 1s && nm-applet) &
(sleep 1s && xfce4-power-manager) &
(sleep 1s && clipit) &
(sleep 1s && pnmixer) &

exemplo sxhkd

exemplo bspwmrc

RHEL .Xresources

URxvt*shading: 15
URxvt*scrollBar: false
URxvt*scrollBar_right: false
URxvt*scrollstyle: plain

URxvt.depth:                32
URxvt.loginShell:           true
URxvt.internalBorder:       3
URxvt.lineSpace:            0
URxvt*transparent: true
URxvt.geometry:             90x30
URxvt.keysym.Shift-Control-V: eval:paste_clipboard
URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard

URxvt*saveLines: 25000

urxvt*letterSpace: -1

urxvt*color0:   		#0E160D
urxvt*color1:			#B53A0B
urxvt*color2:			#9D640F
urxvt*color3:			#6E882F
urxvt*color4:			#5F9152
urxvt*color5:			#A39B21
urxvt*color6:			#CEA212
urxvt*color7:			#d8d997
urxvt*color8:			#979769
urxvt*color9:			#B53A0B
urxvt*color10:			#9D640F
urxvt*color11:			#6E882F
urxvt*color12:			#5F9152
urxvt*color13:			#A39B21
urxvt*color14:			#CEA212
urxvt*color15:			#d8d997
urxvt*foreground:       	#aaaaaa
#urxvt*cursorColor:		#5F9152    	
urxvt*font:                     xft:TerminessTTFNerdFontMono:size=12
#urxvt*font 			xft:DroidSansMonoForPowerline:size=12	
#urxvt*font 			xft:DroidSansMono:style=Regular

DICAS

I see that you've used pywal to set a colorscheme in TTY, but do you know what file it's configured in and how?

Try adding this to your .bashrc file.

async apply to terminal emulator
(cat ~/.cache/wal/sequences &)

synchronous alternative
cat ~/.cache/wal/sequences

apply color scheme to TTY
source ~/.cache/wal/colors-tty.sh 
Binary Space Partitioning Window Manager = bspwm

Youtube Video: https://youtu.be/ZbXQUOwcH08

bspwm install

pacman packages:

bspwm
sxhkd
terminus-font
xorg-xset
xorg-xsetroot
dmenu
termite (optional)
rxvt-unicode (urxvt)
trayer (optional)
stalonetray (optional)


AUR packages:
xtitle-git
sutils-git
lemonbar-xft-git

.xinitrc
sxhkd &
exec bspwm

configuration:
mkdir -p .config/bspwm
mkdir .config/sxhkd
cp /usr/share/doc/bspwn/examples/bspwmrc .config/bspwm
cp /usr/share/doc/bspwn/examples/sxkhdrc .config/sxhkd
NOTE: edit sxkhdrc if using termite

cp -R /etc/xdg/termite ~/.config


add to .bashrc
export PANEL_FIFO=/tmp/panel-fifo
export PATH=$PATH:/home/midfingr/Documents/panel
then: source ~/.bashrc

cp -r /usr/share/doc/bspwn/examples/panel /home/midfingr/Documents
add to .config/bspwm/bspwmrc
panel &

startx

dmenu colors
https://github.com/Cesura/dotfiles

mouse cursor
add to .xinitrc
xsetroot -cursor_name left_ptr

XFCE4-TERMINAL

Put the prebuilt *.theme files from colorschemes/ into ~/.local/share/xfce4/terminal/colorschemes/ (create this directory if it does not exist), and the themes will be available under Edit > Preferences... > Colors > Presets

Wallpapers

mostra a configuração do feh

feh --bg-center ~/Pictures/background.jpg

feh --bg-center $(find ~/Pictures/Backgrounds -type f | shuf -n 1)

Reload sxhkd

super + escape | [reload sxhkd configuration]

.profile

First, login to the user account that you want to use to run bspwm. It's usually not root.

If the file ~/.profile doesn't exist yet, create an empty file with the command touch ~/.profile. Open the file using a text editor and add these two lines:

XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME Save the file, and it will take effect the next time you login.

What this does is to set the value of the environment variable XDG_CONFIG_HOME to "$HOME/.config" and make it available to other programs. The value gets stored, but there is no output, so it seems that nothing happens when you run these commands in the console.

But it matters when other programs reference the variable and use its value. In this case, by referencing XDG_CONFIG_HOME, bspwm will be able to know where the configuration file is and read it.

Environment variables can be referenced using $. You may have noticed the $HOME part in XDG_CONFIG_HOME="$HOME/.config". HOME is an environment variable that stores the path to the user's home directory. In this expression $HOME is first replaced by something like /home/username and then /.config is appended. Using $ and the command echo, you can find out the value of XDG_CONFIG_HOME:

echo $XDG_CONFIG_HOME It will produce an output similar to /home/username/.config.

Termite

Pacman comandos

update e instalar pacman -Syyuw >o w faz download mas não instala

fazer busca pacman -Ss ^emacs

remover todas as dependências e ficheiros de config pacman -Rsn

listar os pacotes instalados que foram explicitamente instalados por nós pacman -Qeq >o q retira a versão, só dá o nome dos pacotes

listar programas instalados do AUR pacman -Qm

mostra orfãos pacman -Qdt

remove orfãos sudo pacman -Rns $(pacman -Qtdq)

limpar o cache do Pacman pacman -Sc

/etc/pacman-conf

ILoveCandy

cylon

dmenu

scripts

In order to keep terminals alive I use dtach, which is just the detach feature of screen. In order to make every terminal on my computer detachable I wrote a small wrapper script. This means that even if I had to restart my X server I could keep all my terminals running just fine, both local and remote.

Themes

urxvt

cat .Xresources
URxvt*shading: 15
URxvt*scrollBar: false
URxvt*scrollBar_right: false
URxvt*scrollstyle: plain

URxvt.depth:                32
URxvt.loginShell:           true
URxvt.internalBorder:       3
URxvt.lineSpace:            0
URxvt*transparent:          true
URxvt.geometry:             80x30
URxvt.keysym.Shift-Control-V: eval:paste_clipboard
URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard

URxvt*saveLines: 25000
urxvt*letterSpace: -1

!####
urxvt.perl-ext-common:  default,tabbed,matcher,searchable-scrollback
urxvt*cutchars:         '"()*,<>[]{}|'
urxvt*termName:         rxvt-unicode
urxvt*urlLauncher:     /opt/firefox/firefox 
urxvt*matcher.button:   1
urxvt*keysym.S-Prior:   ^[[5;2~
urxvt*keysym.S-Next:    ^[[6;2~

urxvt*highlightSelection: true
!URxvt*scrollstyle: rxvt

URxvt*colorUL: #86a2be
irt.perl-ext-common: selection-to-clipboard


!######
!colors
!######

urxvt*color0:   		#0E160D
urxvt*color1:			#B53A0B
urxvt*color2:			#9D640F
urxvt*color3:			#6E882F
urxvt*color4:			#5F9152
urxvt*color5:			#A39B21
urxvt*color6:			#CEA212
urxvt*color7:			#d8d997
urxvt*color8:			#979769
urxvt*color9:			#B53A0B
urxvt*color10:			#9D640F
urxvt*color11:			#6E882F
urxvt*color12:			#5F9152
urxvt*color13:			#A39B21
urxvt*color14:			#CEA212
urxvt*color15:			#d8d997
urxvt*foreground:       #aaaaaa
urxvt*cursorColor:		#5F9152    	
urxvt*font:             xft:TerminessTTFNerdFontMono:size=12
!urxvt*font 			xft:DroidSansMonoForPowerline:size=12	
!urxvt*font 			xft:DroidSansMono:style=Regular

![rxvt-unicode for gnome-terminal refugees : Inside 245-5D](http://blog.ezyang.com/2010/01/rxvt-unicode-for-gnome-terminal-refugees/)
!
![urxvt(7) - Linux man page](https://linux.die.net/man/7/urxvt)

vifm

BROWSERS

https://gitlab.com/krathalan/firefox-tweaks/blob/master/user.js

https://github.com/ghacksuserjs/ghacks-user.js/blob/master/user.js

emoji

other

alias cleanup='sudo pacman -Rns $(pacman -Qtdq)'

wipefs -a /dev/sda

sgdisk -Z /dev/sda

delete pacman cache

sudo pacman -Scc

NOVA INSTALAÇÂO - 2020Dez25

arch instalação e config

VirtualBox, VMware and virtual machine users in general:

Make sure you ENABLE the EFI option for the virtual machine in the settings, otherwise you will receive an error when trying to install the boot loader! If you are using QEMU/KVM, you need to load an EFI compatible bios. Hyper-V users should install the xf86-video-fbdev package. More information on Hyper-V - ArchWiki

videos

instalação base

  1. após boot do cd de instalação, mudar a consola para o teclado português e mudar a fonte para ficar mais visível
# loadkeys pt-latin9

# setfont /usr/share/kbd/consolefonts/sun12x22.psfu.gz
  1. testar acesso à rede, caso se use wifi usar o wifi-menu
# ping -c 4 sapo.pt

# ip addr show

NOTE: In the newest Archlinux ISO ( from July 2020 ), the wifi-menu command has been removed. To connect to the WIFI, use the iwctl command instead. Follow these steps:

1.) type the command "iwctl" and press enter ( this will bring you inside the [ iwd ] menu ) 2.) type "device list" and press enter. This will show you the wifi device ( for example wlan0 ) 3.) type "station wlan0 scan" and press enter. 4.) type "station wlan0 get-networks" and press enter. This will list the available wifi networks. 5.) type "station wlan0 connect YOUR-NETWORK-NAME" and press enter. This will ask you for your wifi password. Once you enter the password you will be connected to the internet. 6.) type "exit" to leave the [ iwd ] menu and resume your arch installation.

  1. escolher mirrors do pacman
# pacman -S reflector

# reflector -c "Portugal" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirror.list
# vim /etc/pacman.d/mirrorslist

# pacman -Syy

no vim :%s/Server/#Server/g

  1. configurar disco rigido

criar dirs que se desejem dentro da /mnt/

/mnt/home

lsblk

mount /dev/vda1 /mnt
  1. instalar base system
# pacstrap -i /mnt base base-devel linux linux-firmware vim nano bash-completion linux-headers
  1. criar o fstab
genfstab -U -p /mnt >> /mnt/etc/fstab
  1. configurar sistema
# arch-chroot /mnt
  1. instalar bootloader
pacman -S grub os-prober networkmanager intel-ucode

grub-install /dev/vda

vim /etc/default/grub

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

  1. enable networkmanager
systemctl enable NetworkManager
  1. mudar passwd de root

passwd

  1. sair do ambiente chroot

fazer umount de todas as partições que foram criadas

umount /mnt

  1. reboot

  2. login como root e instalação de restante software

é necessário configurar novamente o loadkeys e setfont

  1. configurar rede
networkctl list

nmtui

nmcli connection show

ping -c 4 sapo.pt
  1. hostname, timedate, locale, swap file
vim /etc/hostname

vim /etc/hosts

	127.0.0.1	localhost
	127.0.0.1	flatearth

timedatectl set-timezone Europe/Lisbon

mesmo que

ln -sf /usr/share/zoneinfo/Europe/Lisbon /etc/localtime

timedatectl set-ntp true

timedatectl status

vim /etc/locale.gen

escolher o que se necessita

	en_GB.UTF-8
	pt_PT.UTF-8

locale-gen

vim /etc/locale.conf

	LANG=pt_PT.UTF-8

locale-gen

cd /

touch swapfile

dd if=/dev/zero of=swapfile bs=1M count=1000

chmod 600 swapfile

mkswap swapfile

swapon swapfile

free -m

vim /etc/fstab

	/swapfile	none	swap	sw	0	0
  1. reboot

  2. mudar os ficheiros do skel

cd /etc/skel

vim .bashrc
	
	export EDITOR=vim
	
	alias grep='grep --color=auto'
	alias egrep='egrep --color=auto'
	alias fgrep='fgrep --color=auto'

	[ ! -e ~/.dircolors ] && eval $(dircolors -p > ~/.dircolors)
	[ -e /bin/dircolors ] && eval $(dircolors -b ~/.dircolors)

cp -a . ~

ls -la /root

exit

ls -lastr /

grep root /etc/passwd
  1. criação de conta de utilizador
useradd --create-home rik

passwd rik

usermod -aG wheel,users,storage,power,lp,adm,optical rik

id rik / groups rik

visudo

	remover o comentário em 
	%wheel ALL = (ALL) NOPASSWD: ALL
	
  1. instalação do ambiente gráfico
pacman -S xorg xorg-xinit xorg-twm xorg-oclock

pacman -S ttf-linux-libertine ttf-inconsolata ttf-ubuntu-font-family ttf-font-awesome otf-font-awesome

19.1 modificar a forma como as fontes são definidas

cd /etc/fonts/conf.d

ls
ls ../conf.avail/

ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d
	11-lcdfilter-default.conf
	70-no-bitmaps.conf
	
vim /etc/profile.d/freetype2.sh

	descomentar a linha #export
  1. instalar drivers da placa gráfica
lspci 

	**intel**
	xf86-video-intel libgl mesa vulkan-intel
	
	**amd**
	mesa xf86-video-amdgpu vulkan-radeon
	
	**nvidia**
	nvidia nvidia-settings nvidia-utils mesa
	
	**VBox**
	virtualbox-guest-utils 
	virtualbox-guest-dkms (LTS kernel older than 5.6)
	mesa mesa-libgl
  1. exemplo para gnome
pacman -S gnome gnome-extra gdm

systemctl enable gdm
  1. caso haja erros nos mirrors e downloads falhados

remover o cache

pacman -Scc

pacman -Syy (deve-se fazer sempre antes de instalar software)
  1. reboot

  2. instalar software com o AUR

vim /etc/pacman.conf

	descomentar o #Color

mkdir AUR
cd AUR	
git clone package.git

cd package

makepkg -si

dar cores cpu

vim /etc/makepkg.conf

descomentar e substituir o "2" do MAKEFALGS="j$(nproc)"
  1. adicionar outros repos

são adicionados ao /etc/makepkg.conf

  1. comandos pacman
pacman -Ss - search

pacman -Si - info

pacman -Q - query local

pacman -Q(is) package

pacman -Q|wc -l - número de pacotes instalados

pacman --help

pacman -R package - remove pacote sem dependências

pacman -Rs package - remove tudo, tipo apt purge

pacman -Qtdq - procura pacotes que já não são necessários

pacman -Rs $(pacman -Qtdq) - remove os pacotes acima

pacman -Syu - upgrade

yay -Ps

yay -Yc mesmo que o remove os pacotes desnecessários

  1. limpar sistema
du -sh /var/cache/pacman

sudo pacman -Scc
	yay -Scc
	
journalctl -b ou -xe

du -sh /var/log/journal/	

sudo journalctl --rotate

sudo journalctl --vacuum-time=1s

sudo vim /etc/systemd/journald.conf
	SystemMaxUse=500M
	
sudo systemctl restart systemd-journald
sudo systemctl status systemd-journald
  1. optimizar os SSD / trim
sudo systemctl enable fstrim.time fstrim.service

sudo systemctl start fstrim.time fstrim.service

sudo systemctl status fstrim.time fstrim.service

ou manualmente

sudo fstrim -av