Score:2

Getting 'Unable to locate package docker-ce' in Ubuntu 20.04 LTS

do flag
Zak

So I'm fairly new to Docker and Ubuntu and I'm trying to create a mail server by following this tutorial in Youtube. But I'm unable to do so because I keep getting some errors. And I don't know what each of these mean. I am also following the official docs from Docker website to install docker in Ubuntu and here are the output I get from each commands:

sudo apt-get install ca-certificates curl gnupg lsb-release


Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20210119~20.04.2).
curl is already the newest version (7.68.0-1ubuntu2.7).
gnupg is already the newest version (2.2.19-3ubuntu2.1).
lsb-release is already the newest version (11.1.0ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg


File '/usr/share/keyrings/docker-archive-keyring.gpg' exists. Overwrite? (y/N) y
echo \
  "deb [arch=$(dpkg --print-architecture) 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

sudo apt-get update


Get:1 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
Err:1 https://download.docker.com/linux/ubuntu focal InRelease
  Couldn't create temporary file /tmp/apt.conf.EhsiyX for passing config to apt-key
Ign:2 http://rpms.litespeedtech.com/debian focal InRelease
Get:3 http://rpms.litespeedtech.com/debian focal Release [1,646 B]
Get:4 https://deb.nodesource.com/node_14.x focal InRelease [4,583 B]
Get:5 http://rpms.litespeedtech.com/debian focal Release.gpg [836 B]
Err:4 https://deb.nodesource.com/node_14.x focal InRelease
  Couldn't create temporary file /tmp/apt.conf.cJQw53 for passing config to apt-key
Ign:5 http://rpms.litespeedtech.com/debian focal Release.gpg
Get:6 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Ign:7 http://ppa.launchpad.net/certbot/certbot/ubuntu focal InRelease
Get:8 http://us.archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Err:6 http://security.ubuntu.com/ubuntu focal-security InRelease
  Couldn't create temporary file /tmp/apt.conf.H2ZQrn for passing config to apt-key
Err:9 http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release
  404  Not Found [IP: 91.189.95.85 80]
Err:8 http://us.archive.ubuntu.com/ubuntu focal InRelease
  Couldn't create temporary file /tmp/apt.conf.TKkNRz for passing config to apt-key
Get:10 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Err:10 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
  Couldn't create temporary file /tmp/apt.conf.kdYADH for passing config to apt-key
Get:11 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Err:11 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
  Couldn't create temporary file /tmp/apt.conf.Z56AhL for passing config to apt-key
Reading package lists... Done
W: GPG error: https://download.docker.com/linux/ubuntu focal InRelease: Couldn't create temporary file /tmp/apt.conf.EhsiyX for passing config to apt-key
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.
W: GPG error: https://deb.nodesource.com/node_14.x focal InRelease: Couldn't create temporary file /tmp/apt.conf.cJQw53 for passing config to apt-key
E: The repository 'https://deb.nodesource.com/node_14.x 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.
W: GPG error: http://rpms.litespeedtech.com/debian focal Release: Couldn't create temporary file /tmp/apt.conf.mT1cgh for passing config to apt-key
E: The repository 'http://rpms.litespeedtech.com/debian focal Release' 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.
W: GPG error: http://security.ubuntu.com/ubuntu focal-security InRelease: Couldn't create temporary file /tmp/apt.conf.H2ZQrn for passing config to apt-key
E: The repository 'http://security.ubuntu.com/ubuntu focal-security 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.
E: The repository 'http://ppa.launchpad.net/certbot/certbot/ubuntu focal 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.
W: GPG error: http://us.archive.ubuntu.com/ubuntu focal InRelease: Couldn't create temporary file /tmp/apt.conf.TKkNRz for passing config to apt-key
E: The repository 'http://us.archive.ubuntu.com/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.
W: GPG error: http://us.archive.ubuntu.com/ubuntu focal-updates InRelease: Couldn't create temporary file /tmp/apt.conf.kdYADH for passing config to apt-key
E: The repository 'http://us.archive.ubuntu.com/ubuntu focal-updates 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.
W: GPG error: http://us.archive.ubuntu.com/ubuntu focal-backports InRelease: Couldn't create temporary file /tmp/apt.conf.Z56AhL for passing config to apt-key
E: The repository 'http://us.archive.ubuntu.com/ubuntu focal-backports 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.
W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:62 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:62 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:62 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:62 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:62 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:62 and /etc/apt/sources.list.d/docker.list:1
sudo apt-get install docker-ce docker-ce-cli containerd.io


Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package docker-ce
E: Unable to locate package docker-ce-cli
E: Unable to locate package containerd.io
E: Couldn't find any package by glob 'containerd.io'
E: Couldn't find any package by regex 'containerd.io'

These are all the outputs I am getting and I don't know what else I should do or try but I badly need to setup my mail server. Someone please help me out. It'd be a big help.

UPDATE

So after contacting support they have restored the server to a previous working state. Then I updated/upgraded with sudo apt update and sudo apt upgrade. It completed but then after I tried running update again and I get this:

@server1:~$ sudo apt update
Hit:1 https://deb.nodesource.com/node_14.x focal InRelease
Ign:2 http://ppa.launchpad.net/certbot/certbot/ubuntu focal InRelease
Err:3 http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release
  404  Not Found [IP: 91.189.95.85 80]
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:5 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:6 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:7 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/certbot/certbot/ubuntu focal 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.

I think something is wrong with the new updates and all.

Liso avatar
sd flag
Can you try create a file on `/tmp` ? Something like `touch /tmp/file` would be sufficient
Zak avatar
do flag
Zak
@Liso hey. I can try. Can you tell me in which folder I should create that file?
Zak avatar
do flag
Zak
I have been getting this type of /tmp errors since yesterday when I tried 3-4 different types of tutorials to create a mail server.
Liso avatar
sd flag
Just launch a terminal, run `touch /tmp/file`. A failed run should produce an error, paste it to here.
Zak avatar
do flag
Zak
I don't have a GUI for my VPS. But I still ran that and got this: ```touch: cannot touch '/tmp/file': Bad message ```
Zak avatar
do flag
Zak
@N0rbert No sorry. Just tried some of the solutions there.
karel avatar
sa flag
Does this answer your question? [What can I do if a repository/PPA does not have a Release file?](https://askubuntu.com/questions/866901/what-can-i-do-if-a-repository-ppa-does-not-have-a-release-file) and [How can I fix apt error "W: Target Packages ... is configured multiple times"?](https://askubuntu.com/q/760896/)
Zak avatar
do flag
Zak
I tried the solution from the chosen answer and removed the duplicates. But it is still the same. I'm thinking it could be because of my Ubuntu OS. What do you think?
Zak avatar
do flag
Zak
@Liso Any solution to the problem?
Zak avatar
do flag
Zak
@N0rbert Any solution to the problem?
N0rbert avatar
zw flag
Please read and follow the documentation.
Zak avatar
do flag
Zak
@N0rbert I did. I can't even update anymore cause it shows some errors which is mentioned in OP
Liso avatar
sd flag
`Bad message` imply there is corrupted filesystem/drive, provided it is a vps service- can you try rebuilding it? If the issue persist, I suggest you to report this problem to your vps support.
Zak avatar
do flag
Zak
@Liso Yes I'll contact support but I'm not sure if they'll help as I got a self-managed one. But can you please tell me if I can back up everything I have in there so that I don't lose my apps, security mods and nginx setups?
Liso avatar
sd flag
Of course, make sure there are no important files left behind. Note that my recommendation is based on the fact you got 'bad message' error, as under no circumstances should a normal machine have this problem- especially for a server.
Zak avatar
do flag
Zak
Oh understood. Support is restoring my VPS as we speak. But what is the easiest and simplest way for noob like me to back up my VPS?
Liso avatar
sd flag
There's many resource of how to backup a Ubuntu system, personally I like `rsync` mainly because of how powerful it is https://help.ubuntu.com/community/BackupYourSystem
Zak avatar
do flag
Zak
@Liso I have updated the OP with the current situation. They have restored the server but then update doesn't get completed properly. Can you please check the OP?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.