4

On a brand new install of ubuntu server 20.04, running apt-offline to install the first update fails with ERROR: Path for keyring is invalid: /etc/apt/trusted.gpg

The offline machine is a VM built with a recently downloaded image ubuntu-20.04.4-live-server-amd64.iso. Once the VM was running two packages were manually installed and the sig file created:

    sudo dpkg -i python3-magic_0.4.15-3_all.deb
    sudo dpkg -i apt-offline_1.8.2-1_all.deb
    sudo apt-offline set initial-update-01.sig --update

online machine:

     sudo apt-offline get initial-update-01.sig --bundle initial-update-01-bundle.zip

offline machine:

sudo apt-offline install initial-update-01-bundle.zip
ERROR: Path for keyring is invalid: /etc/apt/trusted.gpg

In trying to resolve the error and because debian-archive-keyring is listed as a recommended dependency of apt-offline, this was downloaded and manually installed:

 sudo dpkg -i debian-archive-keyring_2019.1ubuntu2_all.deb

The error remains and is still the same when attempting to install the bundle.

Apt-offline is looking for /etc/apt/trusted.gpg which does not exist but there is a directory /etc/apt/trusted.gpg.d containing several gpg files ubuntu-keyring-2012-archive.gpg ubuntu-keyring-2012-cdimage.gpg ubuntu-keyring-2018-archive.gpg.

It looks to be a matter of somehow telling apt-offline to use /etc/apt/trusted.gpg.d, is this correct and if so how to do so? If not, how can I get past the keyring error listed?

Edit 1: this post refers to ubuntu 18.04. Also, apt-offline seems to be a simple and current way to maintain an offline install but open to other relatively simple alternatives.

Edit 2:

  1. I saw somewhere that incorrect system time impacts gpg. NTP is not configured but the clock is roughly correct.

  2. Having run sudo apt-offline install initial-update-01-bundle.zip the next step is to create a new signature file using sudo apt-offline set upgrade.sig --upgrade. This new signature file is identical to the previous one so it looks like nothing has been updated.

  3. Revised title from [apt-offline "path for keyring is invalid" error] aiming to be more descriptive

gloopy
  • 43
  • 4

1 Answers1

3

I too had this problem with Ubuntu 20.04. Now that 22.04 is available, I discovered that the problem is solved.

So, I visited https://packages.ubuntu.com/jammy/all/apt-offline/download and downloaded the deb file for apt-offline and installed it to a pair of 20.04 virtual machines I was using for testing. The test was successful. No warnings about a keyring. I first tested by installing htop. My second test was to install gcc.

Note: one VM has Internet access and the other doesn't have a network at all. Both machines have access to a shared directory on the host computer. (I used that to simulate using a USB drive / CD disk).

The version of apt-offline that did not work is 1.8.2. The version that did work is 1.8.4.

Hugh McCurdy
  • 101
  • 6