Today I tried to use intellij-idea for the first time for a few weeks. It tells me that there are updates in snap. There was also a compile error (but this may or may not have been my error).
I have tried to update, but no luck. Here is what I have tried.
#↳ sudo snap refresh
All snaps up to date.
#↳ snap list
Name Version Rev Tracking Publisher Notes
core 9993 latest canonical✓ broken
core18 1885 latest canonical✓ broken
gtk-common-themes 1506 latest canonical✓ broken
intellij-idea-community 2020.2.3 257 latest jetbrains✓ classic
kotlin 53 latest jetbrains✓ broken
#↳ snap list --all
Name Version Rev Tracking Publisher Notes
core 9993 latest canonical✓ broken
core 9804 latest canonical✓ disabled,broken
core18 1885 latest canonical✓ broken
gtk-common-themes 1506 latest canonical✓ broken
intellij-idea-community 249 latest jetbrains✓ disabled,broken
intellij-idea-community 252 latest jetbrains✓ disabled,broken
intellij-idea-community 2020.2.3 257 latest jetbrains✓ classic
kotlin 50 latest jetbrains✓ disabled,broken
kotlin 53 latest jetbrains✓ brokenAs you can see snap is telling be that it is broken. What is broken? Did it update to broken code? Why will it not update, when intellij-idea is telling be that there is an update?
42 Answers
What I did to fix it.
I still have no idea what is wrong with snap, but this work around worked for me.
Remove all packages
for package_name in …
do sudo snap remove $package_name
doneRe-install packages
for package_name in …
do sudo snap install $package_name
doneReplace the ellipses as appropriate.
Sometimes snaps fail to mount. systemctl --failed shows failed ones. Need to start them via systemctl start <...> then reconnect the failed snap packages via snap disable <pkg> then snap enable <pkg>. snap revert <pkg>/snap refresh <pkg> also fix failed snap packages. Reinstall works for sure, but there is a shorter way.
Here is the script to fix that:
#!/bin/sh
set -x
alwaysfix=chromium
[ -z "$1" ] || alwaysfix="$1"
tofix="`snap list | awk '/broken/{print $1}'`"
for t in `COLUMNS=1000 systemctl --failed | awk '/snap.+mount/{print $1}'`; do systemctl start "$t"
done
for s in $tofix; do snap disable "$s" snap enable "$s"
done
for s in $alwaysfix; do snap disable "$s" snap enable "$s"
done 1