2

I have a Ubuntu 20.04 VPS. On this server when I run sudo apt-get update && sudo apt-get upgrade, it shows there are 3 upgradable packages, but when I run the upgrade command or force upgrade nothing upgrade or install. When I check sudo apt list --upgradable it shows nothing.

What could be the reason for this? And how do I fix this issue?

root@server:~# du -sh /var/cache/apt/archives
40K     /var/cache/apt/archives
root@server:~# sudo apt-get clean
root@server:~# sudo apt-get update && sudo apt-get upgrade
Hit:1 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://download.opensuse.org/repositories/home:/virtubox:/nginx-ee/xUbuntu_20.04  InRelease [1,537 B]
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:7 http://archive.ubuntu.com/ubuntu focal-security InRelease
Hit:8 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
Hit:9 http://ppa.launchpad.net/wordops/nginx-wo/ubuntu focal InRelease
Get:10 http://mariadb.mirrors.ovh.net/MariaDB/repo/10.5/ubuntu focal InRelease [7,767 B]
Fetched 9,304 B in 1s (10.8 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
root@server:~# sudo apt list --upgradable
Listing... Done
root@server:~#
3
  • It is not necessary to use sudo at a root prompt.
    – user535733
    Jun 23, 2022 at 4:34
  • You mean if I login as root user no need to use sudo?
    – Chathu
    Jun 23, 2022 at 6:48
  • 1
    Do you have any held packages? Do you get a different result if you use apt dist-upgrade instead of apt upgrade?
    – Dan
    Jun 23, 2022 at 15:08

1 Answer 1

1

From man apt-get:

-u, --show-upgraded Show upgraded packages; print out a list of all packages that are to be upgraded. Configuration Item: APT::Get::Show-Upgraded.

so try running either:

sudo apt upgrade -u

or the same -u option can be specified in the following two froms:

sudo apt upgrade --show-upgraded

or:

sudo apt upgrade -o APT::Get::Show-Upgraded=true

alike should give you more information than sudo apt upgrade alone or sudo apt list --upgradable among which should be the names of those 3 not upgraded. packages so you can know more with:

dpkg -l package-name

and see APT’s detailed response output with:

sudo apt install package-name

Those three packages are most likely either packages with unsatisfied dependencies or packages with unspecified version numbers.

It could be also that their installation would require the removal of some installed packages and in which case, you can tell apt to curry on and upgrade those packages which will result in the removal of some other conflicting packages like so:

sudo apt full-upgrade

From man apt:

full-upgrade (apt-get(8)) full-upgrade performs the function of upgrade but will remove currently installed packages if this is needed to upgrade the system as a whole.

If you are wondering why I alternate referencing man apt-get and man apt and aren't they the same? then, please see my answer here for an explanation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .