카테고리 보관물: 미분류

The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY xxxxxxxxxxxxxxxx

우분투에서 apt로 레파지토리를 등록하고 설치를 할 때 이런 에러가 발생할 때가 있다.

특히 Jenkins

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FCEF32E745F2C3D5

키 등록을 못한 것이라서 아래의 명령으로 된다. 아래의 키는 예시이므로 키는 자신의 것의로 바꾼다.

sudo apt-key adv --keyserver-options http-proxy=http://proxy.cns.widerlab.io:8080 --keyserver keyserver.ubuntu.com --recv-keys FCEF32E745F2C3D5

만약 서버가 외부 네트워크로 나갈 때 proxy를 사용해야만 한다면 위의 명령으로는 키가 등록되지 않는다. 다음과 같이 proxy를 지정해준다.

sudo apt-key adv --keyserver-options http-proxy=http://proxy.cns.yourproxy.com:8080 --keyserver keyserver.ubuntu.com --recv-keys FCEF32E745F2C3D5

이제 설치하려던 패키지를 설치하면 된다.

우분투에 Mecab 형태소분석기 설치 – Install Mecab in Ubuntu

우분투에 Mecab(은전한닢) 형태소 분석기를 설치하는 방법입니다.

Mecab 메카브 간략 설명

Mecab를 간단히 설명하면

  • Mecab은 C++로 만든 일본어 형태소분석기입니다.
  • Mecab-ko는 Mecab를 고쳐서 만든 한국어형태소분기이며 “은전한닢”라고 부릅니다.

예전 포스트가 있니 참고하세요.

MeCab 형태소 분석기, 형태소분석기란 무엇인가? 워드세그멘터와 형태소분석기

설치방법

Mecab-Ko는 Mecab 코어 모듈과 Mecab-ko-dic을 먼저 설치해야 하는데 번거롭습니다.

konlpy에 있는 간략 스크립트를 쓰면 쉽게 설치가능합니다.

sudo apt-get install curl git
$ bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)

Mecab만으로는 형태소분석을 테스트하거나 활용하기 어려우니 Python 모듈도 설치해줍니다.

# python3.10은 아직 문제가 있으니 안전하게 조금 오래된 버전으로 간다.
# python3.10 -m pip install mecab-python3
python3.8 -m pip install mecab-python3

파이썬을 실행해서 테스트 해봅니다.

mecab = Mecab()
' '.join(mecab.morphs("무궁화꽃이피었습니다."))
# '무궁화 꽃 이 피 었 습니다 .'

[Jenkins] Could not initialize class org.eclipse.jgit.internal.storage.file.FileSnapshot

젠킨스로 git repository를 polling해서 코드가 푸시되었는지 확인한 후에 자동 빌드하는 프로세스를 만들면 로그에 이런 에러가 나면서 실패하는 경우가 있습니다.

Could not initialize class org.eclipse.jgit.internal.storage.file.FileSnapshot

젠킨스의 jgit 관련 클래스가 잘못된 것인데 이건 해결방법이 마땅치 않습니다.

그냥 Jenkins를 LTS가 아닌 최신버전이나 다른 버전으로 바꿔서 설치해야 합니다.

jenkins install Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification.

젠킨스를 설치하는데 지런 에러가 날 수 있습니다.

sudo apt update
sudo apt install jenkins

에러는 이렇습니다.

jenkins install Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification.

certification을 재설치해줘야 해결이 됩니다.

sudo apt install ca-certificates
sudo apt update
sudo apt install jenkins

우분투에서 R 설치하기

2022년 최신판입니다.

늘 똑같은데 최근에 설치하는 방법이 좀 바뀌었군요.

우분투 리눅스에 R을 설치하는 법은 거의 바뀌지 않기 때문에 https://cloud.r-project.org/ 에 방문해서 코드를 복사한 후에 같은 방법을 쓰면 늘 되지만 가끔 방식이 바뀌므로 방문해서 바뀐 것을 확인해봐야 합니다.

빠른 설치 방법

설명을 생략한 코드 복붙이 필요하면 아래의 순서대로 하시면 됩니다.

sudo apt update -qq
sudo apt install --no-install-recommends software-properties-common dirmngr
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
sudo apt install --no-install-recommends r-base
R --version

한줄씩 따라가며 설치하기

복붙만 하다가는 바보가 됩니다. 어떤 순서로 설치하는지 알아둘 필요가 있습니다. 그래야 설치하다 문제가 생기면 어느 부분이 문제인지 알고 처리하는 법을 배울 수 있습니다.

시간이 없고 하기도 싫으면 굳이 지금 할 필요는 없습니다.

# 패키지 인덱스를 업데이트합니다.

sudo apt update -qq

# 헬퍼 패키지 2개를 설치합니다.

sudo apt install --no-install-recommends software-properties-common dirmngr

# 레파지토리 키를 설치합니다.

wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc

#  R 4.0 레파지토리를 등록합니다.

sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

# 설치합니다.

sudo apt install --no-install-recommends r-base

# 버전을 확인합니다.

$ R --version
R version 4.1.3 (2022-03-10) -- "One Push-Up"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.

현재 시점에서는 R 4.1.3이 최신 버전이고 곧 새버전이 출시된답니다.

관련 포스트

우분투 18.04에 R 설치하기 – Install R on Ubuntu 18.04