2023-02-07 09:22:33 +01:00
|
|
|
#!/usr/bin/env bash
|
2023-08-11 17:19:18 +02:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2023-02-07 09:22:33 +01:00
|
|
|
# created by Tobias Powalowski <tpowa@archlinux.org>
|
2023-02-07 09:14:40 +01:00
|
|
|
if [[ ! "$(cat /etc/hostname)" == "archboot" ]]; then
|
|
|
|
echo "This script should only be run in booted archboot environment. Aborting..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
rm -r /usr/share/licenses
|
|
|
|
pacman -Sy
|
|
|
|
pacman -Q | cut -d ' ' -f1 >packages.txt
|
|
|
|
for i in $(cat packages.txt); do
|
2023-08-04 16:15:43 +02:00
|
|
|
rm -r /var/lib/pacman/local/"${i}"*
|
2023-03-12 07:26:26 +01:00
|
|
|
#shellcheck disable=SC2086
|
|
|
|
if pacman -S ${i} --noconfirm &>>log.txt; then
|
2023-07-06 07:31:26 +02:00
|
|
|
echo "${i}" >> uninstalled.orig.txt
|
2023-03-12 07:26:26 +01:00
|
|
|
else
|
|
|
|
#shellcheck disable=SC2086
|
|
|
|
pacman -S ${i} --noconfirm --overwrite '*'
|
|
|
|
fi
|
2023-02-07 09:14:40 +01:00
|
|
|
done
|
2023-07-05 12:28:40 +02:00
|
|
|
# remove false positives
|
2023-07-06 07:48:19 +02:00
|
|
|
grep -v -E "iana-etc|linux-firmware-marvell|pambase|pacman-mirrorlist|licenses" uninstalled.orig.txt >uninstalled.txt
|
2023-03-12 07:26:26 +01:00
|
|
|
# vim: set ft=sh ts=4 sw=4 et:
|