Ubuntu tips and tricks: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
== The following packages have been kept back ==
== The following packages have been kept back<ref>https://askubuntu.com/questions/601/the-following-packages-have-been-kept-back-why-and-how-do-i-solve-it</ref> ==
There are 3 categories of reasons for packages being kept back during <code>apt upgrade</code>
There are 3 categories of reasons for packages being kept back during <code>apt upgrade</code>


Line 7: Line 7:
  <code>sudo apt-mark hold <package></code>
  <code>sudo apt-mark hold <package></code>
To list all packages marked on hold or find out if a package is on hold use:
To list all packages marked on hold or find out if a package is on hold use:
  <code>apt-mark showhold
  <apt-mark showhold
  apt-mark showhold <package></code>
  apt-mark showhold <package></code>
To remove a hold on a package and allow it to be upgraded:
To remove a hold on a package and allow it to be upgraded:
Line 20: Line 20:
The important parts are the <code>Depends</code> and <code>Recommends</code> package lists. If there are new packages in those lists in the new version of the kept back package, apt won't automatically upgrade it
The important parts are the <code>Depends</code> and <code>Recommends</code> package lists. If there are new packages in those lists in the new version of the kept back package, apt won't automatically upgrade it


# To upgrade the package and install any new "Recommended" packages (i.e. as if newly installed with apt install <package>, use --with-new-pkgs:<syntaxhighlight lang="bash">
$sudo apt upgrade --with-new-pkgs <package>
(Tip: add --dry-run to see what will happen before doing it)
</syntaxhighlight>
# To upgrade the package without installing any newly added "Recommended" packages, use --only-upgrade.
<syntaxhighlight lang="bash">
$sudo apt install --only-upgrade <package>
</syntaxhighlight>


 
* Phased updates<br />You can check for phased updates with: <code>sudo apt -o APT::Get::Always-Include-Phased-Updates=true upgrade --dry-run</code>


== The following security updates require Ubuntu Pro with 'esm-infra' enabled ==
== The following security updates require Ubuntu Pro with 'esm-infra' enabled ==

Revision as of 08:25, 30 July 2023

The following packages have been kept back[1]

There are 3 categories of reasons for packages being kept back during apt upgrade

  • It is marked as held back

apt-mark can do this:

sudo apt-mark hold <package>

To list all packages marked on hold or find out if a package is on hold use:

<apt-mark showhold
apt-mark showhold <package>

To remove a hold on a package and allow it to be upgraded:

sudo apt-mark unhold <package>
  • apt detects a dependency change

This will tell you the current and candidate upgrade versions of the package:

$ apt list <package>

we can figure out the changed dependencies with apt show:

apt show <package>=<old version> <package>=<new version>

The important parts are the Depends and Recommends package lists. If there are new packages in those lists in the new version of the kept back package, apt won't automatically upgrade it

  1. To upgrade the package and install any new "Recommended" packages (i.e. as if newly installed with apt install <package>, use --with-new-pkgs:
    $sudo apt upgrade --with-new-pkgs <package>
    (Tip: add --dry-run to see what will happen before doing it)
    
  2. To upgrade the package without installing any newly added "Recommended" packages, use --only-upgrade.
$sudo apt install --only-upgrade <package>
  • Phased updates
    You can check for phased updates with: sudo apt -o APT::Get::Always-Include-Phased-Updates=true upgrade --dry-run

The following security updates require Ubuntu Pro with 'esm-infra' enabled

the file /etc/apt/apt.conf.d/20apt-esm-hook.conf provides the hook that calls the marketing message generation. Removing that is an option[2]

sudo mv /etc/apt/apt.conf.d/20apt-esm-hook.conf /var/tmp

after then run apt upgrade the message does not show

How to cleanly remove x11[3]

sudo apt purge 'x11-*'
sudo apt autoremove

apt-get update “the following signatures couldn’t be verified because the public key is not available”

$ sudo apt update
Err:5 https://packages.cloud.google.com/apt kubernetes-xenial InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05
  
#need to add the missing Key B53DC80D13EDEF05
$sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B53DC80D13EDEF05
Executing: /tmp/apt-key-gpghome.xfmtcCbrXz/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys B53DC80D13EDEF05
gpg: key B53DC80D13EDEF05: 1 duplicate signature removed
gpg: key B53DC80D13EDEF05: public key "Rapture Automatic Signing Key (cloud-rapture-signing-key-2022-03-07-08_01_01.pub)" imported
gpg: Total number processed: 1
gpg:               imported: 1

#now update will be successful

References