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

This commit is contained in:
2024-04-02 19:38:13 +01:00
parent c25f083df5
commit 89dcf6c7a3
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 ## Dependencies
- Nix (installed automatically) - Nix (installed automatically)
## Custom commands ## Custom commands
- `extract` Extract compressed files - `extract` Extract compressed files
- `update` Update Nix and the OS. - `update` Update Nix and the OS.
- `reload` Rebuild the config after changing it. - `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 ## Supported distros
- Debian - Debian

View File

@@ -89,12 +89,17 @@
echo "Updating Arch..." echo "Updating Arch..."
sudo pacman -Syu sudo pacman -Syu
sudo pacman -Rsn $(pacman -Qdtq) sudo pacman -Rsn $(pacman -Qdtq)
if p c pacman-contrib &>/dev/null; then echo "Selecting the fastest mirrors..."
paccache -rk1 if [ ! "$(command -v reflector)" ]; then
else sudo pacman -Syu --noconfirm reflector
sudo pacman -S pacman-contrib
paccache -rk1
fi 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 sudo journalctl --vacuum-time=7d
elif [ "$(grep -Ei 'fedora' /etc/*release)" ]; then elif [ "$(grep -Ei 'fedora' /etc/*release)" ]; then
echo "Updating Fedora..." 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