Home > Enterprise >  installing varnish in a github action
installing varnish in a github action

Time:12-24

i try to install varnish in a github action for https://github.com/FriendsOfSymfony/FOSHttpCache/pull/500/

bash -c 'curl -L https://packagecloud.io/varnishcache/varnish66/gpgkey | sudo apt-key add -'
bash -c 'curl -L "https://packagecloud.io/install/repositories/varnishcache/varnish66/config_file.list?os=ubuntu&dist=focal&source=script" | sudo tee -a /etc/apt/sources.list'
sudo apt-get update
sudo apt-get install -t focal varnish

the key is installed, but apt-get update still fails with

...
Get:19 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [18.9 kB]
Get:20 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [7492 B]
Get:21 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [636 B]
Get:22 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 Packages [121 kB]
Err:7 https://packagecloud.io/varnishcache/varnish66/ubuntu focal InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 45DACFFDB8AFA6AA
Get:23 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1069 kB]
...
W: GPG error: https://packagecloud.io/varnishcache/varnish66/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 45DACFFDB8AFA6AA
E: The repository 'https://packagecloud.io/varnishcache/varnish66/ubuntu focal InRelease' is not signed.

i tried installing the key that apt is missing with sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 45DACFFDB8AFA6AA which did something and produced the output gpg: key 0BAC19E3F6C90CD5: public key "https://packagecloud.io/varnishcache/varnish66 (https://packagecloud.io/docs#gpg_signing) <[email protected]>" imported (note that the key here is not the same - not familiar enough with apt keys to tell if that is expected or a problem)

any idea how i could get this to install?

CodePudding user response:

a coworker found out what i got wrong: the varnish sources list file specifies the path to the keyring where the gpg key is expected, but i had apt-key add the key to the default keyring.

we found https://packagecloud.io/varnishcache/varnish66/install which seems like the clean solution to the problem, a script that installs key and source entry in a consistent way. i will use the install script now.

CodePudding user response:

I created an official tutorial on the Varnish Developer Portal that explains how to install Varnish using packages.

Have a look at https://www.varnish-software.com/developers/tutorials/#installations for an overview of distributions.

Here's an example for Ubuntu: https://www.varnish-software.com/developers/tutorials/installing-varnish-ubuntu/.

  • Related