Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Methodical Josh - How to install Arch Linux Base (No Dual Boot)
- 1: Create Arch Linux USB by downloading live iso from http://www.archlinux.org/ and write to USB using Etcher (Easiest).
- 2: Insert USB into computer, and find the key associated with USB Booting for your motherboard. Some motherboards can allow you to also boot to usb from inside BIOS.
- 3: Once the shell has loaded, proceed with the commands below. You should see "root@archlinux:"
- --------------------------------------------------------------------------------------------------------------------
- # Ping google to test internet connection. You should get a result if connected, if not follow 'Append1' at the bottom.
- ping -c 4 google.com # This is used to ask google for data back to prove that the internet is working.
- --------------------------------------------------------------------------------------------------------------------
- # Find out your desired disk by using the following command
- fdisk -l # This is used to show partition data for every disk.
- # Your disk will be appended with /dev/sdx - with x being your append drive letter
- --------------------------------------------------------------------------------------------------------------------
- # Format the entire drive for cleaning of partition
- mkfs.ext4 /dev/sdx #Replace x with desired disk append. This is used to format the entire drive for reinitialization.
- --------------------------------------------------------------------------------------------------------------------
- # Start building partitions using CFDISK
- cfdisk #This runs a more user friendly version of fdisk.
- # It will ask you if you want to clear the disc, select yes, then select GPT/UEFI or MBR/BIOS
- --------------------------------------------------------------------------------------------------------------------
- # You'll now be prompted with a list with your disks.. Follow below.
- /dev/sdx, Select "Create" - Again, x will be replaced with your drive append letter
- Enter a size of 1G if using UEFI, otherwise ignore. * IGNORE IF USING BIOS SYSTEM
- Select this partition and select "Type", set this to "EFI System" * IGNORE IF USING BIOS SYSTEM
- You should now see /dev/sdx1 * IGNORE IF USING BIOS SYSTEM
- Create another partition by selecting the unused space, select "Create" again.
- Enter a size equivalent of the amount of RAM your device has, so if you have 4GB of RAM, enter 4G. This will be your swap space.
- Select this partition and select "Type", set this to "Linux Swap"
- You should now see /dev/sdx2 - or sdx1 if using bios system
- Create another the same way as before.
- Enter a size of AT LEAST 20GB for the linux partition. More heavy users increase this as needed.
- Select this partition and select "Type", set this to "Linux Filesystem"
- You should now see /dev/sdx3 - or sdx2 if using bios system
- Create a final partition for your /home folder which will contain all of you data such as (Desktop, Downloads, Pictures, Videos, Music, Documents, etc..)
- It should already have the biggest size possible in the size field, just hit enter as done before.
- Select this partition and select "Type", set this to "Linux Home"
- You should now see /dev/sdx4 - or sdx3 if using bios system
- Finally, Select the "Write" command, and select yes.
- Select "Quit" after, and you should be back to the command line.
- --------------------------------------------------------------------------------------------------------------------
- # Do as follows, replacing x with your drive append letter.
- mkfs.fat -F32 /dev/sdx1 # This formats the EFI partition to the proper filesystem. * IGNORE IF USING BIOS SYSTEM
- mkswap /dev/sdx2 # This turns the "Linux Swap" partition into an actual usable partition. IF USING BIOS, THIS WILL BE sdx1
- swapon /dev/sdx2 # This turns on the swap. IF USING BIOS, THIS WILL BE sdx1
- mkfs.ext4 /dev/sdx3 # This formats the "Linux Filesystem" partition into the EXT4 Filesystem. IF USING BIOS, THIS WILL BE sdx2
- mkfs.ext4 /dev/sdx4 # This formats the "Linux Home" partition into the EXT4 Filesystem. IF USING BIOS, THIS WILL BE sdx3
- --------------------------------------------------------------------------------------------------------------------
- # You will now need to mount the partitions by doing the following. Follow as the commands are.
- mount /dev/sdx3 /mnt # This mounts the "Linux Filesystem" partition to the /mnt folder.
- mkdir /mnt/home # This makes the folder /home inside of the /mnt directory which will be used for the "Linux Home" partition.
- mkdir -p /mnt/boot/EFI # This makes the EFI and boot folder consecutively using the parent flag, which is used only if you have a UEFI system. * IGNORE IF USING BIOS SYSTEM
- mount /dev/sdx1 /mnt/boot/EFI # This mounts the EFI to the folder we made for it. * IGNORE IF USING BIOS SYSTEM
- mount /dev/sdx4 /mnt/home # This mounts the "Linux Home" partition to the /home folder inside of /mnt
- --------------------------------------------------------------------------------------------------------------------
- pacman -Sy # This updates your packages
- pacman -S reflector # This installs reflector which determines the best mirrors to use based on speed and ping.
- reflector --verbose -l 10 --sort rate --save /etc/pacman.d/mirrorlist # This is the actual command to use reflector.
- --------------------------------------------------------------------------------------------------------------------
- # You'll now install the base system preparing the system for it's final form.
- pacstrap -i /mnt base base-devel # This calls for all packages for base and base-devel to be installed to the /mnt folder which is currently mounted with "Linux Filesystem" partition.
- --------------------------------------------------------------------------------------------------------------------
- # You'll now configure FSTAB which is the configuration used to automount partitions and folders where they are supposed to be mounted, which are appended with a UUID (Universally Unique Identifier).
- genfstab -U -p /mnt >> /mnt/etc/fstab # This is used to turn the current mounting configuration into a usable fstab configuration file.
- --------------------------------------------------------------------------------------------------------------------
- # You'll now change root (chroot) into your new installed filesystem for last configurations of it before restarting.
- arch-chroot /mnt # This changes the terminal over to the new installed filesystem in /mnt.
- --------------------------------------------------------------------------------------------------------------------
- # Now, You'll go through language and location configuration.
- nano /etc/locale.gen # This moves you into a terminal editor for editing the locale.gen file. Find your locale in the file and remove the '#' symbol from in front of it, then press CTRL+O to write, and then CTRL+X to exit.
- locale-gen
- echo LANG=en_US.UTF-8 > /etc/locale.conf # Replace the en_US.UTF-8 with the locale of yours from the locale.gen, This copies the LANG to the locale.conf for language configuration.
- export LANG=en_US.UTF-8 # Again, replace with your locale, this finalizes the language.
- --------------------------------------------------------------------------------------------------------------------
- # Now, set your time zone.
- ln -s /usr/share/zoneinfo/America/New_York > /etc/localtime #Replace America and New_York with your region and city using a _ as a space between city/region names.. Etc.. West_Virginia, South_Carolina
- --------------------------------------------------------------------------------------------------------------------
- # Configure the package manager to include multilib
- nano /etc/pacman.conf # Opens the pacman.conf in nano editor, CTRL+O to save, CTRL+X to exit
- Uncomment (Remove the #):
- [multilib]
- include = /etc/pacman.d.mirrorlist
- pacman -Sy # Updates the package list to include the multilib above
- --------------------------------------------------------------------------------------------------------------------
- # Set the hardware clock
- hwclock --systohc --est # Replace est with your time zone, this will sync the system and hardware clock together.
- --------------------------------------------------------------------------------------------------------------------
- # Set your hostname for your computer.. Kinda like a special name you want to call it.
- echo mycomputername > /etc/hostname # Replace mycomputername with the name you want.
- # Now copy this into /etc/hosts:
- nano /etc/hosts
- COPY THIS with editing:
- 127.0.0.1 localhost
- ::1 localhost
- 127.0.1.1 mycomputername.localdomain mycomputername
- ## Edit the mycomputer name to match your prefered name, then CTRL+O to save, CTRL+X to exit nano.
- --------------------------------------------------------------------------------------------------------------------
- # We will now configure your ETHERNET for auto connection, Not wifi.
- ip link show # This will show you available networking devices, You should see one called something similar to "enp0s3", Write down this entire thing except the : at the end and make sure to use proper caps sensitive lettering.
- systemctl enable dhcpcd@enp0s3.service # Replace the enp0s3 with your network device name, This will create a service for automatically connecting using this device.
- --------------------------------------------------------------------------------------------------------------------
- # You'll now set your root passwork and then also make your first NON-root user for daily usage like other linux systems.
- passwd # Type your password, BE CAREFUL because you can not see it for security purposes. If you mess up, just hold backspace until you believe it is cleared.
- pacman -S sudo bash-completion # This will install SUDO needed for root commands without being root, also installs bash-completeion for easier command lining by hitting tab twice.
- useradd -m -g users -G wheel,storage,power -s /bin/bash yourusername # This will create a user in the users group primary, and add user to the wheel, storage and power group for accessing sudo, storage devices and power ahci devices. Replace yourusername with the name you want.
- passwd yourusername # Create a password for the user, again BE CAREFUL as it is invisible. Replace yourusername with your users name.
- --------------------------------------------------------------------------------------------------------------------
- # You'll now need to allow the users in wheel to access the sudo command by editing the sudoers file.
- nano /etc/sudoers # This is the sudoers file, be careful inside this file. Only change what is needed.
- # Find %wheel ALL=(ALL) ALL and remove the '#' from in front of it, again save by pressing CTRL+O, and exit using CTRL+X
- --------------------------------------------------------------------------------------------------------------------
- # Almost done, Now we must create a ramdisk environment to boot all the stuff we need before arch starts.
- mkinitcpio -p linux # This creates that ramdisk environment for booting.
- pacman -S grub os-prober # This installs grub which is the boot menu for linux filesystems.. IF YOU ARE USING an EFI SYSTEM, use the command 'pacman -S grub os-prober efibootmgr' to install the EFI files needed.
- ##FOR EFI:
- grub-install --efi-directory=/boot/EFI /dev/sdx # DO NOT APPEND A NUMBER TO THE sdx, only change the letter. Ex. /dev/sda
- ##FOR BIOS:
- grub-install /dev/sdx # DO NOT APPEND A NUMBER TO THE sdx, only change the letter. Ex. /dev/sda
- --------------------------------------------------------------------------------------------------------------------
- # Create the grub menu with the proper configuration
- grub-mkconfig -o /boot/grub/grub.cfg # This creates the grub menu using the grub.cfg file downloaded.
- --------------------------------------------------------------------------------------------------------------------
- # And you're done, do the following.
- exit #Exits back to the previous root bash
- umount -R /mnt #Unmounts recursively all mount points inside of /mnt so there is no problem booting.
- reboot # Uh.. Duh.
Add Comment
Please, Sign In to add comment