Created
October 2, 2023 16:19
-
-
Save anujonthemove/e4b029fadadee5f3730d8a62b26376bc to your computer and use it in GitHub Desktop.
An unresolvable problem occurred while calculating the upgrade.
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
# All thanks to a thread in this forum: https://askubuntu.com/questions/360293/could-not-calculate-the-upgrade-what-happened | |
#!/bin/bash | |
apt update | |
apt upgrade | |
cat /var/log/dist-upgrade/apt.log | egrep -o "^Broken\s[a-z:\.0-9-]*" | sed 's/Broken //' | sed 's/:amd64//' > packages.txt | |
sort -u packages.txt > packages_sorted.txt | |
while read line; do | |
apt remove -y $line | |
done < packages_sorted.txt | |
apt autoremove -y && sudo apt autoclean -y | |
echo "Done" | |
apt install -f | |
dpkg --configure -a | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment