无法在 Dockerfile 中安装 LLVM11

无法在 Dockerfile 中安装 LLVM11

这是我的 Dockerfile

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" ]

这就是问题所在

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

你可以看到我尝试在外部安装包,但没有任何问题。这让我很困惑。而且整个环境没有互联网,所以我使用代理。

答案1

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

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

因此,应该这样做:

 apt-get update && apt-get install -y liblldb-11 clang-11 lldb-11 lld-11 clangd-11

相关内容