Not being able to update ubuntu on Azure VM's - azure

Problem:
I tried to create VM's and then update it to install the azure-cli but am facing this NO_PUBKEY error.
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
My Ubuntu Configuration:
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
Steps to recreate:
Create a Azure VM
Image:
Size:
And the rest as the default configurations
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash &
sudo apt-get update
What other things I did to solve this problem:
Created another VM with same configuration and got the same problem. So I think that the problem was not only to that particular VM

For the error message, you could add missing keys by executing the following command for each key from the log file:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF
Note: the actual key server name and the key mentioned in the error message should be used in the command above.
After adding the missing keys, you could try to install the azure-cli again.
For more information, you could refer to this.

Okay, after much research I found out that the problem existed only on certain Nvidia Images and not on the barebone Linux images. So I figured that there must be something wrong with the trusted key itself. So, these are the steps that I did in order to fix the issue.
sudo rm -rf /etc/apt/trusted.gpg.d/microsoft.gpg
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF
sudo apt-get update
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
Now you will be able to update the instance
Resources:
[1] http://forums.debian.net/viewtopic.php?t=130558

Related

Getting Invalid Signature error while installing MySQL 5.7 on Ubuntu 22.04 LTS?

I need to install mysql 5.7 on Ubuntu 22.04. I followed the following steps :
- wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
- sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb
- Selected the option MySQL Server and Cluster mysql-5.7 -> ok.
- sudo apt-get update
The following error comes :
Err:1 http://repo.mysql.com/apt/debian jessie InRelease
The following signatures were invalid: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering <mysql-build#oss.oracle.com>
E: The repository 'http://repo.mysql.com/apt/debian jessie InRelease' is not signed.
And after running the command : "apt-cache policy mysql-server" , the list does not include 5.7
Tried to run the following commands to get the key :
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8C718D3B5072E1F5
Checked the command : sudo apt-key list
It shows the mysql key is expired. Tried deleting again getting the key , but no gains
Tried the following keystores, but again no gains :
hkp://pgp.mit.edu:80
hkps://pgp.mit.edu
hkps://keyserver.ubuntu.com
hkp://p80.pool.sks-keyservers.net:80
Tried the following links :
https://askubuntu.com/questions/1120363/mysql-ppa-invalid-signature/1141364#1141364
https://stackoverflow.com/questions/73250312/how-can-i-install-mysql-5-7-on-ubuntu-22-04-lts
Kindly help
Regards
Anuradha
I have fixed this issue for me with a small trick.What we actually need to do is edit our /etc/apt/sources.list with the source.list available in Ubuntu 20.4. eg. you will get an entry in ubuntu 22
"deb http://in.archive.ubuntu.com/ubuntu/ jammy main restricted"
so just replace jammy by bionic in all places in /etc/apt/sources.list then save and try apt update after then just simply try to install myslq sudo apt install -fmysql-server=5.7* can use this command and now you can able to install mysql successfully.
Once you are installed and mysql is up and running just make sure to revert the /etc/apt/sources.list file.
Reason for doing this is in Ubuntu 22.04 it is not bale to install all required dependencies for mysql5.7 so by editing source.list we allow to install all req dependencies.
Note: Don't use upgrade in while doing this all and make sure you revert the source.list file after myslq installed and plz mark mysql on hold for upgrade because whenever you run an upgrade command it will upgrade the mysql version to 8 from 5.
Hope this work for you.
Thanks

The following signatures couldn't be verified because the public key is not available while updating sudo apt update

I am trying to install some application on Ubuntu 20.04, for that I am trying to run command on terminal
$ sudo apt update
and I have got following error
Err:1 http://dl.google.com/linux/chrome/deb stable InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 78BD65473CB3BD13
I am got the same issue while running the below command
$ sudo apt update
In your case, you can follow below option to resolved these issue.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 78BD65473CB3BD13
Or
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 78BD65473CB3BD13
In first option, we don't have to decide which port should be or you can go with second option. Either way, both will work.

I have an error when running apt-get update

In my Jenkins pipeline, I am trying to run a build using the Docker image maven:3.5.4-jdk-10-slim as my Jenkins agent. Inside it, I run the command apt-get update. However, when I do, I get the following error:
Get:1 http://deb.debian.org/debian sid InRelease [165 kB]
Err:1 http://deb.debian.org/debian sid InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9
I searched online for help on this error, and it was advised I add the following 2 commands before my update command so I can add the public keys for apt to verify:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9
However, now I get a different error when running those commands:
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
I also searched for help on that error, and I was advised to run this before the 2 new commands : apt-get update && apt-get install -y gnupg
But I can't run apt-get update. How can I fix this?
I encountered the same problem. For me, the following had solved the issue.
I realized, that I was using a very old version of docker:18-dind to build images in my CI. This 18-dind was more like a puppet, that built and pushed images. It was able to build images, except that based on Ubuntu 22, for example, eclipse-temurin.
I updated my Docker build puppet from 18-dind to 20-dind and it solved the issue.

install Azure client on ubuntu virtual machine public key is not available

I am following this link to install Azure client on a Ubuntu virtual machine on Azure. This virtual machine is probably on a private network and behind a firewall.
https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-apt?view=azure-cli-latest
I have tried
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
and got this error:
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
And also tried Manual install instructions and this gives the same error on the first command
sudo apt-get update
Then I googled the error and tried this:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF
This gives me:
Executing: /tmp/apt-key-gpghome.weXEf8jZ7m/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF
gpg: keyserver receive failed: End of file
And also tried this:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EB3E94ADBE1229CF
And got this:
sudo: unable to resolve host -0: Bad message
Executing: /tmp/apt-key-gpghome.DTxXTpZKKN/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EB3E94ADBE1229CF
gpg: key EB3E94ADBE1229CF: 6 signatures not checked due to missing keys
gpg: key EB3E94ADBE1229CF: "Microsoft (Release signing) <gpgsecurity#microsoft.com>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
I then rerun the sudo apt-get update but received the same error as before.
I had the same problem just 2 days before and asked the same question too. I have found the solution btw and here it is:
Okay, after much research I found out that the problem existed only on certain Nvidia Images and not on the barebone Linux images. So I figured that there must be something wrong with the trusted key itself. So, these are the steps that I did in order to fix the issue.
sudo rm -rf /etc/apt/trusted.gpg.d/microsoft.gpg
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF
sudo apt-get update
Now you will be able to update the instance
Resources:
[1] http://forums.debian.net/viewtopic.php?t=130558

Installing R from CRAN Ubuntu repository: No Public Key Error

I am on R version 2.13 and would like to update to a newer version in order to use some packages that depend on R>= 2.14.
I have the line to my sources.list file as found described here. I then navigate to the terminal and type:
sudo apt-get update
and get the following error when trying to update R on the CRAN mirror closest to me:
Reading package lists... Done
W: GPG error: http://lib.stat.cmu.edu oneiric/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
Any idea how to debug this error?
The simplest solution that worked for me was from Emre Sahin in this thread:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
Like #Ben Bolker commented (sorry I hijacked your commented, but the correct answer was not yet posted), in the description of the debian package repo there is a section secure apt which says:
SECURE APT
The Debian backports archives on CRAN are signed with the key of
"Johannes Ranke (CRAN Debian archive) " with key
ID 381BA480. You can fetch this with
gpg --keyserver subkeys.pgp.net --recv-key 381BA480 or
alternatively, using another key server,
gpg --keyserver pgp.mit.edu --recv-key 381BA480 If this doesn't
work, it might be due to a firewall blocking port 11371.
Alternatively, you can search for 0x381BA480 at
http://keyserver.noreply.org/ or http://pgp.mit.edu/ and copy the key block into a plain text
file, named, for instance, jranke_cran.asc.
If receiving the key with gpg did work, you need to export it to a
text file
gpg -a --export 381BA480 > jranke_cran.asc In both cases you need
to make the key known to the apt system by running
apt-key add jranke_cran.asc as root.
If you have not already done this, this will probably fix your issue.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYID
and replace KEYID with the number shown in the error message.
Thanks to Philipp Burckhardt, I got it fixed.
Try this:
gpg --keyserver pgpkeys.mit.edu --recv-key 51716619E084DAB9
gpg -a --export 51716619E084DAB9 | sudo apt-key add -
I encountered the same issue and the only solution I found, perhaps due to a firewall, was to use the helpful Y PPA Manager. The two steps below outline has worked on Ubuntu 15.04.
1) First install the Y PPA Manager:
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get update
sudo apt-get install y-ppa-manager
2) Then fetch missing keys by running the Y PPA Manager:
y-ppa-manager
Click "Advanced"
Next, click "Try to import missing GPG keys"
Finally, update again to check if it works:
sudo apt-get update
Here is a step-by-step answer that might be easier to follow.
Fetch the key (the last 8 digits in the warning message):
gpg --keyserver pgp.mit.edu --recv-key E084DAB9
The output should look like this:
gpg: requesting key E084DAB9 from hkp server pgp.mit.edu
gpg: key E084DAB9: public key "Michael Rutter <marutter#gmail.com>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
Add the key (superuser access required):
gpg -a --export E084DAB9 | sudo apt-key add -
Update the repositories:
sudo apt-get update
There should be no warning about the missing key now.
Much like others posted above, this one-liner seems to work well on Debian 6:
sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 381BA480
Executing: gpg --ignore-time-conflict --no-options
--no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys 381BA480
gpg: requesting key 381BA480 from hkp server pgp.mit.edu
gpg: key 381BA480: public key "Johannes Ranke (CRAN Debian archive) <jranke#uni-bremen.de>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1
This solved my problem
$ wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add
It had to use a longer identifier for the key.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
The issue seems to be a duplicated key ID on the server.
See the instructions from the CRAN and more background info on this post by Michael Rutter.
The easiest fix is to simply follow the instructions from https://cran.r-project.org/bin/linux/ubuntu/. Run this as sudo:
# update indices
apt update -qq
# install two helper packages we need
apt install --no-install-recommends software-properties-common dirmngr
# add the signing key (by Michael Rutter) for these repos
# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# Fingerprint: 298A3A825C0D65DFD57CBB651716619E084DAB9
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

Resources