首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Dockerfile中安装LLVM11

无法在Dockerfile中安装LLVM11
EN

Ask Ubuntu用户
提问于 2022-11-21 21:24:38
回答 1查看 138关注 0票数 0

这是我的Dockerfile

代码语言:javascript
复制
FROM nvidia/cuda:10.2-devel-ubuntu18.04
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH

#ENV DEBIAN_FRONTEND noninteractive 
ENV TZ=Asia/Shanghai
env http_proxy "h/ttp://59.69.112.40:808"
env https_proxy "h/ttp://59.69.112.40:808"
env ftp_proxy "h/ttp://59.69.112.40:808"
ADD sources.list /etc/apt
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN echo exit 0 > /usr/sbin/policy-rc.d
#RUN apt-key adv –no-tty --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --assume-yes apt-utils && apt-get install uuid-runtime  && \
        apt-get install -y cmake && \
        apt-get install -y git dbus && \
        apt-get install -y dbus-user-session &&\
        apt-get install -y packagekit-tools &&\
        apt-get install -y software-properties-common &&\
        apt-get install -y  wget &&\
        echo "这是一个分界线============================" && \
        /etc/init.d/dbus start && \
        apt-get install -y cmake uuid-runtime lsb-release wget software-properties-common && \
      # wget --quiet https://golang.org/dl/go1.16.6.linux-amd64.tar.gz -O ~/go.tar.gz && \
        wget --quiet https://studygolang.com/dl/golang/go1.16.6.linux-amd64.tar.gz -O ~/go.tar.gz && \
        tar xzf ~/go.tar.gz -C /opt/ && \
        ln -s /opt/go/bin/go /usr/local/bin/go && \
        rm ~/go.tar.gz
RUN wget -L   https://apt.llvm.org/llvm-snapshot.gpg.key && \
        apt-key add llvm-snapshot.gpg.key  &&\
       # apt-get install -y clang-11 lldb-11 lld-11 && \
        apt-get install -y clang-11 lldb-11 lld-11 clangd-11 && \
       # echo "这是LLVM============================" && \
       # apt-get update && \
       # apt-get install -y liblldb-11 && \
       # apt-get install -y clang-11 lldb-11 lld-11 clangd-11 && \
        #apt-get install -y python3-liblldb-11 && \
        wget --quiet https://apt.llvm.org/llvm.sh -O ~/llvm.sh && \
        chmod +x ~/llvm.sh && \
        ~/llvm.sh 11 && \
               chmod +x ~/llvm.sh && \
        ~/llvm.sh 11 && \
        rm ~/llvm.sh
RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh -O ~/anaconda.sh && \
        /bin/bash ~/anaconda.sh -b -p /opt/conda && \
        rm ~/anaconda.sh && \
        ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
    echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
    echo "conda activate base" >> ~/.bashrc && \
    /opt/conda/bin/conda clean -afy
RUN conda install -y pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
RUN git clone https://github.com/NVIDIA/apex.git ~/apex && \
        cd ~/apex && \
        bash -c "source /opt/conda/etc/profile.d/conda.sh && conda activate && python setup.py install && pip install pyelftools" && \
        rm -rf ~/apex
RUN wget --quiet https://github.com/avast/retdec/releases/download/v4.0/retdec-v4.0-ubuntu-64b.tar.xz -O ~/retdec.tar.xz && \
        tar xf ~/retdec.tar.xz -C /opt/ && \
        ln -s /opt/retdec/bin/retdec-decompiler.py /usr/local/bin/retdec-decompiler && \
        rm ~/retdec.tar.xz
CMD [ "/bin/bash" ]

这就是问题所在

代码语言:javascript
复制
Reading package lists...
+ apt-get update
Reading package lists...
+ PKG='clang-11 lldb-11 lld-11 clangd-11'
+ [[ 0 -eq 1 ]]
+ apt-get install -y clang-11 lldb-11 lld-11 clangd-11
Reading package lists...
Building dependency tree...
Reading state information...
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:
 lldb-11 : Depends: liblldb-11 (>= 1:9~svn298832-1~) but it is not going to be installed
           Depends: python3-lldb-11 but it is not going to be installed

你可以看到我试图在外面安装软件包,但没有任何问题。这让我很困惑。而整个env没有互联网,所以我使用代理。

EN

回答 1

Ask Ubuntu用户

发布于 2022-11-22 09:38:25

您发布的Dockerfile已经注释了行,所以我不确定您想要执行什么,什么不想执行。

但是,您应该在安装包之前安装依赖项<#>,并且您也应该在安装之前执行apt-get update,因为您的源代码已经更改,然后再次尝试安装。

所以,我们应该这样做:

代码语言:javascript
复制
 apt-get update && apt-get install -y liblldb-11 clang-11 lldb-11 lld-11 clangd-11
票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1441869

复制
相关文章

相似问题

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