blog/content/post/install-archlinux-from-existing-linux.md

2.2 KiB

title date lastmod draft keywords description tags categories author comment toc autoCollapseToc postMetaInFooter hiddenFromHomePage contentCopyright reward mathjax mathjaxEnableSingleDollar mathjaxEnableAutoNumber hideHeaderAndFooter flowchartDiagrams sequenceDiagrams
Install Archlinux From Existing Linux 2024-03-09T09:32:03+05:30 2024-03-09T09:32:03+05:30 false
archlinux
nixos
archlinux
nix
linux
false true false true false false false false false false false
enable options
false
enable options
false

Sometimes situations arise where I have to install Archlinux on a different partition/drive and I cannot switch to live media. Arch provides arch-install-scripts to make things easier.

The entire process is pretty straightforward this way and the experience is similar to that of a live media except you do not have to set up networking to get things started.

Installing nix

We will be using the nix package manager to use arch-install-scripts. Reason being a) it's dependencies will be isolated from those of the host system, b) it can be installed on most mainstream Linux distributions. Install nix if you haven't already before proceeding to the next section.

Spawning a shell

Run nix-shell -p arch-install-scripts to spawn a shell with the package. Or you can run nix shell nixpkgs#arch-install-scripts if you have flakes enabled. It is just a one time thing so we are not installing it and can be garbage collected on a latter date.

Getting started

Prepare the target drive for installation. Set up partitions and mount the filesystem.