sudo apt update is interrupted by 403 error in ubuntu - linux

I'm trying to update my repository and I keep getting an error from docker and I don't know how to fix it.
Error:
Failed to fetch https://download.docker.com/linux/ubuntu/dists/focal/InRelease
403 Forbidden [IP: 2600:9000:2251:e800:3:db06:4200:93a1 443]
E: The repository 'https://download.docker.com/linux/ubuntu focal 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'm assuming I have to add the InRelease file to docker manually but I need guidance since I'm completely new to ubuntu.

Have you added the official GPG key following the official docker installation on ubuntu?
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Assuming you are on a x86_64/amd64 system, execute:
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
I recommend you to follow that guide instead of installing by apt.

Related

N: Skipping acquire of configured file on repository 'https://download.mono-project.com/repo/ubuntu stable-focal InRelease' doesn't supp arch 'i386'

I am trying to install mono or mono-complete on Ubuntu 20.04. I have got instruction to install or setup on Ubuntu,
these are
$ sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
$ sudo apt-add-repository 'deb https://download.mono-project.com/repo/ubuntu stable-focal main'
Before, installing the mono-complete
$ sudo apt install mono-complete
I wanted to call the latest repository or packages available from server, for that I tried to update apt package
$ sudo apt update
While updating I got the following error
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://download.mono-project.com/repo/ubuntu stable-focal InRelease' doesn't support architecture 'i386'
what is problem? how to resolved this problem?
For me, on Ubuntu 20.04, changed a line in /etc/apt/sources.list from
deb https://download.mono-project.com/repo/ubuntu stable-focal main
to
deb [arch=amd64] https://download.mono-project.com/repo/ubuntu stable-focal main

apt-update in Azure Nvidia gives publickey error

I started a NVIDIA VM on AZURE and trying to do update using
sudo apt update
but gives error:
Hit:2 http://azure.archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://azure.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://azure.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:5 https://packages.microsoft.com/repos/azure-cli focal InRelease
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease
Err:1 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
Reading package lists... Done
W: GPG error: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
E: The repository 'http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease' is no longer 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.
to install the keys i used
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A4B469963BF863CC
but that gives No data error. gpg: keyserver receive failed: No data
I can run sudo apt-get upgrade but not the update.
Any help would be appreciated
Even though there is cuda installed but it still doesnt find cuda libraries, and that could be due to update.
the following worked for me
apt-key del 7fa2af80
rm /etc/apt/sources.list.d/cuda.list
rm /etc/apt/sources.list.d/nvidia-ml.list
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb
dpkg -i cuda-keyring_1.0-1_all.deb
I ran those commands in docker container, so in VM you might need to add sudo.
The error is due to Cuda repo key rotation.
The solution posted on Nvidia forms didn't work for me https://forums.developer.nvidia.com/t/notice-cuda-linux-repository-key-rotation/212771
The following worked:
apt-key del 7fa2af80
wget https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.0-1_all.deb
dpkg -i cuda-keyring_1.0-1_all.deb
Replace $distro/$arch in the following commands;ex:
debian10/x86_64
debian11/x86_64
ubuntu1604/x86_64
ubuntu1804/cross-linux-sbsa
ubuntu1804/ppc64el
ubuntu1804/sbsa
ubuntu1804/x86_64
ubuntu2004/cross-linux-sbsa
ubuntu2004/sbsa
ubuntu2004/x86_64
ubuntu2204/sbsa
ubuntu2204/x86_64
wsl-ubuntu/x86_64
and then
apt-get update
if you have an error as the following after the apt-get update
root#9c8cceaf7843:/# apt-get update
E: Conflicting values set for option Signed-By regarding source https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /: /usr/share/keyrings/cuda-archive-keyring.gpg !=
E: The list of sources could not be read.
run the following
sed -i '/developer\.download\.nvidia\.com\/compute\/cuda\/repos/d' /etc/apt/sources.list.d/*
sed -i '/developer\.download\.nvidia\.com\/compute\/machine-learning\/repos/d' /etc/apt/sources.list.d/*
apt-get update
this should solve the issue
Method 2 (Not recommended)
Alternatively, you can manually install the keys (change $distro/$arch)
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/3bf863cc.pub
To Check your distro and architecture
Disto
uname -v
or
lsb_release -a
Architecture:
uname -i
Reference:
https://forums.developer.nvidia.com/t/notice-cuda-linux-repository-key-rotation/212771
https://github.com/NVIDIA/cuda-repo-management/issues/4
https://forums.developer.nvidia.com/t/updating-the-cuda-linux-gpg-repository-key/212897/8
As others mentioned this issue is due to Cuda repo key rotation.
apt-key approach mentioned above didn't work for me.
I looked more about details on the nvidia forum and came across another method from user (olyuninv) where you have to copy the below command in Dockerfile before apt-get update as follows:
COPY ./cuda-keyring_1.0-1_all.deb cuda-keyring_1.0-1_all.deb
RUN rm /etc/apt/sources.list.d/cuda.list
&& rm /etc/apt/sources.list.d/nvidia-ml.list
&& dpkg -i cuda-keyring_1.0-1_all.deb
RUN apt-get update
Don't forget to download keys first according to your OS version from here.
You have to basically use below command:
wget https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.0-1_all.deb
(But have to replace $distro/$arch with your OS version, more details in the link)
If interested, more details might be available here on this nvidia cuda gitlab ticket.
References:
1: https://forums.developer.nvidia.com/t/invalid-public-key-for-cuda-apt-repository/212901/7
2: https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/
3: https://gitlab.com/nvidia/container-images/cuda/-/issues/158
I found the solution. This error was occuring due to NVidia GPG key rotation occurred today. All the details are provdhttps://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/

Can't install pgadmin4 repository does not have file

I was use command
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
But I was got this
Err:2 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/n/a pgadmin4 Release
404 Not Found [IP: 87.238.57.227 443]
Hit:3 https://community-packages.deepin.com/printer eagle InRelease
Hit:4 https://home-store-img.uniontech.com/appstore deepin InRelease
Reading package lists... Done
E: The repository 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/n/a pgadmin4 Release' does not have a Release file.
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.
So I can't install pgadmin
Use Deepin linux 20.2.3
I am using Linux mint, issue has been fixed using the below command.
$ sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
$ sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 main" \
> /etc/apt/sources.list.d/pgadmin4.list && apt update'
$ sudo apt update
And then, if you want desktop
$ sudo apt install pgadmin4-desktop
OR the web version:
$ sudo apt install pgadmin4-web
$ sudo /usr/pgadmin4/bin/setup-web.sh
# apt-get install curl ca-certificates gnupg
# curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
#vim /etc/apt/sources.list.d/pgdg.list
####### ADD
#deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main
# apt-get update
# apt-get install pgadmin4 pgadmin4-apache2
It should now be successfully installed.
The problem is that lsb_release -cs is not returning the codename for Deepin linux, instead is returning n/a.
Try with that dpkg --status tzdata|grep Provides|cut -f2 -d'-' to retrive the codename.
If you want a oneliner like the one you posted, here you have:
sudo sh -c 'curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add && echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(dpkg --status tzdata|grep Provides|cut -f2 -d'-') pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
For Ubuntu 22.10 and other versions that complain about apt-key being deprecated, use this:
curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
Note that "jammy" is being used here in the ftp link. You may browse through the other versions and pick the one that matches your Ubuntu installation's version
sudo apt install pgadmin4
This installs both web and desktop versions.
I experienced this error trying to upgrade my pgadmin4 to version 6. There was a problem with the certificates on my system I think, the solution was updating ca-certificates, if it's not installed you should probably install it, but that may be very unlikely that it's not installed though as it should already be there, but either way just run the command:
sudo apt install ca-certificates
I had the same problem with Debian 11, however exploring options I found this answer enter link description here and fixed the problem by installing lsb-release

Docker installation problem (ubuntu 20.04 LTS) - E: The repository 'https://download.docker.com/linux/ubuntu \ Release' does not have a Release file

I have a problem installing docker on my virtual machine.
I have followed the steps below:
1. Older versions of Docker were called docker, docker.io, or docker-engine. If these are installed, uninstall
them:
sudo apt-get remove docker docker-engine docker.io containerd runc
2. Update the apt package index
sudo apt-get update
3. install packages to allow apt to use a repository over HTTPS:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
4. Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
5. Use the following command to set up the stable repository:
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg]
https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >
/dev/null
6. Update the apt package index
sudo apt-get update
At this point - after typing sudo apt-get update - I get the following error
root#xxx:/home/xxx# sudo apt-get update
Hit:1 http://us-central1.gce.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us-central1.gce.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://us-central1.gce.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Ign:5 https://download.docker.com/linux/ubuntu \ InRelease
Err:6 https://download.docker.com/linux/ubuntu \ Release
404 Not Found [IP: 13.249.137.69 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu \ Release' does not have a Release file.
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.
Content of /etc/apt/sources.list.d/docker.list
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] download.docker.com/linux/ubuntu \ focal stable
is there a way to fix it?
Make sure the content of the /etc/apt/sources.list.d/docker.list corresponds to the output of the command in the documentation, bullet #3.
At the time of this writing executing the command on my Ubuntu 20.04 LTS results in the following content of the docker.list file:
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable
which seems to be different from that of yours.

Clickhouse Instalation: unable to locate package

I'm trying to install Clickhouse on my ubuntu 14.04 server.
I've configured sources.list with yandex repo/
deb http://repo.yandex.ru/clickhouse/trusty stable main
I've run sudo apt-get update
And I've ended up with this error.
user#server:# sudo apt-get install clickhouse-client clickhouse-server-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package clickhouse-client
E: Unable to locate package clickhouse-server-common
What's wrong?
try this
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E0C56BD4
sudo apt-get update
sudo apt-get install clickhouse-client clickhouse-server-common
if key expired
use
wget -q -O - https://repo.yandex.ru/clickhouse/CLICKHOUSE-KEY.GPG | apt-key add -
quote https://clickhouse.tech/docs/en/getting_started/install/
It is recommended to use official pre-compiled deb packages for Debian or Ubuntu.
To install official packages add the Yandex repository in /etc/apt/sources.list or in a separate /etc/apt/sources.list.d/clickhouse.list file:
deb http://repo.clickhouse.tech/deb/stable/ main/

Resources