DEV Community

Cover image for Build your own system with ArchLinux

Build your own system with ArchLinux

Samuel-Zacharie FAURE on July 11, 2020

Original of this post on my blog. I wrote a comment on dev.to recently that gathered quite some attention; It was about my custom Arch system. I f...
Collapse
 
tateronaut profile image
tate shepherd

This an excellent article. I'm a very novice linux user, and always considered ArchLinux way too time consuming and sort of like "whats the point?"... But you make it look fun and appealing! I think your synth-wave looking UI is beautiful!

Collapse
 
gwutama profile image
Galuh Utama

Real men use Gentoo and build it from stage 1.

Collapse
 
freezmeinster profile image
Bramandityo Prabowo

Real man use three pedals and Slackware :D

Collapse
 
danielkun profile image
Daniel Albuschat

You mean Linux from scratch?

Collapse
 
samuelfaure profile image
Samuel-Zacharie FAURE

My social life took a big enough toll from Arch :D

Collapse
 
johnfajardo profile image
John Fajardo • Edited

Shameless plug: I wrote a similar series about Arch. Part 1 is an intro, part 2 is a very opinionated walk through the installation process and part 3 is common post-install stuff, check it out if you want to try Arch but are intimidated by the wiki!

Collapse
 
navarroaxel profile image
Axel Navarro

I can't even think about go back to Ubuntu, I love the flexibility of Arch and the decision that what I want to install and what not.
I use KDE Plasma, is light and I enjoy my UX. I don't like Gnome.
It's so easy to create, and install your own packages using pacman (or aurman, yay, etc.) like your own widgets/plasmoids.
Or even, I fixed an annoying bug in the built-in Konsole package, including a fix in my package build process using the patch command, building it from source, and is so easy. Because I based all of this in the PKGBUILD of the offical repositories and AUR.
Also I can switch between the latest commit in Konsole and the latest stable version with a low effort.

Collapse
 
pgronkievitz profile image
Patryk Gronkiewicz • Edited

Why Arch Linux ?

AUR, EOT

Collapse
 
davidtcharris profile image
David T. Harris

I've been using Arch for years and am not familiar with EOT. The only thing I could find when searching for this was
aur.archlinux.org/packages/eot-uti...
and as something you use in a heredoc instead of EOF ( end of file ) which I also don't understand. End of ___ ?

What is EOT?

Collapse
 
pgronkievitz profile image
Patryk Gronkiewicz

End of thread

Thread Thread
 
davidtcharris profile image
David T. Harris

Ah gotcha. Thanks!

Collapse
 
psiho profile image
Mirko Vukušić

Ah, so long on my list to do this. But time is a luxury, and I'm also scared to fall into that rabbithole of endless tweaking (mental issue as someone said, not Arch problem). Mint serves me so well for years, it's hard to leave.

Collapse
 
psiho profile image
Mirko Vukušić

Update... Thank you for "wasting" last two days for me :) Accidentally I deleted my Mint root partition so it seemed a perfect timing to install Arch. Actually installation was a breeze. Configuring it (still) as much fun as I thought it will be. Installed both Cinnamon and i3, side by side, to test tiling WMs (really like i3 so far).

Only problem I see right now are AURs. Some stuff I'm used to is not available for pacman. And manual AUR installs for many is a nightmare with huge dependency trees. So far I'm avoiding those, but am afraid if I will be forced to do it in the future. AUR helpers seem great but not sure that's the point of Arch. I need to carefully check what I'm installing anyway, then upgrade process is different. Not sure. Still keeping Mint partition for emmergencies :)

Collapse
 
samuelfaure profile image
Samuel-Zacharie FAURE

"Yay" is a great package manager !

Collapse
 
tomfern profile image
Tomas Fernandez

I love Arch, I went the full custom DE route some years ago, I loved i3 to death. But in the end, it just took too much time to maintain and switched to KDE, and now everything works out of the box.

Collapse
 
samuelfaure profile image
Samuel-Zacharie FAURE

I don't understand what there is to maintain, actually ? Once my configuration was done I never needed to touch it again ?

Collapse
 
zejnilovic profile image
Saša Zejnilović

I think I can answer from my experience. It isn't that there is something to maintain, it is a mindset (mental illness) that you are never done, you always have to tinker, etc.

I had this problem with my Linux installations. Always thinking about ways to upgrade /update something that has no need for them.

Collapse
 
tomfern profile image
Tomas Fernandez

Software is never still. Things change. One day, PulseAudio stops working. Another, the automount/udev script doesn't pick up a flashdrive any longer. There's always some little thing that needs attention, and attention is a scarse resource this these days.

Thread Thread
 
samuelfaure profile image
Samuel-Zacharie FAURE

This is true, but I noticed those issues :

1/ can happen on just any system;
2/ have been dramatically decreasing the longer I use Arch

I remember a lot of issues like this happening in my first 6 months of Arch, but today I'm unable to remember when or what was my last problem !

Collapse
 
scardracs profile image
ScardracS

Actually, if someone wants to try arch so bad but feared about commands line, he can zen installer. It's a graphical installer for arch Linux

Collapse
 
romaixn profile image
Romain

Great article, I love so much Arch !
Do you have any example of configuration for Ansible ? I'm very curious of this tech !

Collapse
 
samuelfaure profile image
Samuel-Zacharie FAURE • Edited

Sure ! Here's an example from my actual config. What it does is simply :

  • deletes a list of configuration files on my system (if they exist) with a loop (the list itself is on another file)
  • Creates the config folders I'll need to copy my configuration
  • Symlink the configuration files from my playbook to the system (so we replace the files we deleted before with the proper version, that is the version saved on the playbook)
---
- name: Delete existing Dotfiles
  file:
    path: '~/{{ item }}'
    state: absent
  loop: "{{ Dotfiles }}"

- name: Create .config folder
  file:
    path: '~/.config'
    state: directory

- name: Create .config/Code - OSS folder
  file:
    path: '~/.config/Code - OSS'
    state: directory

- name: Link Dotfiles into home
  file:
    src: "{{ playbook_dir }}/roles/dotfiles/files/{{ item }}"
    dest: '~/.{{ item }}'
    state: link
    force: yes
  loop: "{{ Dotfiles }}"

Note this is all done with the same ansible module, "file". Here's another task somewhere else that uses the module "package", which is used to install my list of packages :

- name: Install packages with pacman
  become_user: root
  package:
    state: present
    name: "{{ item }}"
  loop: "{{ packages }}"
  tags: packages-list
Collapse
 
vinksz profile image
vinksz

A lot of text, but not actually how to build your own.

I recommend this -> linuxfromscratch.org
will learn on the way as well how internals work. Or if it's too much reading and want to take the easy route...

On an existing arch system

Prepare ->

  1. su && pacman -S devtools git make --needed
  2. mkarchroot /tmp/chroot base (Create a chroot with base-packages)
  3. git clone git://projects.archlinux.org/archiso.git
  4. make -C archiso/archiso DESTDIR=/tmp/chroot install
  5. mkarchroot -r bash /tmp/chroot

Customize the ISO & Packages ->

  1. mknod /dev/loop0 b 7 0 (Create a loopback interface)
  2. echo 'Server = ftp.osuosl.org/pub/archlinux/$repo...' >> /etc/pacman.d/mirrorlist
  3. pacman -S devtools libisoburn squashfs-tools (required pkgs)
  4. xorg , firefox , neovim perhaps? the rest is up to you...
  5. Next, we can create our user and change any configuration files that we want. /boot/grub/menu.lst , .bashrc , /etc/rc.conf , /etc/hosts/allow ... etc

Build the iso ->

  1. cp -r /usr/share/archiso/configs/baseline /tmp
  2. cd /tmp/baseline
  3. ./build.sh
  4. exit

Now, you will be out of your chroot... with the built ISO at the file path ->

/tmp/chroot/tmp/baseline/out/

gz , you now have your custom arch iso

Collapse
 
mcsh profile image
Sajjad Heydari

A good post, might I suggest a small modification? It should be desktop environment and tiling window manager.

Collapse
 
samuelfaure profile image
Samuel-Zacharie FAURE

Indeed ! Ill correct ASAP

Collapse
 
johnea profile image
johnea

Hi, I did enjoy the post. I've run arch for about 20 years and have customized it for many embedded projects.

I'm not sure what was in the post prior to "desktop environment" and "tiling window manager", but I would suggest that "desktop environment" and "window manager" are not exactly comparable things.

The desktop environment is much more than a window manager, providing automount and other user services.

The window managers may also be "floating" as well as "tiling". The "floating window manager" is much like what most desktop environments provide, but it's only the window manager, none of that automount, or other stuff.

Personally I've been using fluxbox for many years, and love it.

In keeping with the "build your own" nature of this post, all of the config files are in the home directory in .fluxbox/. So everytime I upgrade, or move to a new machine, by copying my home directory I'm presented with the exact same desktop. No modifications to my workflow!

Thread Thread
 
samuelfaure profile image
Samuel-Zacharie FAURE

Thanks for this interesting addition

Collapse
 
ismail0852 profile image
ismail0852

Hi, actually I'm a newbie. Well I've been a project in school to build a custom arch linux based system but I don't know how to start with it. So could you please recommend me something maybe like a video or text to get on with it

Collapse
 
samuelfaure profile image
Samuel-Zacharie FAURE

This article is supposed to be exactly what you want.

For an easy installer try Anarchy

Collapse
 
lva profile image
José Angel Leyva Portilla

Thanks, I chose to dual boot with a KDE neon as a working fallback, I'm trying to setup my workflow with openbox, I'm not in a hurry and I'm learning stuff, hopefully my distrohopping will end