Properly mantain Arch Linux, new script, and fastest mirror selector

This commit is contained in:
2024-04-02 19:38:13 +01:00
parent 32cd83a71b
commit fd6e1a73e9
3 changed files with 30 additions and 9 deletions

View File

@@ -12,12 +12,18 @@ curl -L https://raw.githubusercontent.com/TrudeEH/dotfiles/main/install.sh | bas
```
## Dependencies
- Nix (installed automatically)
- Nix (installed automatically)
## Custom commands
- `extract` Extract compressed files
- `update` Update Nix and the OS.
- `reload` Rebuild the config after changing it.
- `extract` Extract compressed files
- `update` Update Nix and the OS.
- `reload` Rebuild the config after changing it.
## Scripts
- `archinstall` Install Arch Linux from the liveCD.
```sh
curl -L https://raw.githubusercontent.com/TrudeEH/dotfiles/main/scripts/archinstall.sh | bash
```
## Supported distros
- Debian

View File

@@ -89,12 +89,17 @@
echo "Updating Arch..."
sudo pacman -Syu
sudo pacman -Rsn $(pacman -Qdtq)
if p c pacman-contrib &>/dev/null; then
paccache -rk1
else
sudo pacman -S pacman-contrib
paccache -rk1
echo "Selecting the fastest mirrors..."
if [ ! "$(command -v reflector)" ]; then
sudo pacman -Syu --noconfirm reflector
fi
reflector -a 48 -c $iso -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist
echo "Cleaning pacman cache..."
if [ ! "$(command -v paccache)" ]; then
sudo pacman -Syu --noconfirm pacman-contrib
fi
paccache -rk1
echo "Cleaning old logs..."
sudo journalctl --vacuum-time=7d
elif [ "$(grep -Ei 'fedora' /etc/*release)" ]; then
echo "Updating Fedora..."

10
scripts/archInstall.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Script to install Arch Linux from the liveCD.
echo "[+] Installing dependencies..."
pacman -Sy --noconfirm curl reflector archlinux-keyring
echo "[+] Selecting the fastest mirrors..."
reflector -a 48 -c $iso -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist
archinstall