Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Fran C.
Fran C.

Posted on

     

How i install Arch Linux on my dev machine

I use ArchLinux on my 2 dev machines. One is an old Alienware M17xR4 that somehow is still alive and that I can only use plugged in (or on battery for like 20 minutes) and a powerful desktop machine that I share with Windows for playing videogames.

The reasons why I use Linux for development are basically because I enjoy it. I've never used Windows for development so I don't know if I would enjoy it and I've used Mac... and I just don't like it. I feel MacOS gets in my way all the time and doesn't always allow me to do what I want to do.

The reason why I use Arch? ... I don't know and I honestly ask myself this question every time I need to reinstall the system. But whenever I try something else I end up coming back to my Arch setup. It is just customized the way I like it.

Installing Arch isn't easy or straightforward, you normally need to know what you're doing and last time I tried it took me around 3 hours because I'm dummy and lazy and I still don't understand EFI or how to make Grub work with it (spoiler: I used refind).

In order to avoid this pain again I've decided to write this down so that I don't need to go through the same again 🤷

Most of it is just copied from the awesome Arch installation guide, with just a pinch of what I want and explaining the same steps just for myself (if you want to install Arch please go and use the installation guide instead of this!)

https://wiki.archlinux.org/index.php/Installation_guide

1. Bootstrap from the live USB

2. Get internet

If wifi just works

wifi-menu
Enter fullscreen modeExit fullscreen mode

If not, make sure your Ethernet cable or mobile tethering is connected. Arch will enable DHCP for the Ethernet devices it finds them (that includes USB tethering) while it boots. You only need to:

systemctl restart dhcpcd@enps0swhatever
Enter fullscreen modeExit fullscreen mode

check you have ping toping archlinux.org

3. Sync time

timedatectl set-ntp true
Enter fullscreen modeExit fullscreen mode

4. Partition

Use cfdisk. Important, make sure/var is not on the SSD. There's probably no reason for that on modern SSDs? I don't know, it just scares me.

Laptop

I use these partitions./dev/sda is the normal HDD and/dev/sdb is the 32GB SSD.

/dev/sda1, 1G, /boot/efi/dev/sda2, 1G, /boot/dev/sda3, 100G, /var/dev/sda4, all, /home/dev/sdb1, all, /
Enter fullscreen modeExit fullscreen mode

Desktop partition schema

  • /dev/sda is the Windows installation disk on SSD
  • /dev/sdb is the Windows storage HDD
  • /dev/sdc is the Linux SSD
  • /dev/sdd is the Linux storage HDD

EFI exists already from the Windows partition, don't format it, just mount it.

/dev/sda2, /boot/efi/dev/sdc1, all,  //dev/sdd1, 300G, /var/dev/sdd2, all, /media/store/dev/sda4, exists, /media/windows/dev/sdb2, exists, media/store_win
Enter fullscreen modeExit fullscreen mode

5. Bootstrap the system

pacstrap /mnt base linux linux-firmware neovim vi zsh networkmanager sudogenfstab -U /mnt >> /mnt/etc/fstab
Enter fullscreen modeExit fullscreen mode

On desktop remember to addlinux-headers base-devel broadcom-wl-dkms to the list of pacstrap packages. Because I have a broadcom wireless card and otherwise I don't have wifi on my first boot (and it is a pain to configure it later!)

6. Chroot

arch-chroot /mntln -sf /usr/share/zoneinfo/Europe/Madrid /etc/localtimehwclock --systohcnvim /etc/locale.gen # uncomment en_US.UTF-8 and es_ES.UTF-8locale-genecho "LANG=en_US.UTF-8" > /etc/locale.confecho "my-hostname" > /etc/hostname
Enter fullscreen modeExit fullscreen mode

Setup hostsnvim /etc/hosts

127.0.0.1   localhost::1     localhost127.0.1.1   my-hostname
Enter fullscreen modeExit fullscreen mode
passwd
Enter fullscreen modeExit fullscreen mode

7. Boot manager

I tipically install grub, but last time I wasn't able to do it and ended up installing refind.

Install grub

This just worked on the laptop 🤷

pacman -S grub efibootmgrgrub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efigrub-mkconfig -o /boot/grub/grub.cfg
Enter fullscreen modeExit fullscreen mode

Or refind

pacman -S refindrefind-install
Enter fullscreen modeExit fullscreen mode

Edit/boot/refind_linux.conf and make sure it has a line that refers to the/ partition

    "Boot using default options"   "root=PARTUUID=978e3e81-8048-4ae1-8a06-aa727458e8ff rw quiet splash"
Enter fullscreen modeExit fullscreen mode

PARTUUID can be found withblkid

Sometimes I add this themehttps://github.com/bobafetthotmail/refind-theme-regular

8. Restart!

Exit from chroot

umount -R /mntreboot
Enter fullscreen modeExit fullscreen mode

9. Connect wifi

systemctl enable NetworkManagersystemctl restart NetworkManagernmcli device wifi rescannmcli device wifi listnmcli device wifi connect SSID-Name password wireless-password
Enter fullscreen modeExit fullscreen mode

10. Create my new user

visudo # to enable sudo to members of wheel groupuserad -m -G wheel -s /bin/zsh usernamepasswd username
Enter fullscreen modeExit fullscreen mode

Then exit and login with this new user

11. Bootstrap the new system

If you're here and you're not me, ⚠️stop⚠️. This is how to install my own personal dot-files and you don't want them, believe me.

sudo pacman -S python python-pip python-neovim git base-develgit clone https://github.com/franciscoj/dot-files ~/Documents/src/dot-filescd ~/Documents/src/dot-files./boostrap/linux.shsudo DIFFPROG="nvim -d" pacdiffsudo pip install dotbotdotbot -c install.conf.yaml
Enter fullscreen modeExit fullscreen mode

Enable lightdm

sudo systemctl enable lightdm
Enter fullscreen modeExit fullscreen mode

Done!

Enjoy!

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I break code for a living... wait no, I fix it, most of the times. Well, sometimes.Yeah, I break code for a living.
  • Location
    Barcelona
  • Work
    Senior Software Engineer at GitHub
  • Joined

More fromFran C.

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp