有人知道如何将带有PPA包的Docker安装到Ubuntu20.10吗?
发布于 2020-11-01 20:42:13
你好,mire12,欢迎问Ubuntu。我希望你发现该网站有用,并继续使用Ubuntu在未来几年!
如果您查看码头安装页,您将看到,为了配置存储库,您将从其中安装docker,然后运行:
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"如果仔细观察,您将看到命令lsb_release -cs正在运行。如果您尝试在您的机器上执行此操作,您将得到发行版的代码名。对于Ubuntu20.10,这将是groovy,因为发行版的名称是Gorilla (如果您问我:P),非常酷的版本名称。我不能百分之百肯定这是你会得到的,因为我还没有更新.不管怎样,我确信lsb_release -cs的输出不是focal (20.04)、bionic (18.04)或xenial (16.04),这是docker目前支持的输出。
然后,如果您运行sudo add-apt-command,您将添加以下回购操作:deb [arch=amd64] https://download.docker.com/linux/ubuntu groovy stable
这是不存在的,因为docker只支持我前面列出的三个版本。
然后你有两个选择。
docker版本。我不知道他们是否会这样做,如果他们这样做,我不知道需要多长时间。lsb_release -cs替换为focal,以便将docker版本用于焦距Fossa。这并不保证兼容性,但我已经做了一些其他的,它的工作很好。如果你试图沿着这条路走下去,你就得跑:sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
focal \
stable"我希望这件事适合你!如果没有,您还可以尝试手动下载docker的D25文件并使用dpkg安装该文件。您可以在我在开头链接的页面(即这一个 :P)上阅读更多内容。
P.D.:
在$()命令中使用的add-apt-repository结构在Bash的术语中称为命令替换。它所做的基本上是用括号内任何内容的输出替换整个$()结构。在我们的例子中,这相当于将$(lsb_release -cs)替换为groovy。这就是为什么手动修复发行版代码名是可行的解决办法。
您可以在Bash的手册页上阅读更多关于命令替换的内容,如果安装了Bash,您可以通过运行man bash来读取命令替换。它是Ubuntu上的默认shell,所以它很可能是您常用的shell。这个主页值得一读;我通过这样做学到了很多东西:P.我引用了“命令替换”的一些内容,从手册中解释了上面的内容,这样您就不必梳理它了:
Command Substitution
Command substitution allows the output of a command to replace
the command name. There are two forms:
$(command)
or
`command`
Bash performs the expansion by executing command and replacing
the command substitution with the standard output of the command,
with any trailing newlines deleted.
Embedded newlines are not deleted, but they may be removed during
word splitting. The command substitution $(cat file) can be
replaced by the equivalent but faster $(< file).您也可以在网上阅读这里,但我发现在终端模拟器上阅读手册会更有吸引力。我喜欢这种古老的校风:
https://askubuntu.com/questions/1288835
复制相似问题