programing

lsb_release: 최신 Ubuntu Docker 컨테이너에 명령을 찾을 수 없습니다.

starjava 2023. 10. 19. 21:48
반응형

lsb_release: 최신 Ubuntu Docker 컨테이너에 명령을 찾을 수 없습니다.

빨리 테스트를 해보고 싶어서요그래서 도커 컨테이너를 실행했는데 어떤 버전을 실행하고 있는지 확인하고 싶었습니다.

$ docker run -it ubuntu    
root@471bdb08b11a:/# lsb_release -a
bash: lsb_release: command not found
root@471bdb08b11a:/# 

그래서 설치를 시도했습니다(여기서 제안한 대로).

root@471bdb08b11a:/# apt install lsb_release
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package lsb_release
root@471bdb08b11a:/# 

이게 왜 안 되는지 아는 사람?

그런 것 같습니다.lsb_release설치되지 않았습니다.

다음을 통해 설치할 수 있습니다.

apt-get update && apt-get install -y lsb-release && apt-get clean all

그냥 사용.cat /etc/os-releaseOS 상세 정보가 표시될 것입니다.

데비안의 스크린샷.

enter image description here

우분투 스크린샷.

enter image description here

중절모의 스크린샷.

enter image description here

이 오류는 ubuntu 16.04에서 기본 python3 프로그램 버전을 제거하거나 업그레이드할 때 발생할 수 있습니다.

이를 수정하는 방법은 ubuntu와 함께 제공되는 원래 python3 버전을 다시 설치하고 다시 연결하는 것입니다.(unubuntu 16.04 - 기본 python3 버전은 python 3.5입니다.

sudo rm /usr/bin/python3
sudo ln -s /usr/bin/python3.5 /usr/bin/python3

lsb_release.py에 살다/usr/share/pysharedpython3.6 이상은 내게 참조된 것 같지 않습니다.

나는 다음이 나중에 파이썬 설치에서 이것에 대한 링크를 다시 만들 것이라는 것을 발견했습니다./usr/share스크립트:

sudo ln -s /usr/share/pyshared/lsb_release.py /usr/lib/python3.9/site-packages/lsb_release.py

어떤 사람이 그 사건을 처리하려고 할 때lsb_release: command not found페도라 또는 레드햇에 설치할 패키지는 레드햇-lsb-코어이므로sudo dnf install redhat-lsb-core

도커 파일을 작성하는 동안 lsb-release 패키지를 추가할 수 있습니다 - 이렇게.

RUN apt-get update -y \
    && apt-get upgrade -y \
    && apt-get install lsb-release -y \
    && apt-get clean all

OS가 Ubuntu라고 가정합니다.

언급URL : https://stackoverflow.com/questions/58395566/lsb-release-command-not-found-in-latest-ubuntu-docker-container

반응형