Project

General

Profile

Support #590

Updated by Daniel Curtis over 9 years ago

{{>toc}} 

 This is a simple guide to setup a base minimal Arch Linux installation.  

 h1. Prepare the partition 

 * Format the hard drive using cfdisk: 
 <pre> 
 cfdisk /dev/sda 
 </pre> 

 * Create the filesystem:  
 <pre> 
 mkfs.ext4 /dev/sda1 
 </pre> 

 * Mount the partition: 
 <pre> 
 mount /dev/sda1 /mnt 
 mkdir /mnt/etc 
 </pre> 

 h1. Install the Base System base system 

 * Generate an fstab: 
 <pre> 
 genfstab -p /mnt >> /mnt/etc/fstab 
 </pre> 

 * Now its time to install the base system: 
 <pre> 
 pacstrap /mnt base base-devel grub openssh sudo 
 </pre> 

 h2. Setup the Environment 

 * 
 #* chroot into the newly installed system: 
 <pre> 
 arch-chroot /mnt 
 </pre> 
 #* Write your hostname to /etc/hostname: 
 <pre> 
 echo 'archlinux' >> /etc/hostname 
 </pre> 
 #* Symlink /etc/localtime to /usr/share/zoneinfo/Zone/SubZone: 
 <pre> 
 ln -s /usr/share/zoneinfo/America/Los_angeles /etc/localtime 
 </pre> 
 #* Uncomment the selected locale: locale in /etc/locale.gen and generate it with: 
 <pre> 
 vi /etc/locale.gen 
 </pre> 
 *#* And use the following to enable en_US.UTF-8: 
 <pre> 
 :%s/#en_US.UTF-8/en_US.UTF-8 
 :wq 
 </pre> 
 #* Then generate locale with with: 
 <pre> 
 locale-gen 
 </pre> 
 #* Configure @/etc/mkinitcpio.conf@ as needed and create an initial RAM disk with: 
 <pre> 
 mkinitcpio -p linux 
 </pre> 
 #* Set a root password: 
 <pre> 
 passwd 
 </pre> 
 #* Configure the network again for newly installed environment: 
 <pre> 
 cp /etc/netctl/examples/ethernet-dhcp /etc/netctl/wired 
 systemctl enable systemd-networkd.service 
 netctl enable wired.service 
 </pre> 
 #* (Optional) Disable systemd-resolved to allow netctl to set DNS: 
 <pre> 
 systemctl disable systemd-resolved 
 rm /etc/resolv.conf 
 </pre> 
 #* Enable SSH 
 <pre> 
 systemctl enable sshd.service 
 </pre> 

 h2. Add an Administrative User 

 * Add an unprivileged user, bob in this case: 
 <pre> 
 useradd -m -g users -s /bin/bash bob 
 </pre> 

 * Add the sudo group: 
 <pre> 
 groupadd sudo 
 </pre> 

 * Edit the sudo file: 
 <pre> 
 visudo 
 </pre> 
 #* And uncomment the sudo group line: 
 <pre> 
 %sudo 	 ALL=(ALL) ALL 
 </pre> 

 * Then add the user bob to the sudo group: 
 <pre> 
 usermod -aG sudo bob 
 </pre> 

 h2. h1. Install the bootloader 

 * Now install GRUB: 
 <pre> 
 grub-install --target=i386-pc --recheck --debug /dev/sda 
 grub-mkconfig -o /boot/grub/grub.cfg 
 </pre> 

 * Exit and reboot the out of the installation environment: 
 <pre> 
 exit 
 umount /mnt 
 reboot 
 </pre>

Back