"gpg: keyserver receive failed: connection refused" with ROS packages - ubuntu-18.04

I am trying to install ROS2 on Ubuntu 18.04.
The following command gives an error for not having the public key.
sudo apt update && sudo apt install curl gnupg2 lsb-release
Error:
Hit:1 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu bionic InRelease
Hit:2 http://de.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://de.archive.ubuntu.com/ubuntu bionic-updates InRelease
Get:4 http://de.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:6 http://packages.ros.org/ros2/ubuntu bionic InRelease [2,565 B]
Err:6 http://packages.ros.org/ros2/ubuntu bionic InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5523BAEEB01FA116
Reading package lists... Done
W: GPG error: http://packages.ros.org/ros2/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5523BAEEB01FA116
E: The repository 'http://packages.ros.org/ros2/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
I tried following ways to get the key:
sudo apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 5523BAEEB01FA116
and
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5523BAEEB01FA116
and y-ppa-manager ("Try to import all missing GPG keys")
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get install y-ppa-manager
y-ppa-manager
all the above methods give the following error
gpg: keyserver receive failed: No keyserver available
I am running Ubuntu 18.04 using a VM on a Windows 7 host.
How to avail the keyserver?

You can get a copy of the currently working key from the Dockerfile used for the nightly build of the osrf/ros2 Docker image: https://hub.docker.com/r/osrf/ros2/dockerfile
# setup ros2 keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
It's not a future-proof solution though, because I was initially using a different key for ROS2 Crystal, and then that key suddenly stopped working (we also have our own regular builds) and I got the same error as you. It turns out I had to update our build with the new keys.
I think a better solution moving forward is to just use that pre-built ROS2 environment available as a Docker image. That way, the keys get updated when they update it.
docker pull osrf/ros2:nightly

Related

How to install libapt-pkg.so.5.0 on Ubuntu 20.04

I have a dynamic library that I want to use. However, one of its dependencies is not available on my system:
$ ldd redacted_name.so | grep 'not found'
libapt-pkg.so.5.0 => not found
I tried installing libapt-pkg, and it seemed to work. Here is the output for installing:
$ sudo apt install -y libapt-pkg5.0
Reading package lists... Done
Building dependency tree
apt apt-utils libapt-pkg6.0
3 upgraded, 0 newly installed, 0 to remove and 307 not upgraded.
Need to get 2346 kB of archives.
After this operation, 42.0 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libapt-pkg6.0 amd64 2.0.9 [839 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apt amd64 2.0.9 [1294 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apt-utils amd64 2.0.9 [213 kB]
Fetched 2346 kB in 2s (1474 kB/s)
(Reading database ... 54241 files and directories currently installed.)
Preparing to unpack .../libapt-pkg6.0_2.0.9_amd64.deb ...
Unpacking libapt-pkg6.0:amd64 (2.0.9) over (2.0.2) ...
Setting up libapt-pkg6.0:amd64 (2.0.9) ...
(Reading database ... 54241 files and directories currently installed.)
Preparing to unpack .../archives/apt_2.0.9_amd64.deb ...
Unpacking apt (2.0.9) over (2.0.2) ...
Setting up apt (2.0.9) ...
Removing obsolete conffile /etc/kernel/postinst.d/apt-auto-removal ...
(Reading database ... 54240 files and directories currently installed.)
Preparing to unpack .../apt-utils_2.0.9_amd64.deb ...
Unpacking apt-utils (2.0.9) over (2.0.2) ...
Setting up apt-utils (2.0.9) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Note that it says no packages were newly installed, and also note that it lists libapt-pkg6.0 in the output.
However, then I still see that the dependency is not found:
$ ldd redacted_name.so | grep 'not found'
libapt-pkg.so.5.0 => not found
Also, when I grep for my installed packages, libapt-pkg5.0 does not appear, but for some reason libapt-pkg6.0 does appear:
$ apt list --installed | grep libapt
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libapt-pkg6.0/focal-updates,now 2.0.9 amd64 [installed]
If I try to install libapt-pkg5.0 again, it fails, mentioning that it is referred to by another package:
$ sudo apt install -y libapt-pkg5.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libapt-pkg5.0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapt-pkg5.0' has no installation candidate
How can I correctly install libapt-pkg5.0 on my Ubuntu 20.04 system?

microsoft package - Skipping acquire of configured file 'main/binary-i386/Packages'

I am trying to install azure kinect on Ubuntu 18.04 following the instructions here https://scazlab.github.io/azure_setup_guide.html. I ran these lines of code
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/ubuntu/18.04/prod
sudo apt-get update
and got the error message below
(base) kong#kong-Standard:~$ sudo apt-get update
Hit:1 http://ppa.launchpad.net/lutris-team/lutris/ubuntu bionic InRelease
Hit:2 http://packages.humanoids.kit.edu/bionic/main bionic InRelease
Hit:3 http://deb.anydesk.com all InRelease
Hit:4 http://packages.humanoids.kit.edu/bionic/testing bionic InRelease
Hit:5 https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease
Hit:6 http://gb.archive.ubuntu.com/ubuntu bionic InRelease
Hit:7 http://dl.google.com/linux/chrome/deb stable InRelease
Get:8 http://gb.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:9 http://gb.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:10 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:11 http://packages.ros.org/ros/ubuntu bionic InRelease
Fetched 252 kB in 1s (220 kB/s)
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease' doesn't support architecture 'i386'
I found the solution to similar problem at this thread Skipping acquire of configured file 'main/binary-i386/Packages'
but in my case, I am not able to find the file /etc/apt/sources.list.d/bionic.list
In the folder /etc/apt/, where you have the folder source.list.d, you should also have a file called source.list.
Check if your package is there, and modify the corresponding line as needed.
cd /etc/apt/
cat sources.list
You should have a line like
https://packages.microsoft.com/ubuntu/18.04/prod bionic main somewhere probably towards the end.
Modify the file, using nano for example :
sudo nano sources.list
and add the mention [arch=amd64]:
deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main

GPG error (EXPKEYSIG) while on apt update on Ubuntu

I was trying to update the apt repository on Ubuntu by running:
$sudo apt update
And I get the following error:
W: An error occurred during the signature verification.
The repository is not updated and the previous index files will be used.
GPG error: https://nvidia.github.io/nvidia-container-runtime/experimental/ubuntu18.04/amd64
InRelease: The following signatures were invalid: EXPKEYSIG 6ED91CA3AC1160CD NVIDIA CORPORATION (Open Source Projects) <cudatools#nvidia.com>
W: Failed to fetch https://nvidia.github.io/nvidia-container-runtime/experimental/ubuntu18.04/amd64/InRelease
The following signatures were invalid: EXPKEYSIG 6ED91CA3AC1160CD NVIDIA CORPORATION (Open Source Projects) <cudatools#nvidia.com>
I googled this error and some blogs suggests to run
$sudo apt-key list
which I did and get:
pub rsa4096 2016-06-24 [SC]
AE09 FE4B BD22 3A84 B2CC FCE3 F60F 4B3D 7FA2 AF80
uid [ unknown] cudatools <cudatools#nvidia.com>
pub rsa4096 2017-09-28 [SCE]
C95B 321B 61E8 8C18 09C4 F759 DDCA E044 F796 ECB0
uid [ unknown] NVIDIA CORPORATION (Open Source Projects) <cudatools#nvidia.com>
The following link How to solve expired key suggests to run the following command with EXPKEYSIG, but I get the following error:
$ sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 6ED91CA3AC1160CD
Executing: /tmp/apt-key-gpghome.A0899nj0Vo/gpg.1.sh --keyserver keys.gnupg.net --recv-keys 6ED91CA3AC1160CD
gpg: keyserver receive failed: No name
Really not sure how to resolve this? Any suggestion?
Thanks
For solve your problem:
delete old key
sudo apt-key del 6ED91CA3AC1160CD
delete repository info:
sudo rm /etc/apt/sources.list.d/nvidia-container-runtime.list
reinit repository as write here https://nvidia.github.io/nvidia-container-runtime/
curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey |
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list |
sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt-get update

Unable to locate package mssql-server

I'm trying to install MSSQL # Ubuntu 16.04 (as recommended # https://learn.microsoft.com/en-US/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-linux-2017)
But that's the error I'm currently facing E: Unable to locate package mssql-server
test#test-VirtualBox:~$ wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
OK
test#test-VirtualBox:~$ sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"
test#test-VirtualBox:~$ sudo apt-get update
Hit:1 http://pl.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://pl.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://pl.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:5 https://packages.microsoft.com/ubuntu/16.04/mssql-server-2017 xenial InRelease
Reading package lists... Done
test#test-VirtualBox:~$ sudo apt-get install -y mssql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mssql-server
What I'm doing wrong?
I've been trying many various Google queries like unable to locate package *mssql-server* site:github.com but nothing really solves my problem.
Thanks in advance
You may need to check whether the Ubuntu installed in your virtual machine is 32-bit or 64-bit. The packages for mssql-server are 64-bit only, and will be ignored on a 32-bit install.
check whether the Ubuntu installed in your virtual machine is 32-bit or 64-bit or ARM The packages for mssql-server are 64-bit only and it wont works with any ARM or 32 bit

OGR2OGR with MS SQL on Ubuntu 16.04

I need to access a Microsoft SQL Server with OGR2OGR from an Ubuntu Server 16.04. It is working on Microsoft, so the basic setup is fine.
My problem is that when I run my OGR2OGR command (after installing GDAL with sudo apt-get install gdal-bin):
ogr2ogr -overwrite -f MSSQLSpatial "MSSQL:server=tcp:<DATABASE_SERVER>,<PORT>;database=<DATABASE_NAME>;uid=<USER>;Pwd=<PASSWORD>;" "<IMPORT PATH FILE>" -nln "<TABLE NAME>" -progress
I get the error:
ERROR 1: Unable to initialize connection to the server for MSSQL:"DATABASE_SERVER";
[unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found
Try specifying the driver in the connection string from the list of available drivers:
I tried to install Microsoft ODBC Driver for SQL Server based on this instruction, but it cannot be installed when gdal is installed. The error is:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
msodbcsql : Depends: unixodbc-utf16 (>= 2.3.1-1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I managed to install the Microsoft ODBC driver after a while but it meant removing GDAL. So I can either have GDAL or the Microsoft ODBC driver. Is there a way to solve this problem?
Thanks for your help!
UPDATE (2017.01.03): I found the following solution and I also commented on the according article on the MSDN Blog (so far without reply) here
Install UnixODBC if not already there
sudo apt-get install unixodbc unixodbc-dev
Download from somewhere: msodbcsql-11.0.2270.0.tar.gz (it could be better to use msodbcsql-13.x.x.x.tar.gz but I was not able to find it) and
tar xvfz msodbcsql-11.0.2270.0.tar.gz
cd msodbcsql-11.0.2270.0
ldd lib64/libmsodbcsql-11.0.so.2270.0
If there are missing dependencies install them, in my case it could be done like this: (everything except the apt-get install is to fix the naming of the file by creating a link:)
sudo apt-get install libssl1.0.0 libssl-dev
cd /lib/x86_64-linux-gnu
sudo ln -s libssl.so.1.0.0 libssl.so.10
sudo ln -s libcrypto.so.1.0.0 libcrypto.so.10
Installing and cleaning up:
sudo bash ./install.sh install --force --accept-license
rm -rf /tmp/msodbcubuntu
If the Driver is not found by the tool using it, (e.g. ogr2ogr or pyodbc) edit /etc/odbcinst.ini and create a connector for [SQL Server]
[SQL Server]
Description=Microsoft ODBC Driver 11 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0
Threading=1
UsageCount=2
Shamelessly from : https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15
sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17
Verify with
ogr2ogr --formats
Which should then list:
MSSQLSpatial -vector- (rw+): Microsoft SQL Server Spatial Database

Resources