mirror of
https://github.com/theupriser/steamify-cachyos-live-iso.git
synced 2026-10-02 15:10:26 +02:00
39 lines
1.2 KiB
Bash
Executable File
39 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
_clean_packages() {
|
|
local _leave_these_packages="base\nbase-devel\ncachyos-keyring\ncachyos-mirrorlist\ncachyos-v3-mirrorlist\ncachyos-hello\ngrub\nefibootmgr\n"
|
|
local _packages_to_remove=("$(comm -23 <(pacman -Qq | sort) <({ pacman -Qqg base-devel; printf "%s" $_leave_these_packages; } | sort -u))")
|
|
local xx
|
|
# @ does one by one to avoid errors in the entire process
|
|
# * can be used to treat all packages in one command
|
|
for xx in "${_packages_to_remove[@]}"; do pacman -Rsc "$xx" --noconfirm; done
|
|
|
|
rm /etc/sddm.conf || true
|
|
}
|
|
|
|
_try_v3() {
|
|
local pacman_conf="/etc/pacman.conf"
|
|
local pacman_conf_cachyos="/etc/pacman-more.conf"
|
|
local pacman_conf_path_backup="/etc/pacman.conf.bak"
|
|
|
|
if /lib/ld-linux-x86-64.so.2 --help | grep "x86-64-v3 (supported, searched)" > /dev/null; then
|
|
echo "x86-64-v3 is supported"
|
|
|
|
sed -i 's/Architecture = auto/#Architecture = auto/' $pacman_conf_cachyos
|
|
sed -i 's/#<disabled_v3>//g' $pacman_conf_cachyos
|
|
|
|
echo "backup old config"
|
|
mv $pacman_conf $pacman_conf_path_backup
|
|
|
|
echo "CachyOS -v3 Repo changed"
|
|
mv $pacman_conf_cachyos $pacman_conf
|
|
|
|
else
|
|
echo "x86-64-v3 is not supported"
|
|
fi
|
|
|
|
}
|
|
|
|
_clean_packages
|
|
_try_v3
|