The difference between apt update and apt upgrade is the following:
update
is just fetching the available updates for already installed packages, but doesn't change anything to these installed packages
upgrade
is effectively upgrading the update candidates to the latest versions for the currently used distro. For this reason, your permission is explicitly required to do the upgrade. The permission is not asked for the update since that doesn't change anything yet to your environment.
To know if a package is already installed, there's two options. Let's take the package sshfs as a guinea pig.
Option one, the simple option: dpkg -s sshfs
This will return the following output:
geertvc@Win10:~$ dpkg -s sshfs
Package: sshfs
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 122
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: sshfs-fuse
Version: 3.7.3-1.1build3
Depends: libc6 (>= 2.38), libfuse3-3 (>= 3.2.3), libglib2.0-0t64 (>= 2.24.0), fuse3, openssh-client
Breaks: fuse (<< 3)
Description: filesystem client based on SSH File Transfer Protocol
sshfs is a filesystem client based on the SSH File Transfer Protocol.
Since most SSH servers already support this protocol it is very easy
to set up: i.e. on the server side there's nothing to do. On the
client side mounting the filesystem is as easy as logging into the
server with ssh.
.
sshfs is FUSE (Filesystem in USErspace).
Homepage: https://github.com/libfuse/sshfs
Original-Maintainer: Bartosz Fenski <fenio@debian.org>
Option 2: dpkg-query -l sshfs
This will return the following output:
geertvc@Win10:~$ dpkg-query -l sshfs
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-===============-============-=====================================================
ii sshfs 3.7.3-1.1build3 amd64 filesystem client based on SSH File Transfer Protocol
To me, this is less informative, though...