Monday, February 22, 2016

Arch Linux


Linux Mint is my go to distribution for Linux. It simply works out of the box and is less likely to break as time goes on if you stay reasonably withing the Mint repositories.

I have always been tempted to build an Arch distribution from scratch and finally got around to it - well, sort of. In Virtualbox I got almost through the "from scratch" process and ran into a couple questions on the Grub install. I had to leave the machine and was not able to get it back up to finish the setup. The best guide currently is here. Forget the "Beginner" section on the Arch site. It simply is not helpful unless you already know the terminal commands. If I had been using the 3rd party guide, I would have had my questions answered on the original install.

So I took the next route with Architect Linux installer. It basically takes you through the steps of Arch setup and automates the terminal commands in answer to questions. Purist Arch people would hate it but once you go through a "from scratch" you know basic procedures. Torturing yourself further is no advantage.

The Architect Linux installer worked very well. The one place that needs caution is the "refresh pacman keys". This takes forever and the terminal sits forever. You must wait for the update to complete or you will have problems with future installs. There may be a way to update the keys after install but I don't know what it is. Currently here is the best guide for Architect Linux installer.

My Architect Linux install worked very well and I started tweaking this and that. Then I questioned why I would keep spending time trying to get this scratch install look and act like Manjaro. Why not just install Manjaro Xfce and go on with life? But I did learn a few things by doing the from scratch install so all was not wasted.

After install this is helpful:

Install yaourt on Arch Linux
sudo mousepad /etc/pacman.conf
add this to the end of the file:
[archlinuxfr]
 SigLevel = Never
 Server = http://repo.archlinux.fr/$arch

 Save the file and then open terminal and enter:
sudo pacman -Sy yaourt
sudo pacman-db-upgrade && sudo pacman-optimize && sync

Good video on tweaking Xfce (4 of them)

Stuff
Remove program, dependencies and settings
 sudo pacman -Rns (program name)
Install Pamac sudo yaourt pamac (many installs and y/n entries)
Engrapa archive manager seems not to work
sudo pacman -S gtk-theme-config (good theme tweaker)
sudo pacman -S leafpad (actually mousepad works to edit in root anyway)

Here are my notes for scratch install: (works but not desktop yet) yaourt installed but not work

Install Arch to virtual drive
We will be making and using one disk.
The disk will be sda
The single partition will be sda1
$ ping google.com
cntl+z
$ dhcpcd (write down the adapter name)emp0s3
$ fdisk -l (to see the existing partitions)
 (you can pipe |less to scroll up/down)
use cfdisk (to partition)(by far easiest)
 choose "dos"
 remember to set root partition to "boot"
 quit
$ fdisk -l (again to check)
$ mkfs.ext4 /dev/sda1
$ mount /dev/sda1 /mnt 
(Arch install will make the directories)
$ nano /etc/pacman.d/mirrorlist 
(move first US to top for fastest but not necessary)
 hit Alt+6 to copy the line
 hit Ctrl+U to paste
$ pacstrap /mnt base base-devel
 (this installs Arch)
 you may wish to add grub (xorg-server xorg-server.utils xorg-apps alsa-utils git terminator)
 if need wifi
 (dialog wpa-supplicant)
$ genfstab -U -p /mnt >> /mnt/etc/fstab
 (this tells Arch where to mount and boot)
$ nano /mnt/etc/fstab (check for drive)
$ cat /mnt/etc/fstab
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /          ext4       rw,relatime,data=ordered 0 1
$ arch-chroot /mnt /bin/bash
nano /etc/locale.gen
uncomment the following lines (maybe pick both)
 # en_US.UTF-8 UTF-8
 # en_US ISO-8859-1
$ locale-gen
$ echo LANG=en_US.UTF-8 > /etc/locale.conf
$ export LANG=en_US.UTF-8
$ ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime
$ hwclock --systohc --utc
find computer hostname by $ hostname
(I'm not where to set the computer name originally)
$ echo (computer name) > /etc/hostname
$ nano /etc/hostname (see if it made it)
may need to edit /etc/hosts ???
$ passwd (for root)
$ useradd -mg users -G wheel,storage,power -s /bin/bash (your_new_user)
$ passwd (your_new_us)
$ pacman -S sudo
$ nano /etc/sudoers
then do the following
(# uncomment to allow members of group wheel to execute any command
wheel ALL (ALL) ALL
cp /etc/netctl/examples/ethernet-dhcp /etc/netctl/my_network (change the adapter to yours from the ip output) emp0s3
netctl enable my_network
pacman -S grub (if not installed in beginning)
grub-install /dev/sda
 if block error do --force /dev/das
$ mkinitcpio -p linux
$  grub-mkconfig -o /boot/grub/grub.cfg
$ systemctl enable dhcpcd
exit
umount /mnt
shutdown -P -h now
or reboot
$ pacman -Syy
You should shutdown the virtual machine and take a snapshot.
***This painful experience should get up a working Arch system***
****Now for installing a GUI***
$ sudo pacman -Syu
$ sudo pacman -S xorg-server xorg-server-utils
$ sudo pacman -S gnome gdm
$ sudo pacman -S open-vm-tools
***below not work but gets black screen when enable and start gdm.service 
$ sudo systemctl enable gdm.service
$ sudo systemctl start gdm.service
gdm.service will not start

Curl, Wget, Winget & Powershell Install or Download Commands

After the mess I made in previous posts this summary might be useful.     Thanks PatchMyPC, the great and powerful program downloader and up...