ARCH ~ Update ( installation I - II - III )steemCreated with Sketch.

in #linux5 years ago (edited)

ARCH LINUX

Published with SteemPeak

$ ./configure
$ make
# make install

ScreenshotScreenshot by Willi Glenz

SUMMARY

    ARCH LINUX ~ A ROLLING RELEASE OPERATING SYSTEM 

002 download                                        v3 19-06
021 installation I   ( virtualbox  )                v7 19-06 new
003 installation II  ( lvm - crypt )                v2 19-06 update
015 installation III ( gnome       )                v2 19-06 update

001 first step                                      v3 19-05
019 documentation                                   v1 19-06
004 network                                         v2 19-05 
005 user                                            v2 19-05 
006 sudo                                            v1 19-05
007 packages                                        v3 19-06
009 system-clock                                    v1 19-06 
018 systemd                                         v1 19-06
008 ntp                                             v2 19-06
011 dhcp                                            v1 19-06
010 vim                                             v1 19-06
013 taskwarrior                                     v1 19-06
016 cowsay                                          v1 19-06
020 inxi                                            v1 19-06
017 host                                            v1 19-06

014 swap ............. troubleshooting ............ vi 19-06
012 ~/.bashrc ........ files ...................... v1 19-06

#021

021 INSTALLATION I ( VIRTUALBOX )
01. VIRTUALBOX

 VDI        : 2TB
 Network    : Bridged Adapter

02. SIGNATURE

 $ gpg \
   --keyserver-options auto-key-retrieve 
   --verify archlinux-version-x86_64.iso.sig

03. KEYBOARD

 # ls /usr/share/kbd/keymaps/**/*.map.gz | less
 # loadkeys de-latin1                               

04. CONNECTIVITY

 # ip a 
 # ping archlinux.org   

05. SYSTEM CLOCK

 # timedatectl status   
 # timedatectl set-ntp true 
 # timedatectl list-timezones   
 # timedatectl set-timezone Europe/Berlin
 # timedatectl status               

06. DISK

 # fdisk -l     
 # fdisk /dev/sda       
 > F                    
 > o                
 > p            
 > n ... p ... 1 ... +64G
 > n ... p ... 2 ... rest       
 > p
 > w                    
 # fdisk -l     
 # mkfs.ext4 /dev/sda1  
 # mkfs.ext4 /dev/sda2
 # mkdir /mnt/home  
 # mount /dev/sda1 /mnt
 # mount /dev/sda2 /mnt/home    
 # mount | grep sda
                    
07. BASE PACKAGES

 # pacstrap -i /mnt base    

08. SYSTEM CONFIGURATION

 # genfstab -U -p /mnt >> /mnt/etc/fstab
 # cat /mnt/etc/fstab
 # arch-chroot /mnt             

 BASE
 # pacman -S grub-bios linux-headers base-devel \
   network-manager-applet wireless_tools wpa_supplicant \
   xorg-server mesa

 VIRTUALBOX
 # pacman - S virtualbox-guest-utils virtualbox-guest-modules-arch 
                   
 TOOLS
 # pacman - S mtr zsh fish screen vim htop glances vit youtube-dl \
   atop ranger

SERVICES
 # pacman - S openssh networkmanager ntp

 # ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime  
 # hwclock --systohc            
 # timedatectl status
 # vi /etc/locale.gen                               : de_DE.UTF-8
 # locale-gen       
 # vi /etc/locale.conf                              : LANG=de_DE.UTF-8
 # vi /etc/vconsole.conf                            : KEYMAP=de-latin1
 # vi /etc/hostname                                 : mars
 # vi /etc/hosts                
    127.0.0.1   localhost
    ::1         localhost
    127.0.1.1   mars.linux.local mars
 # passwd       
 # mkinitcpio -p linux

09. BOOTLOADER INSTALLATION

 # grub-install --target=i386-pc --recheck /dev/sda 
 # cp /usr/share/locale/de/LC_MESSAGES/grub.mo /boot/grub/locale/de.mo
 # grub-mkconfig -o /boot/grub/grub.cfg

10. SWAP-FILE

 # fallocate -l 1G /swapfile
 # chmod 600 /swapfile  
 # mkswap /swapfile 
 # echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab)
 # cat /etc/fstab

11. REBOOT

 # exit 
 # umount -R /mnt
 # shutdown -h now

Remove iso-file and start den virtual machine.


020 INXI
$ sudo pacman -S git
$ git clone https://aur.archives.org/yay.git
$ cd yay
$ makepkg -si
$ yay -Syu

$ inxi --recommends | less


019 DOCUMENTATION
Wiki            : wiki.archlinux.org


018 SYSTEMD
# systemctl list-units
# journalctl -b
# journalctl -f
# journalctl -fu ntpd

# systemctl status|enable|start|stop|restart ntpd


017 HOST
IP-Address .................... $ hostname -i
Runtime and load .............. $ watch uptime
Last reboot history ........... $ last reboot
System information I .......... # inxi -v7
System information II ......... # inxi -v7 -c0 | tee system.txt
Hostname I .................... $ hostname; hostname -f; hostname -d
Hostname II ................... $ cat /etc/hostname; hostnamectl; uname --nodename
Hostname III .................. $ cat /proc/sys/kernel/hostname
Hostname IV ................... # hostname mars
Prelogin message .............. $ cat /etc/issue
Shell ......................... $ echo $0
Operating system .............. $ cat /etc/os-release; lsb_release -a; uname --operating-system
Kernel ........................ $ uname -a
Kernel name ................... $ uname --kernel-name
Kernel release ................ $ uname --kernel-release
Kernel version ................ $ uname --kernel-version
Kernel ring buffer I .......... # dmesg | less
Kernel ring buffer II ......... # dmesg | tail -n 25
Rootkit scanner ............... # chkrootkit
System log I .................. # logwatch | less
System log II ................. # tail -f /var/log/syslog
Systemd journal ............... # journalctl
CPU Model ..................... $ cat /proc/cpuinfo
Memory ........................ $ watch free -h
Physical Memory ............... $ grep MemTotal /proc/meminfo 
MEM Info ...................... $ cat /proc/meminfo
Processes I ................... $ ps auxw | sort | less
Processes II .................. $ atop
Processes III ................. $ htop
Processes IV .................. $ top
Processes V ................... $ glances
Disk I ........................ # lshw -short -class disk
File System Hierarchy (FHS) ... $ man hier
Disk II ....................... $ df -hT
Disk III ...................... # e4defrag /home -c
Disk IV ....................... # du -hs /home/userxyz
Disk V ........................ # du -h --max-depth=1 /home/userxyz | sort -n
Disk VI ....................... # du -h --max-depth=1 / 2>/dev/null | sort -n
Volumes ....................... # lshw -short -class volume
USB ........................... # usbview; lsusb
Documentation ................. $ man -k . | less


016 COWSAY
$ sudo pacman -S cowsay neofetch

$ cp ~/.bashrc ~/.bashrc_old
$ echo 'clear' >> ~/.bashrc
$ echo 'echo' >> ~/.bashrc
$ echo 'neofetch' >> ~/.bashrc
$ echo 'cowsay -W 80 -f moose $(cat ~/.oneliner.txt | shuf -n1)' >> ~/.bashrc
$ echo 'echo'
$ . ~/.bashrc

$ vim ~/.oneliner.txt
  # bash -c "sync; echo 3 > /proc/sys/vm/drop_caches"
  # find / -uid 1000 -exec chown -v 1002:1002 {} \;
  # find / -user userxyz -type f -exec rm -f {} \;
  # find /home -user userxyz -mtime -3
  # find /home -user userxyz -size +1G
  # mkdir -p /mnt/ram; mount -t tmpfs tmpfs /mnt/ram -o size=8192M
  $ alias ea='vim ~/.bash_aliases && source ~/.bash_aliases'
  $ cat /etc/passwd | cut -d: -f7 | sort | uniq -c | sort -nr
  $ cat /etc/shells
  $ curl cheat.sh/:list | less
  $ curl wttr.in
  $ echo "It is now $(date +%T) on $(date +%A)"
  $ find -size +100M | less
  $ find -size +1G | less
  $ find . -name "*.jpg" -exec convert {} -scale 50% +repage {} \;
  $ find /etc -type f -print 2> /dev/null | less
  $ find /etc/*tab -type f -print
  $ find ~ -maxdepth 1 -type f -exec grep "^alias " '{}' \; -print
  $ find ~ -maxdepth 1 -type f -exec grep "^alias " '{}' \; -print
  $ find ~ -maxdepth 1 -type f -mtime 3
  $ mkdir -p Backups/{Sales,Development,HR}/{Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}/{Sun,Mon,Tue,Wed,Thu,Fri,Sat}
  $ mkdir -p dummy/{1..100}/{1..100}
  $ mount | column -t
  $ mpg123 -zvC /home/user/music/*
  $ ranger ~/.local/share/Trash/
  $ scp -r folder/ [email protected]:~
  $ scp dummy.txt [email protected]:~
  $ sudo -H pip install --upgrade youtube-dl
  $ watch -d -n 5 ls -l
  $ watch free -h
  $ watch mail
:%sort
:wq


015 GNOME 
# pacman -S gdm gnome gnome-extra gnome-tweak-tool gnome-terminal
# pacman -S nautilus eog file-roller gedit gnome-control-center gnome-music \
            gnome-power-manager gnome-shell gnome-shell-extensions \
            gnome-system-monitor 
    
# systemctl enable vboxservice.service
# systemctl start vboxservice.service
# systemctl enable gdm.service
# systemctl start gdm.service


014 SWAP
CHECK

 $ free -h
 $ top | htop | atop | glances
 $ vmstat -w
 $ cat /proc/swaps
 # fdisk -l
 $ cat /proc/sys/vm/swappiness 

TROUBLESHOOTING

 # swapon -s
 # dd if=/dev/zero of=/swap_tmp bs=1024 count=1000000
 # ls -lh /tmp
 # chmod 600 /swap_tmp
 # mkswap /swap_tmp
 # swapon /swap_tmp
 # swapon -s
 # echo 100 > /proc/sys/vm/swappiness


013 TASKWARRIOR 
# pacman -Ss taskwarrior
# pacman -S vit
$ vim ~/.taskrc

$ task
$ task add project:Phoenix Task1
$ task add project:Running Task2
$ task
$ task 1 edit
$ task 1 modify priority:H
$ task 1 modify due:eow
$ task 1 modify due:eom
$ task 1 modify project:Java
$ task 1 start
$ task 1 stop
$ task 1 information
$ task calc now + 21d
$ task calendar 2019
$ task
$ task 1 done
$ task 2 delete
$ task
$ task burndown.daily; task burndown.weekly; task burndown.monthly
$ alias t='clear; task'
$ alias tt='clear; task burndown.daily'
Homepage            taskwarrior.org
Documentation       taskwarrior.org/docs
Tutorial            taskwarrior.org/docs/30second.html


012 BASHRC
$ vim ~/.bashrc
  HISTCONTROL=ignoreboth:erasedups
  alias a='clear; echo; alias; echo'
  alias c='clear; echo'
  alias cd='clear; echo; \cd; df -hT; echo; lsd -l; echo'
  alias fd='clear; echo; sudo fdisk -l; echo'
  alias h='clear; echo; history 30; echo'
  alias u='clear; echo; pacman -Suyy; echo'
:wq

$ . ~/.bashrc


011 DHCP
# dhcpcd
# systemctl status dhcpcd
# systemctl start dhcpcd
# systemctl enable dhcpcd
# reboot
# systemctl status dhcpcd
wiki.archlinux.org/index.php/Dhcpcd


010 VIM 
# pacman -S vim

h j k l ................... character .......... left, down, up, right 
b ge w e .................. word ......................... back, right
0 ^ gm $ .................. sentence .............. start, middle, end
( ) ....................... sentence .................. next, previous
{ } ....................... paragraph ................. next, previous
H M L ..................... window ................. high, middle, low
gg G ...................... document ................ first, last line
% ......................... brace, bracket, comment ............. next
Homepage    : vim.org
Reference   : vimhelp.org/quickref.txt.html


009 SYSTEM-CLOCK
 # timedatectl status
 # timedatectl set-ntp true
 # timedatectl list-timezones
 # timedatectl set-timezone Europe/Berlin
 # timedatectl status


008 NTP 
# pacman -S ntp
# systemctl status ntpd
# systemctl enable ntp
# systemctl status ntpd
# journalctl -b
# journalctl -fu ntp

ntp.org


007 PACKAGES 
$ cat /etc/pacman.d/mirrorlist | less

##
## Arch Linux repository mirrorlist
## Filtered by mirror score from mirror status page
## Generated on 2019-06-07
##
## Germany
Server = http://mirrors.niyawe.de/archlinux/$repo/os/$arch
Server = http://ftp.gwdg.de/pub/linux/archlinux/$repo/os/$arch
Server = http://archlinux.thaller.ws/$repo/os/$arch
Server = https://dist-mirror.fem.tu-ilmenau.de/archlinux/$repo/os/$arch
Server = http://mirror.metalgamer.eu/archlinux/$repo/os/$arch

$ sudo pacman -S vim screen tmux                : install a package
$ sudo pacman -Suyy                             : update packages
$ sudo pacman -Syy                              : refresh package database 
$ sudo pacman -R tmux                           : remove a package
$ sudo pacman -Ss docker                        : search for a package
$ pacman -Sl | grep -i vim | less               : search for vim

$ pacman -Q | awk '{print $1}' > packages.txt   : installed packages
$ pacman -Qg | awk '{print $1}' > packages.txt  : group packages
$ pacman -Qe | awk '{print $1}' > packages.txt
$ pacman -Qet | awk '{print $1}' > packages.txt
Pacman Homepage             : archlinux.org/pacman/
Pacman Mirrorlist Generator : archlinux.org/mirrorlist/
Manpages                    $ man pacman


006 SUDO 
# pacman -S sudo

# visudo
> %wheel ALL=(ALL) NOPASSWD: ALL
:wq

# usermod -aG whell user1
# logout


005 USER
# useradd -m user1
# passwd user1

# useradd -m dummy
# passwd dummy

# cat /etc/passwd
# userdel -r dummy


004 NETWORK
TEST

 # ip a
 # systemctl status NetworkManager

ACTIVATE NETWORKMANAGER

 # systemctl start NetworkManager
 # systemctl enable NetworkManager
 # systemctl status NetworkManager
 # reboot

TEST

 # ping www.archlinux.org
wiki.archlinux.org/index.php/Network_configuration#Network_interfaces


003 INSTALLATION II ( LVM - CRYPT )
01. DOWNLOAD

 : archlinux.org/download/
 $ gpg --keyserver-options auto-key-retrieve --verify archlinux-version-x86_64.iso.sig

02. KEYBOARD

 # ls /usr/share/kbd/keymaps/**/*.map.gz | less
 # loadkeys de-latin1                               

03. CONNECTIVITY

 # wifi-menu
 # ip a 
 # ping archlinux.org   

04. DISKS

 # lsblk
 # fdisk -l
 # fdisk /dev/sdb               ( USB-Stick )
 > F                            ( list free unpartioned space )
 > p                            ( print the partion table )
 > g                            ( GPT partion table )
 > p                            ( print the partion table )
 > n ... 1 ... +300M 
 > n ... 2 ... +400M
 > n ... 3 ... (rest)
 > t ... 3 ... 31 (LV)
 > p                            ( print the partion table )
 > w                    
 # fdisk -l     
 # lsblk
 # mkfs.fat -F32 /dev/sdb1
 # mkfs.ext4 /dev/sdb2
 # cryptsetup luksFormat /dev/sdb3
 # cryptsetup open --type=luks /dev/sdb3 lvm
 # pvcreate --dataalignment 1m /dev/mapper/lvm
 # vgcreate volgroup0 /dev/mapper/lvm 
 # lvcreate -L 30GB volgroup0 -n lv_root
 # lvcreate -L 20GB volgroup0 -n lv_home 
 # modprobe dm_mod
 # vgscan
 # vgchange -ay
 # mkfs.ext4 /dev/volgroup0/lv_root
 # mount /dev/volgroup0/lv_root /mnt
 # mkdir /mnt/boot
 # mount /dev/sdb2 /mnt/boot
 # clear; mount; lsblk
 # mkfs.ext4 /dev/volgroup0/lv_home
 # mkdir /mnt/home
 # mount /dev/volgroup0/lv_home /mnt/home
 # clear; mount; lsblk
 # mkdir /mnt/etc
 # genfstab -U -p /mnt >> /mnt/etc/fstab
 # cat /mnt/etc/fstab
    
05. BASE-PACKAGES

 # pacstrap -i /mnt base    
 # arch-chroot /mnt             

 # pacman -S base-devel grub efibootmgr dosfstools os-prober mtools linux-headers \
   wpa_supplicant xorg-server mesa
 # pacman -S linux-lts linux-lts-headers
 # pacman -S networkmanager wireless_tools wpa_supplicant openssh ntp
 # pacman -S mtr zsh fish screen vim htop glances vit youtube-dl atop ranger
 # pacman -S virtualbox-guest-utils virtualbox-guest-modules-arch 
 # pacman -S sudo

 # systemctl enable NetworkManager

 # vim /etc/mkinitcpio.conf 
 > HOOKS=(base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck)
 :wq
 # mkinitcpio -p linux
 # mkinitcpio -p linux-lts

 # ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime  
 # hwclock --systohc            
 # timedatectl status
 # vi /etc/locale.gen                               : de_DE.UTF-8
 # locale-gen       
 # vim /etc/locale.conf                             : LANG=de_DE.UTF-8
 # vim /etc/vconsole.conf                           : KEYMAP=de-latin1
 # vim /etc/hostname                                    : mars
 # vim /etc/hosts               
    127.0.0.1   localhost
    ::1         localhost
    127.0.1.1   mars.linux.local mars
 # passwd       

06. USER

 # useradd -m -g users -G wheel user1
 # passwd user1

 # EDITOR=vim visudo
 > %wheel ALL=(ALL) ALL
 :wq

07. SYSTEM CLOCK

 # timedatectl status   
 # timedatectl set-ntp true 
 # timedatectl list-timezones   
 # timedatectl set-timezone Europe/Berlin
 # timedatectl status               

08. BOOTLOADER INSTALLATION

 # vim /etc/default/grub
 > GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=/dev/sdb3:volgroup0:allow-discards quiet"
 > GRUB_ENABLE_CRYPTODISK=y
 :wq
 
 # mkdir /boot/EFI
 # mount /dev/sdb1/boot/EFI
 # grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck
 # cp /usr/share/locale/de/LC_MESSAGES/grub.mo /boot/grub/locale/de.mo
 # grub-mkconfig -o /boot/grub/grub.cfg

09. SWAP-FILE

 # fallocate -l 1G /swapfile
 # mkswap /swapfile 
 # chmod 600 /swapfile  
 # echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab
 # cat /etc/fstab
 # mount -a

10. EXIT 

 # exit 
 # umount -R /mnt
 # umount -a
 # shutdown -h now
Virtualbox          : virtualbox.org/manual/ch06.html#network_bridged
Installation Guide  : wiki.archlinux.org/index.php/Installation_guide
Etcher              : balena.io/etcher/
pacstrap            : git.archlinux.org/arch-install-scripts.git/tree/pacstrap.in


002 DOWNLOAD 
Current Release     : 2019.05.02
Included Kernel     : 5.0.10
ISO Size            : 609.0 MB
Installation Guide  : wiki.archlinux.org/index.php/Installation_guide
Torrent             : archlinux.org/releng/releases/2019.05.02/torrent/
ISO                 : ftp.hosteurope.de/mirror/ftp.archlinux.org/iso/2019.05.02/
Download        : archlinux.org/download/
Virtualbox      # apt install virtualbox


001 FIRST STEP
"Every new beginning comes from some other beginning's end." 
                                                Seneca
DistroWatch     : distrowatch.com/table.php?distribution=Arch
Homepage        : archlinux.org
Sort:  

This post had received 5.00% upvote from @steemitportugal account!
Vote for @steemitportugal to Witness. Your vote is very important to us!
Visit our WebSite www.steemitportugal.com (tutorials,news...)
Thank you very much.
Click here to vote
steemitportugal
Delegation for daily voting: 10SP-25SP-50SP-100SP-250SP-500SP-1000SP

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 62952.72
ETH 2429.38
USDT 1.00
SBD 2.56