I created a little quick and dirty script to wrap the update method above, along with updating 3rd party packages (using eopkg3p
), snap
, and flatpak
. Input for improvements are always welcome.
#!/bin/sh
#set -x
## Variables
_mypid=$$;echo -e "\nMy PID: ${_mypid}"
## Trap
trap 'echo -e "\nCTRL-C detected, killing ... \n";kill -9 ${_mypid}' INT
## Check for sudo
if ! [ $(id -u) = 0 ]; then
echo -e "\nI am not root!\n\nPlease run this script again with sudo ... \n"
exit 1
fi
## Eopkg
echo -e "\nRunning eopkg upgrade ... \n"
until sh -c 'eopkg upgrade -y'
do
echo "Trying eopkg upgrade again ... "
done
echo -e "\nEopkg upgrade completed ... \n"
## Eopkg3p
_finish="yes"
_e3p_count=0
_e3p_isinstalled=$(which eopkg3p > /dev/null 2>&1;echo $?)
if [ ${_e3p_isinstalled} -eq 0 ];then
echo -e "\nRunning eopkg3p upgrade ... \n"
until sh -c 'eopkg3p upgrade -y'
do
_e3p_count=$((_e3p_count+1))
if [ ${_e3p_count} -eq 3 ];then
echo -e "\nSomething went wrong, exiting loop ... \n"
_finish="no"
break
else
echo -e "\nTrying 3rd party upgrade again ... retry: ${_e3p_count}\n"
fi
done
if [ "${_finish}" = "no" ];then
echo -e "\nEopkg3p upgrade failed ... please investigate ... \n"
else
echo -e "\nEopkg3p upgrade completed ... \n"
fi
else
echo -e "\neopkg3p is not installed, skipping 3rd party upgrade ... "
echo -e "If you wish to install it, run this command: \nsudo -H pip3 install eopkg3p\n"
fi
## Snap
echo -e "\nUpdating snap ecosystem ... \n"
snap refresh
echo -e "\nSnap update complete ... \n"
## Flatpak
echo -e "\nFlatpak ecosystem maintenance ... \n"
echo -e "Checking for and removing any unused flatpak items ... \n"
flatpak uninstall --unused
echo -e "Flatpak unused removal complete ... \n"
echo -e "Updating flatpak apps ... \n"
flatpak update -y
echo -e "\nFlatpak update complete ... \n"
## Completion
echo -e "\nDONE\n\n"
I added the trap
, because I found sometimes it was difficult to kill the until
loop if you needed to for some reason.
I usually throw this in ~/bin/solus-upgrade-all.sh
add the execute bits chmod +x ~/bin/solus-upgrade-all.sh
, and then run it with sudo ~/bin/solus-upgrade-all.sh
. Hopefully this is useful for someone.