Log In
Ask Solus is a community edited knowledge base and support forum for Solus. We are not endorsed or supported by Solus Project.
1 vote

Posted by AngelKrauze

{WIP } I made up a tiny script for auto-detect and repair broken packages

1 – Save the following code as

Red="\033[0;31m" # Red
Yellow="\033[0;33m" # Yellow
if [ $USER != root ]; then
echo -e $Red"Error: must run as root user"
exit 0
declare -a _installed=($(eopkg list-installed | cut -f1 -d " "))
echo -e $Yellow "    Verifying packages instalation"
for i in "${_installed[@]}"; do
printf "\r [!] $_index/${#_installed[*]} $i\033[K"
_status=$(eopkg check $i)
if [[ $_status != *"OK"* ]]; then
echo -e $Red"\033[5m $i seems broken"
sudo eopkg it --reinstall $i > /dev/null 2>&1 & echo  -e $Yellow"reinstalling $i"
printf "\033[K" & echo -e "\n     Package verification ... DONE"

2 – Open in terminal the folder that contains

cd /home/<USERNAME>/Downloads

3 – Give it execution permissions

sudo chmod +x

4 – Execute as root

sudo sh

5 – Enjoy(:

For the curious:

The script save the installed packages list into the _installed array, then checks the packages, if its status is not “OK” then repairs it.


16k points 19 96 141

Please log in or register to answer this question.