Skip to content

Instantly share code, notes, and snippets.

@kyoukaya
Last active January 14, 2020 18:44
Show Gist options
  • Save kyoukaya/3d4a9e4cfd9469cbe3a94d6aeb276242 to your computer and use it in GitHub Desktop.
Save kyoukaya/3d4a9e4cfd9469cbe3a94d6aeb276242 to your computer and use it in GitHub Desktop.

Revisions

  1. kyoukaya revised this gist Jan 14, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion test.md
    Original file line number Diff line number Diff line change
    @@ -160,7 +160,7 @@ Update the system clock.
    ```
    Installing the base packages
    ```
    # pacstrap /mnt base wpa_supplicant efibootmgr
    # pacstrap /mnt base linux linux-firmware nano wpa_supplicant efibootmgr
    ```
    Change root into the new system
    ```
  2. kyoukaya revised this gist Jan 14, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions test.md
    Original file line number Diff line number Diff line change
    @@ -175,8 +175,8 @@ Uncomment en_US.UTF-8 UTF-8 and other needed locales in `/etc/locale.gen`, and g
    ```
    # locale-gen
    ```
    Create the locale.conf(5) file, and set the LANG variable accordingly:
    /etc/locale.conf
    Create the locale.conf file, and set the LANG variable accordingly in
    `/etc/locale.conf`:
    ```
    LANG=en_US.UTF-8
    ```
  3. kyoukaya revised this gist Jan 14, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion test.md
    Original file line number Diff line number Diff line change
    @@ -171,7 +171,7 @@ Set the time zone
    # ln -sf /usr/share/zoneinfo/Australia/Sydney /etc/localtime
    # hwclock --systohc
    ```
    Uncomment en_US.UTF-8 UTF-8 and other needed locales in /etc/locale.gen, and generate them with:
    Uncomment en_US.UTF-8 UTF-8 and other needed locales in `/etc/locale.gen`, and generate them with:
    ```
    # locale-gen
    ```
  4. kyoukaya revised this gist May 31, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions test.md
    Original file line number Diff line number Diff line change
    @@ -203,6 +203,7 @@ Allow wheel group to use sudo by changing /etc/sudoers

    ```
    DE: xfce4
    DM: ly(AUR)
    Audio: pulseaudio pavcontrol
    Network: networkmanager network-manager-applet
    Browser: firefox
  5. kyoukaya revised this gist May 30, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion test.md
    Original file line number Diff line number Diff line change
    @@ -215,5 +215,5 @@ Candy: neofetch steam(multilib)
    Dev: python git htop go
    Comms: discord(AUR) hexchat
    Sync: syncthing dropbox(AUR)
    Ftp: lftp vsftpd
    Ftp: lftp vsftpd gvfs
    ```
  6. kyoukaya revised this gist May 30, 2019. No changes.
  7. kyoukaya revised this gist May 30, 2019. 1 changed file with 30 additions and 15 deletions.
    45 changes: 30 additions & 15 deletions test.md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ List devices with:
    ```
    # iw dev
    ```
    Activate the interface (You shouldn't need to, but just incase!)
    Activate the interface
    ```
    # ip link set YOUR_INTERFACE up
    ```
    @@ -37,15 +37,8 @@ At this point you should be connected to the internet, verify that everything wo
    # ping archlinux.org
    ```

    ### Uniwide setup
    #### Uniwide setup
    ```
    # Connect to a WPA2 Enterprise network with wpa_supplicant with this .conf file.
    # I used this to connect to my university's wireless network on Arch linux.
    # Here's the command I used:
    #
    # wpa_supplicant -i wlan0 -c ./wpa_supplicant.conf
    #
    network={
    ssid="YOUR_SSID"
    scan_ssid=1
    @@ -167,7 +160,7 @@ Update the system clock.
    ```
    Installing the base packages
    ```
    # pacstrap /mnt base base-devel wpa_supplicant
    # pacstrap /mnt base wpa_supplicant efibootmgr
    ```
    Change root into the new system
    ```
    @@ -185,20 +178,42 @@ Uncomment en_US.UTF-8 UTF-8 and other needed locales in /etc/locale.gen, and gen
    Create the locale.conf(5) file, and set the LANG variable accordingly:
    /etc/locale.conf
    ```
    LANG=en_AU.UTF-8
    LANG=en_US.UTF-8
    ```
    Set the root password:
    ```
    # passwd
    ```
    Time to setup the boot loader. Since we're going with a UEFI BIOS... We have to install `efibootmgr` to set it up.
    ```
    # pacman -Syu efibootmgr
    ```
    Get the PARTUUID of the EFI partition you created earlier.
    ```
    blkid /dev/sda2
    ```
    Run, it's a mouthfull, but bear with it! `root=PARTUUID=` needs to contain the PARTUUID of the root partition, `sda2` in our case. While the argument for --disk and --part 1 refer to the EFI
    ```
    # efibootmgr --disk /dev/sda1 --part 1 --create --label "Arch Linux" --loader /vmlinuz-linux --unicode 'root=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw initrd=\initramfs-linux.img' --verbose```
    # efibootmgr --disk /dev/sda1 --part 1 --create --label "Arch Linux" --loader /vmlinuz-linux --unicode 'root=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw initrd=\initramfs-linux.img' --verbose
    ```

    New user
    ```
    useradd -m -G wheel username
    ```

    Allow wheel group to use sudo by changing /etc/sudoers

    ```
    DE: xfce4
    Audio: pulseaudio pavcontrol
    Network: networkmanager network-manager-applet
    Browser: firefox
    Security: keepassxc
    pacman wrapper: yay
    Fonts: ttf-fantasque-sans-mono noto-fonts ttf-freefont
    Editor: vscode(AUR)
    Terminal: tmux alacritty
    Candy: neofetch steam(multilib)
    Dev: python git htop go
    Comms: discord(AUR) hexchat
    Sync: syncthing dropbox(AUR)
    Ftp: lftp vsftpd
    ```
  8. kyoukaya revised this gist May 22, 2019. No changes.
  9. kyoukaya revised this gist May 21, 2019. 1 changed file with 39 additions and 5 deletions.
    44 changes: 39 additions & 5 deletions test.md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ List devices with:
    ```
    # iw dev
    ```
    Activate the interface:
    Activate the interface (You shouldn't need to, but just incase!)
    ```
    # ip link set YOUR_INTERFACE up
    ```
    @@ -76,6 +76,7 @@ Create the GPT table with `g`.
    Command (m for help): g
    ```
    Following that we'll be setting up the partitions according to this table:

    | Mount point | Partition | Partition Type | Size |
    |-------------|-------------|----------------|--------------|
    | `/mnt/boot` | `/dev/sda1` | EFI System | 512MB |
    @@ -149,22 +150,55 @@ Now the swap partition
    ```
    Mounting all the filesystems we've created
    ```
    # mount /dev/sda1 /boot
    # mount /dev/sda2 /mnt
    # mount /dev/sda1 /mnt/boot
    # swapon /dev/sda3
    ```

    ### Preparing for the install
    Generate an fstab file (use -U or -L to define by UUID or labels, respectively).
    ```
    # mkdir /mnt/etc
    # genfstab -U /mnt >> /mnt/etc/fstab
    # genfstab -t PARTUUID /mnt >> /mnt/etc/fstab
    ```
    Update the system clock.
    ```
    # timedatectl set-ntp true
    ```
    Installing the base packages
    ```
    # pacstrap /mnt base base-devel
    ```
    # pacstrap /mnt base base-devel wpa_supplicant
    ```
    Change root into the new system
    ```
    # arch-chroot /mnt
    ```
    Set the time zone
    ```
    # ln -sf /usr/share/zoneinfo/Australia/Sydney /etc/localtime
    # hwclock --systohc
    ```
    Uncomment en_US.UTF-8 UTF-8 and other needed locales in /etc/locale.gen, and generate them with:
    ```
    # locale-gen
    ```
    Create the locale.conf(5) file, and set the LANG variable accordingly:
    /etc/locale.conf
    ```
    LANG=en_AU.UTF-8
    ```
    Set the root password:
    ```
    # passwd
    ```
    Time to setup the boot loader. Since we're going with a UEFI BIOS... We have to install `efibootmgr` to set it up.
    ```
    # pacman -Syu efibootmgr
    ```
    Get the PARTUUID of the EFI partition you created earlier.
    ```
    blkid /dev/sda2
    ```
    Run, it's a mouthfull, but bear with it! `root=PARTUUID=` needs to contain the PARTUUID of the root partition, `sda2` in our case. While the argument for --disk and --part 1 refer to the EFI
    ```
    # efibootmgr --disk /dev/sda1 --part 1 --create --label "Arch Linux" --loader /vmlinuz-linux --unicode 'root=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw initrd=\initramfs-linux.img' --verbose```
  10. kyoukaya created this gist May 21, 2019.
    170 changes: 170 additions & 0 deletions test.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,170 @@
    # Arch Install

    ### Creating The Installation Media
    1. Download the ISO from https://www.archlinux.org/download/ through HTTP/Bittorent.
    2. Copy the image to a thumbdrive using dd (linux) or [rufus](https://rufus.ie/) (windows)
    3. Boot into Arch!

    #### dd Instructions
    blah

    ### Connecting to the internet
    If you have a wired connection to the internet. You shouldn't need to do anything. The steps below are for setting up a wireless connection to a home network secured with WPA.

    List devices with:
    ```
    # iw dev
    ```
    Activate the interface:
    ```
    # ip link set YOUR_INTERFACE up
    ```
    Scan for wireless access points, piping the output into `less`:
    ```
    # iw dev YOUR_INTERFACE scan | less
    ```
    Noting your wireless AP's SSID from the previous step.
    This pipes the output of `wpa_passphrase` which produces prints a barebones configuration file, into `wpa_supplicant`.
    ```
    # wpa_supplicant -B -i YOUR_INTERFACE -c <(wpa_passphrase SSID PASSPHRASE)
    ```
    Obtain an IP address after connecting to the AP.
    ```
    # dhcpcd YOUR_INTERFACE
    ```
    At this point you should be connected to the internet, verify that everything works as it should by pinging a website.
    ```
    # ping archlinux.org
    ```

    ### Uniwide setup
    ```
    # Connect to a WPA2 Enterprise network with wpa_supplicant with this .conf file.
    # I used this to connect to my university's wireless network on Arch linux.
    # Here's the command I used:
    #
    # wpa_supplicant -i wlan0 -c ./wpa_supplicant.conf
    #
    network={
    ssid="YOUR_SSID"
    scan_ssid=1
    key_mgmt=WPA-EAP
    identity="YOUR_USERNAME"
    password="YOUR_PASSWORD"
    eap=PEAP
    phase1="peaplabel=0"
    phase2="auth=MSCHAPV2"
    }
    ```

    https://wiki.archlinux.org/index.php/Wireless_network_configuration#iw

    ### Partitioning the disk
    List the connected storage devices.
    ```
    # fdisk -l
    ```
    Run `fdisk` on the drive you want to install Arch on.
    ```
    # fdisk /dev/YOUR_DRIVE
    ```
    This will launch the `fdisk` prompt, further commands for formatting and partitioning the drive will be executed inside the fdisk prompt.

    Create the GPT table with `g`.
    ```
    Command (m for help): g
    ```
    Following that we'll be setting up the partitions according to this table:
    | Mount point | Partition | Partition Type | Size |
    |-------------|-------------|----------------|--------------|
    | `/mnt/boot` | `/dev/sda1` | EFI System | 512MB |
    | `/mnt/` | `/dev/sda2` | Linux Filesystem| Rest of disk |
    | `SWAP` | `/dev/sda3` | Linux Swap | 2GB |

    Creating the EFI System partition.
    Some text to the left of the `:` has been ommitted for brevity.
    ```
    Command (m for help): n
    Partition number (1-128, default 1): 1
    First sector (default 2048):
    Last sector, +/-sectors or +/-size{K,M,G,T,P}: +512M
    Created a new partition 1 of type 'Linux filesystem' and of size 512MiB.
    ```
    This will have created it as a Linux Filesystem partition, to change that into an EFI System partition, we execute the following command.
    ```
    Command (m for help): t
    Selected partition 1
    Partition type (type L to list all types): 1
    Changed type of partition 'Linux filesystem' to 'EFI System'.
    ```
    Creating the swap partition.
    ```
    Command (m for help): n
    Partition number (1-128, default 1): 3
    First sector:
    Last sector, +/-sectors or +/-size{K,M,G,T,P}: +2G
    Created a new partition 3 of type 'Linux Filesystem' and of size 2GiB.
    Command (m for help): t
    Partition number (1,3, default 3): 3
    Partition type (type L to list all types): 19
    Changed type of partition 'Linux filesystem' to 'Linux swap'.
    ```
    Finally, creating the main filesystem partition. The size argument here leaves 20KB of disk unpartitioned to allowe converting between MBR and GPT if necessary. If wasting 20KB bothers you, leave it empty to default to using the rest of disk.
    ```
    Command (m for help): n
    Partition number (2,4-128, default 2): 2
    First sector:
    Last sector, +/-sectors or +/-size{K,M,G,T,P}: -20K
    Created a new partition 2 of type 'Linux filesystem' and of size 486.6GiB.
    ```
    Verify all partitions are as they should be and write them to the disk.
    ```
    Command (m for help): p
    ...
    Command (m for help): w
    ```
    Verify that the partitions have been written to your disk with
    ```
    # fdisk -l /dev/YOUR_DRIVE`
    ```
    It should show the 3 partitions we've just created.

    ### Formatting the partitions
    First off we'll format the EFI partition as FAT32. Note: it MUST be formatted as a FAT filesystem.
    ```
    # mkfs.fat -F32 /dev/sda1
    ```
    Format the main linux filesystem with whatever you'd like, I'll just be formatting it with the tried and true `ext4` fs.
    ```
    # mkfs.ext4 /dev/sda2
    ```
    Now the swap partition
    ```
    # mkswap /dev/sda3
    ```
    Mounting all the filesystems we've created
    ```
    # mount /dev/sda1 /boot
    # mount /dev/sda2 /mnt
    # swapon /dev/sda3
    ```

    ### Preparing for the install
    Generate an fstab file (use -U or -L to define by UUID or labels, respectively).
    ```
    # mkdir /mnt/etc
    # genfstab -U /mnt >> /mnt/etc/fstab
    ```
    Update the system clock.
    ```
    # timedatectl set-ntp true
    ```
    Installing the base packages
    ```
    # pacstrap /mnt base base-devel
    ```