[linux] add-apt-repository command not found 해결방법

2023. 2. 10. 07:49Computer Tips

728x90

리눅스 환경 세팅을 할 때, 특정 repository를 등록하기 위해 sudo add-apt-repository를 사용하게 되는데, 이 파일이 없어서 에러가 발생할 수 있다. (특히 환경을 새로 구성하는 시기에...)
이 때는 아래와 같이 해결한다.

 

1. 현상

sudo add-apt-repository XXXX를 입력 했을 때, sudo: add-apt-repository: command not found 라고 뜨면서 진행이 되지 않는 경우가 있다.
command not found.. 리눅스에서 해당 프로그램이 없다는 뜻이고, 아래와 같이 설치가 가능하다.

728x90

2. 해결방법


python-software-properties와 software-properties-common 패키지에 repository에 대한 정보가 포함되어 있고, 이 패키지가 설치되지 않았으니까 sudo add-apt-repository 명령어를 실행할 수 없는 것이다. 설치하는 방법은 2가지다.

(해결방법 A) python-software-properties 를 설치한다.  

apt-get install python-software-properties


만약, python-software-properties를 설치했는데도 간혹 해결되지 않는다면 아래와 같이 추가로 설치까지 해준다. (근데, python-software-properties만 설치해도 대부분 해결되었다.)

(해결방법 B) software-properties-common 를 설치한다.  

apt-get install software-properties-common

 

3. 결과

add-apt-repository 명령어가 잘 실행된다.

반응형