[Linux/Ubuntu] apt-get 패키지 다운로드 서버(sources.list) 변경

<br>

1) 에러
아카이브를 받을 수 없습니다. 아마도 apt-get update를 실행해야 하거나 --fix-missing 옵션을 줘서 실행해야 할 것입니다.
kr.archive.ubuntu.com 연결 실패
Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
'kr.archive.ubuntu.com'의 주소를 알아낼 수 없습니다

kr.archive.ubuntu.com에 연결할 수 없습니다

아카이브를 받을 수 없습니다

kr.archive.ubuntu.com에 연결하는 중입니다

kr.archive.ubuntu.com 404 not found


2) 원인

Ubuntu를 한글로 변경하게 되었을 때 패키지 다운로드 서버가 자동으로 http://kr.archive.ubuntu.com/ubuntu/로 설정이 됩니다.(/etc/apt/sources.list 파일 변경) 근데 이 서버가 속도 이슈도 있고, 몇 패키지의 경우에는 설치가 안되는 에러가 있습니다. 그래서 이 기본 패키지 서버를 바꾸어주면 에러가 없어집니다.


3) 해결
패키지 다운로드 서버를 바꿔주면 됩니다.

sudo vi /etc/apt/sources.list
명령어 입력시 sources.list파일이 열립니다.

여기서
:
을 입력해 주시면 명령모드가 실행됩니다.(화면 제일 하단에 깜빡이며 명령 대기)


여기에서 %s/kr.archive.ubuntu.com/ftp.daumkakao.com을 입력해주시고 엔터를 치시면

14 substitutions on 14 lines라는 글이 명령줄에 나타날 것입니다.

그럼 :wq를 입력하고 엔터를 쳐서 커맨드 창으로 나와

sudo apt-get update; sudo apt-get upgrade -y를 실행해줍니다.

에러없이 실행되면 제대로 동작한 것입니다.

이후에 에러가 난 명령을 다시 실행해보면 이번엔 에러없이 잘 설치되는 것을 보실 수 있습니다.

에러전문

RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.


원인

이 에러는 matplotlib 패키지에서 발생하는 에러입니다.

matplotlib에서 사용되는 backend가 제대로 설정되지 못하였기 때문에 발생합니다.



해결법

Mac의 터미널에서 이하의 명령어를 입력합니다.

echo "backend: TkAgg" >> ~/.matplotlib/matplotlibrc

아무 결과가 출력되지 않으면 제대로 된 것입니다.

이후에 다시 실행해보면 제대로 동작하는 것을 확인할 수 있습니다.

[R/Rstudio] dlookr 패키지 설치 후 Error: package or namespace load failed for ‘dlookr’ 발생 시 대처방안

 

R studio에서 dlookr 패키지를 설치하게 되면, 가끔씩 버전과 맥OS유무에 따라 Error: package or namespace load failed for ‘dlookr’에러를 뿜는 경우가 있다.

 

전체 에러는

Error: package or namespace load failed for ‘dlookr’:  .onLoad failed in loadNamespace() for 'tcltk', details:   call: fun(libname, pkgname)   error: X11 library is missing: install XQuartz from xquartz.macosforge.org

 

XQuartz

The XQuartz project is an open-source effort to develop a version of the X.Org X Window System that runs on OS X. Together with supporting libraries and applications, it forms the X11.app that Apple shipped with OS X versions 10.5 through 10.7. Quick Downl

www.xquartz.org

인데, 여기서 XQuartz의 X11 라이브러리가 문제가 있음을 알 수 있다.

 

이 에러의 경우 다른 R 패키지에서처럼 devtools를 통하여 깃헙에서 바로 설치하는 것으로 해결되는 에러가 아니다.

[install.packages("devtools");devtools::install_github("계정/레포이름")]

 

여기서 힌트는 블로그에 올라가게되며, 링크가 자동으로 생성된 저 사이트에서 찾을 수 있다.

 

실제로 저 사이트에 들어가게되면, 맥OS에서 실행가능한 dmg파일을 다운로드 받을 수 있으며, 이 dmg파일을 실행하여 설치하면 dlookr에러는 해결된다.

+ Recent posts