Score:1

Command to check if any updates are pending in Software Updater?

rs flag

Sorry if this is a basic question, I did try searching for an answer but I couldn't locate what I was looking for.

Could someone please tell me is there any way I can via command line return a binary yes/no or number count of any pending updates within Software Updater?

Im trying to trigger a flow within my home automation package to proactively alert me when the system needs updating.

PRETTY_NAME="Ubuntu 22.04.1 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.1 LTS (Jammy Jellyfish)"

thanks

Craig avatar
rs flag
Sorry my mistake, I've added that info to the original question. thanks
ar flag
You need two commands: First, `sudo apt update ` for the number of available upgrades from the repositories. Second, you need `sudo snap refresh --list` this will give you a list of snap apps that are upgradable. You will have to pipe these outputs through something else to get a Yes/No or a number of updates.
stumblebee avatar
mx flag
Craig - Please don't forget to comment, Vote or accept my answer if it solves your question. Thanks!
Score:0
mx flag

To see the current number count of any updates available in Software Updater run:

/usr/lib/update-notifier/apt-check --human-readable | grep immediately | awk '{ print $1 }'

The full simplified output can be viewed by running:

/usr/lib/update-notifier/apt-check --human-readable
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.