Follow

My fresh Ubuntu install says I need some updates. Okay, but there are some problems.

First, it tells me to close the snap-store to update it, but the snap-store is not open.

1/

Okay, I'll try opening the snap-store to look for updates.

"This is getting out of hand! Now there are two of them!" -Nute Gunray

2/

Show thread

Okay, let's try the gnome update.

It appears to be Schrödinger's update: available and not available at the same time.

3/

Show thread

How about the snap-store update? Well, you can't update that while the snap-store is running.

Any ideas on how to install these updates?

/4

Show thread

Maybe use Software Updater? Nope, it doesn't think there are updates.

Are there? If so, how do I apply them? If not, how do I remove the notifications from the list in the snap store?

/5

Show thread

@peterdrake Hmm, all I can think of is to use the good old command line:

sudo apt update && sudo apt upgrade && sudo snap refresh

@JensHannemann That happily ran, but the snap store and the notifications under the clock both think I still have updates.

I assume the &&s in your command are short-circuited so the later parts run only if the first parts ... succeed? My only confusion here is that I would expect a process to return 0 (false) if it succeeded.

@peterdrake You are right. And yes, as counterintuitive as it is, in POSIX and may other systems, a non-zero return code indicates an error and a zero return code indicates success. That's why the traditional C hello world program ends with `return 0;`.

en.wikipedia.org/wiki/Exit_sta

@JensHannemann

Its actually very intuitive when you consider there is only one way for a thing to succeed where as there are many ways to fail :)

@peterdrake

@freemo @peterdrake True observation. I seem to remember a discussion way back, when people were suggesting positive exit codes for success and negative ones for failure, but that never caught on.

@JensHannemann @freemo Okay, but then how does the && work? Is it interpreting the 0 as true?

@peterdrake @freemo Yeah, pretty much. It's just one of those historical inconsistencies that have developed over time. I just keep my sanity by simply not thinking about it in terms of expression logic in this case.

@JensHannemann That's why I'm confused. If you run

foo && bar

and foo returns 0 (because it succeeded), won't the shell essentially say, "Welp, the first part of this expression is false, so no point in running the second part!"?

@peterdrake No, because the shell does not think of that as an expression, but rather a conditional sequence of commands. You can request evaluation of an expression explicitly. Bash knows the `eval` command for that, but there are different ways for different shells.

@peterdrake I had to do this the other day. I don't remember what I did for certain but I'm pretty sure I ran "killall snap-store" and then did the "snap update snap-store" (Or whatever the command is, don't remember off the top of my head)

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.