{"id":2710,"date":"2023-07-12T16:53:41","date_gmt":"2023-07-12T16:53:41","guid":{"rendered":"https:\/\/hauweele.net\/~gawen\/blog\/?p=2710"},"modified":"2023-07-12T19:21:34","modified_gmt":"2023-07-12T19:21:34","slug":"post-install-archlinux","status":"publish","type":"post","link":"https:\/\/hauweele.net\/~gawen\/blog\/?p=2710","title":{"rendered":"Post install ArchLinux"},"content":{"rendered":"<p><a href=\"https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2023\/07\/arch.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2711\" src=\"https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2023\/07\/arch-1024x1024.png\" alt=\"\" width=\"128\" height=\"128\" srcset=\"https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2023\/07\/arch-1024x1024.png 1024w, https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2023\/07\/arch-300x300.png 300w, https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2023\/07\/arch-150x150.png 150w, https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2023\/07\/arch-768x768.png 768w, https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2023\/07\/arch-1536x1536.png 1536w, https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2023\/07\/arch-2048x2048.png 2048w\" sizes=\"auto, (max-width: 128px) 100vw, 128px\" \/><\/a><\/p>\n<p>In the past few months, I had to install ArchLinux several times. While it&#8217;s now my Linux distribution of choice for an everyday use, a clean install of Arch is rather bland. So in this post, I&#8217;ll try to resume the different step I took to spice a default Arch install a bit more to my taste. Most of the choices here are purely personals.<\/p>\n<h2>New user<\/h2>\n<p>By default, no user is created, so you have to create one along with its home directory. Also ensure that your home is in 750 instead of 755.<\/p>\n<pre>useradd -m youruser\r\nchmod 750 \/home\/youruser\r\n<\/pre>\n<h2>Fstab and tmpfs<\/h2>\n<p>By default, on a new install, <i>\/etc\/fstab<\/i> comes up mostly empty as most of it is hidden away by systemd. But I usually change some options and add tmpfs. Here&#8217;s an example:<\/p>\n<pre>\r\n\/dev\/vda2 \/ ext4 rw,noatime,nodiscard,stripe=4 0 1\r\n\/dev\/vda1 \/boot vfat rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro\t0 2\r\n\r\n\/dev\/vdb1 none swap sw 0 0\r\n\/dev\/vdb2 \/mnt\/data ext4 rw,noatime,nodiscard 0 0\r\n\r\ntmpfs \/tmp tmpfs noatime,mode=1777 0 0\r\ntmpfs \/run tmpfs noatime,nosuid,noexec,mode=755 0 0\r\ntmpfs \/run\/shm tmpfs noatime,nosuid,nodev,mode=1777 0 0\r\n<\/pre>\n<h2>pacman cache<\/h2>\n<p>If you have a separate data partition\/hdd, it may be a good idea to move the pacman cache there. However you cannot do so using symlinks, pacman won&#8217;t like that <i>at all<\/i>. Instead you have to edit the <code>CacheDir<\/code> entry in <i>\/etc\/pacman.conf<\/i>.<\/p>\n<h2>yay<\/h2>\n<p>Arch comes with its binary package manager (<a href=\"https:\/\/wiki.archlinux.org\/title\/pacman\">pacman<\/a>) and also the community maintained Arch User Repository (<a href=\"https:\/\/aur.archlinux.org\/\">AUR<\/a>) providing access to more packages that are generally built from source. <a href=\"https:\/\/github.com\/Jguer\/yay\">Yay<\/a> is a AUR package manager so you don&#8217;t have to clone and install AUR repos manually.<\/p>\n<p>Note that the commands below need to be run as your normal user, otherwise <code>makepkg<\/code> will complain about possible catastrophic happenstances.<\/p>\n<pre>sudo pacman -S --needed base-devel git\r\ngit clone https:\/\/aur.archlinux.org\/yay.git\r\ncd yay\r\nmakepkg -si\r\n<\/pre>\n<h2>legacy network interface name<\/h2>\n<p>Back in the days, network interfaces on Linux had simple names like <i>eth0<\/i>, <i>wlan0<\/i>, and so on. This <a href=\"https:\/\/wiki.debian.org\/NetworkInterfaceNames\">changed multiple times<\/a> because the order in which the interface drivers are loaded make these names not 100% predictable. However, if you know that your boot order is pretty static and never change, you might want to get the legacy naming scheme. To do so, either add <code>net.ifnames=0<\/code> to the kernel parameters or override the appropriate udev rule. In this case I use the latter option.<\/p>\n<pre>ln -s \/dev\/null \/etc\/udev\/rules.d\/80-net-setup-link.rules\r\n<\/pre>\n<h2>netctl<\/h2>\n<p>I prefer to use <a href=\"https:\/\/wiki.archlinux.org\/title\/netctl\">netctl<\/a> instead of <i>systemd-networkd<\/i> to manage the network. Since I constantly use other Unix and Unix-likes systems that are not Linux, and since I&#8217;ve been doing so for decades, I also prefer to use <i>ifconfig<\/i> instead of <i>ip<\/i>. When asked I also choose <i>openresolv<\/i> instead of <i>systemd-resolved<\/i>, the latter tries to do too many things in your back.<\/p>\n<pre>pacman -S net-tools inetutils netctl dhcpcd dhclient\r\nsystemctl enable netctl\r\n<\/pre>\n<p>Then you have to create a default profile, for instance in <i>\/etc\/netctl\/network<\/i>. Here is a default config that configures the interface with DHCP for IPv4 and SLAAC for IPv6:<\/p>\n<pre>Description=\"Basic DHCP ethernet connection\"\r\nInterface=eth0\r\nConnection=ethernet\r\nIP=dhcp\r\nIP6=stateless\r\n<\/pre>\n<p>You still have to enable the profile:<\/p>\n<pre>netctl enable network\r\n<\/pre>\n<h2>Some packages<\/h2>\n<p>Here is the bare minimum I would install on a new install, whether headless or xorg powered.<\/p>\n<ul>\n<li>uptimed<\/li>\n<li>ntp\/chrony<\/li>\n<li>ncdu<\/li>\n<li>zsh<\/li>\n<li>htop<\/li>\n<li>starship<\/li>\n<li>neovim<\/li>\n<li>wget\/curl\/lynx<\/li>\n<li>tcpdump\/nmap<\/li>\n<li>fzf<\/li>\n<li>tree<\/li>\n<li>bzip2\/xz\/gzip\/zstd<\/li>\n<li>the_silver_searcher<\/li>\n<li>git<\/li>\n<li>cpio<\/li>\n<li>rsync<\/li>\n<li>dialog<\/li>\n<li>ipv6calc<\/li>\n<li>dos2unix<\/li>\n<li>exa\/bat<\/li>\n<\/ul>\n<h2>Some extra packages<\/h2>\n<ul>\n<li><strong>openssh<\/strong>: remote access\/sync stuff and so on<\/li>\n<li><strong>bindfs<\/strong>: useful if you need to rebind user\/permission on mount points, for instance on a shared mount<\/li>\n<li><strong>tldr<\/strong>: recall any command usage (I recommend the <a href=\"https:\/\/github.com\/dbrgn\/tealdeer\">tealdeer<\/a> client, written in Rust)<\/li>\n<li><strong>doggo<\/strong>: DNS queries<\/li>\n<li><strong>vulkan-virtio\/mesa-vdpau<\/strong>: useful for graphical acceleration in a Qemu VM<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In the past few months, I had to install ArchLinux several times. While it&#8217;s now my Linux distribution of choice for an everyday use, a clean install of Arch is rather bland. So in this post, I&#8217;ll try to resume &hellip; <a href=\"https:\/\/hauweele.net\/~gawen\/blog\/?p=2710\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[1137,1138,769,6,1139],"class_list":["post-2710","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-arch","tag-archlinux","tag-install","tag-linux","tag-post-install"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2710"}],"version-history":[{"count":0,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2710\/revisions"}],"wp:attachment":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}