Created
August 24, 2023 16:08
-
-
Save assimilat/89ffb23d10ac9e076987e760ffdc620f to your computer and use it in GitHub Desktop.
pacman system update via pm2ml and aria2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HAVE_SUDO=""; | |
rm /tmp/sudo.tmp | |
while [ -z "${HAVE_SUDO}" ]; | |
do | |
if [ -z "$(grep 'USER=root' /tmp/sudo.tmp)" ]; | |
then | |
echo "Need sudo privs!"; | |
echo "Login sudo now!"; | |
sudo env | sed -e "s/[ ]/\n/g" > /tmp/sudo.tmp; | |
else | |
HAVE_SUDO="1"; | |
fi | |
done | |
for i in $(ls /var/cache/pacman/pkg/ | grep "[.]1[.]...$\|aria2$"); | |
do | |
sudo rm /var/cache/pacman/pkg/${i}; | |
done | |
cd /; | |
pm2ml -uso /var/cache/pacman/pkg/ > /tmp/update.ml; | |
sudo aria2c -c -V -M /tmp/update.ml && pacman -Su --noconfirm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment