1

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✓  broken

As 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?

4
  • Have you tried to uninstall and reinstall the problematic snaps? Why do you need multiple versions of the same software? – Nmath Oct 9 '20 at 18:52
  • multiple versions: I was wondering that as well. Snap installed them. I removed the snaps and installed. It seems to have worked. But I don't know why, this worked, and the refresh did not. – ctrl-alt-delor Oct 9 '20 at 19:22
  • Please consider posting your solution below to help future visitors – Nmath Oct 9 '20 at 19:23
  • Same here. Update Ubuntu 20.10 with some updates a few days ago, and now my snap apps won't start. I'll try use apt-get instead next time. – opyate Dec 9 '20 at 21:15
1

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
done

Re-install packages

for package_name in …
do
    sudo snap install $package_name
done

Replace the ellipses as appropriate.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.