Hong의 모든 글

E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

우분투에서 패키지를 설치하다가 의존성이 깨지거나 하게 되면 그 뒤로 apt를 실행할 때 마다 에러가 발생합니다. 여간해서는 해결이 잘 안되는데요.

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

이렇게 하면 됩니다.

sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken

출처: https://askubuntu.com/questions/1044817/failed-installation-of-package-breaks-apt-get

[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

우분투 18.04에 자바11 설치하기 – Install Java 11 onto Ubuntu 18.04

우분투 18.04에 자바11 설치하는 방법입니다.

18.04가 이제는 구버전이기도 하고 Java가 너무 구버전이 설치되어 있어서 업그레이드가 필요할 때가 많습니다. 보통 Java로 만들어진 애플리케이션들이 비교적 최근 버전의 자바를 요구하는 경우입니다.

설치하기

오픈JDK구버전을 제거합니다.

sudo apt-get remove openjdk*

오라클JDK도 제거합니다.

sudo apt-get remove oracle*

깔끔하게 청소해줍니다.

sudo apt-get autoremove --purge
sudo apt-get autoclean

openjdk 설치해야 하는데 커스텀 레파지토리를 추가하고 설치합니다.

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt install openjdk-11-jdk

버전을 확인해서 11.x.xx 가 보여야 합니다.

java --version
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.18.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.18.04, mixed mode, sharing)