Skip to content

Instantly share code, notes, and snippets.

@squidds
Created November 5, 2022 00:43
Show Gist options
  • Save squidds/835d39a15d559b2af75d2a324fd933fe to your computer and use it in GitHub Desktop.
Save squidds/835d39a15d559b2af75d2a324fd933fe to your computer and use it in GitHub Desktop.
arch-lxc-init
#!/usr/bin/env bash
# Init pacman mirror
curl -s -L "https://www.archlinux.org/mirrorlist/?country=US&country=CA&protocol=https&ip_version=4" | sed -e 's/^#Server/Server/' -e '/^#/d' > /etc/pacman.d/mirrorlist
# Init key
pacman-key --init
# Init archlinux key
pacman-key --populate archlinux
# Sync repo
yes '' | pacman -Syyu
# Install commom package
yes '' | pacman -S sudo htop iftop base-devel pacman-contrib git nano
# Sort repo by speed
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
rankmirrors -n 5 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist
# Create non root user
useradd admin -m
passwd admin
# Add admin to wheel group
usermod -aG wheel admin
# Allow wheel group sudo
echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment