Check for pending upgrades on Ubuntu.

Update package index.

$ sudo apt update
Hit:1 bullseye InRelease
Get:2 bullseye-security InRelease [48.4 kB]           
Get:3 bullseye InRelease [23.6 kB]                                                     
Get:4 bullseye-updates InRelease [44.1 kB]                                                      
Get:5 bullseye-security/main armhf Packages [218 kB]                              
Get:6 bullseye-security/main arm64 Packages [218 kB]
Get:7 bullseye-security/main Translation-en [145 kB]
Get:8 bullseye InRelease                    
Get:9 bullseye/main arm64 Packages [302 kB]    
Get:10 bullseye/main armhf Packages [7,110 B]
Get:11 bullseye/main armhf Packages [311 kB]
Get:12 bullseye/main all Packages [354 B]
Get:13 bullseye/main arm64 Packages [7,105 B]
Fetched 1,332 kB in 2s (760 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
21 packages can be upgraded. Run 'apt list --upgradable' to see them.

I will use apt-check utility provided by the update-notifier-common package.

$ dpkg-query -S /usr/lib/update-notifier/apt-check       
update-notifier-common: /usr/lib/update-notifier/apt-check
$ apt info update-notifier-common
Package: update-notifier-common
Priority: optional
Section: gnome
Source: update-notifier
Origin: Ubuntu
Maintainer: Michael Vogt <>
Installed-Size: 1 503 kB
Pre-Depends: dpkg (>=, apt (>= 1.1~)
Depends: python3:any, python3-apt, python3-dbus, python3-debian, python3-debconf | debconf (<< 1.5.64~), python3-distro-info, lsb-release, patch, update-manager-core (>= 1:17.04.2)
Recommends: libpam-modules (>= 1.0.1-9ubuntu3)
Suggests: policykit-1
Replaces: update-notifier (<< 0.75.1)
Task: ubuntu-desktop-minimal, ubuntu-desktop, cloud-image, server, ubuntu-server-raspi, xubuntu-desktop, lubuntu-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi
Phased-Update-Percentage: 90
Download-Size: 185 kB
APT-Sources: jammy-updates/main amd64 Packages
Description: Files shared between update-notifier and other packages
 Apt setup files and reboot notification scripts shared between
 update-notifier and other packages, notably for server use cases.

Display usage information.

$ /usr/lib/update-notifier/apt-check --help
Usage: apt-check [options]

  -h, --help            show this help message and exit
  -p, --package-names   Show the packages that are going to be
  --human-readable      Show human readable output on stdout
                        Return the time in days when security updates are
                        installed unattended (0 means disabled)

Display heman readable summary.

$ /usr/lib/update-notifier/apt-check --human-readable
9 updates can be applied immediately.
4 of these updates are standard security updates.
To see these additional updates run: apt list --upgradable

List upgradeable packages.

$ /usr/lib/update-notifier/apt-check --package-names

Display the number of updates that can be applied immediately and the number of included standard security updates using machine friendly format.

$ /usr/lib/update-notifier/apt-check