首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在18.04码头图像中添加PPA引用“月球”

在18.04码头图像中添加PPA引用“月球”
EN

Ask Ubuntu用户
提问于 2022-11-17 04:19:41
回答 1查看 371关注 0票数 0

我需要在一个非常特殊的非常老的18.04对接映像中安装gcc-10

所发生的情况是,apt根本找不到gcc-10包。

当使用涉及add-apt-repository ppa:ubuntu-toolchain-r/test的标准过程时,违规的停靠器构建中的输出显示如下:

代码语言:javascript
复制
#11 [builder  8/58] RUN add-apt-repository ppa:ubuntu-toolchain-r/test
#11 sha256:986838b1775ab762834c16c4e7b70e341339109cd31b0b06b587dd05202f0842
#11 0.809  Toolchain test builds; see https://wiki.ubuntu.com/ToolChain
#11 0.809 
#11 0.809  More info: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
#11 3.106 Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
#11 3.106 Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
#11 3.107 Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
#11 3.108 Hit:4 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  InRelease
#11 3.109 Hit:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
#11 3.228 Get:6 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu lunar InRelease [23.8 kB]
#11 3.697 Get:7 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu lunar/main amd64 Packages [9892 B]
#11 3.710 Fetched 33.7 kB in 1s (52.6 kB/s)
#11 3.710 Reading package lists...
#11 DONE 4.4s

在对该图像的上部基本图像和vanilla 18.04图像进行干净测试时,该部分的相应输出(继续查找gcc-10很好)是:

代码语言:javascript
复制
#10 [6/8] RUN add-apt-repository ppa:ubuntu-toolchain-r/test
#10 sha256:0712dfeb0955c88daac2c4b7efbb1f9f17f0d5e32eb738745e2506a8e5284504
#10 0.941  Toolchain test builds; see https://wiki.ubuntu.com/ToolChain
#10 0.941 
#10 0.941  More info: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
#10 1.733 Hit:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  InRelease
#10 1.775 Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
#10 1.785 Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
#10 1.794 Hit:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
#10 1.837 Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease
#10 1.838 Get:6 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic InRelease [20.8 kB]
#10 2.316 Get:7 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic/main amd64 Packages [50.4 kB]
#10 2.483 Fetched 71.1 kB in 1s (88.5 kB/s)
#10 2.483 Reading package lists...
#10 DONE 3.2s

正如您所看到的,有问题的行为与提到lunar而没有错误相关联。

我很好奇导致这种情况的原因,作为一个apt文盲,我想得到一些建议,说明我能做些什么来强迫它为bionic获取它,因为我觉得如果我能改变它,我就能克服安装gcc-10的问题。当然,这个特定码头形象的日子是有限的,所以我不需要一个超级健壮的解决方案。

同时,我可以做一些其他的事情,比如利用gcc-10的多阶段对接方法,在一个单独的香草码头图像中获取和使用它,然后引入工件,但我认为这里可能有一个简单的与apt相关的解决方案。

EN

回答 1

Ask Ubuntu用户

发布于 2022-11-17 04:29:52

通过建议这里解决(dockerfile代码段,测试,可能不使每个命令都有它自己的层)

代码语言:javascript
复制
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN ls -la /etc/apt/sources.list.d/
RUN cat /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-lunar.list
RUN sed 's/lunar/bionic/' /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-lunar.list > /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-bionic.list
RUN cat /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-bionic.list
RUN apt-get update
票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1441155

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档