[리눅스] The following packages have been kept back 원인과 해결 방법

 

우분투에서 sudo apt-get upgrade 실행 시 다음과 같은 메시지가 나오면서 업그레이드가 안 되는 경우가 종종 있습니다.

$ sudo apt-get upgrade

The following packages have been kept back:
  dkms ubuntu-advantage-tools
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

$

 

이는 기존에 설치되어 있던 프로그램 중에서 의존성이 변경된 경우가 있어서 업그레이드를 위해서는 기존에 컴퓨터에 설치되어 있지 않던 프로그램을 새로 설치해야 할 경우에 나타나는 경고 메시지입니다. 위 예제의 경우 dkmsubuntu-advantage-tools를 업그레이드 하기 위해서는 기존에 없던 프로그램들을 새로 설치해야 하기 때문에 경고만 해 주고 업그레이드를 실행하지 않은 것입니다.

 

이런 경우 새롭게 필요한 프로그램들을 추가로 설치하면서 apt-get upgrade를 실행하려면 다음과 같이 --with-new-pkgs 옵션을 주면 됩니다. 말 그대로 '새로운 패키지와 함께 (with new packages)' 업그레이드를 진행하라는 옵션입니다. 해당 옵션을 주었더니 새롭게 dctrl-toolsubuntu-pro-client-l10n 두 종류의 프로그램을 설치하면서 dkmsubuntu-advantage-tools를 업그레이드하는 것을 볼 수 있습니다.

$ sudo apt-get --with-new-pkgs upgrade

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  dctrl-tools ubuntu-pro-client-l10n
The following packages will be upgraded:
  dkms ubuntu-advantage-tools
2 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 349 kB of archives.
After this operation, 590 kB of additional disk space will be used.
Do you want to continue? [Y/n]

$

 

한편 이렇게까지 해도 안 되는 경우가 있다면 다음과 같이 aptitude를 설치하신 후에 aptitude를 통해 업그레이드를 진행하는 방법도 있습니다. 하지만 대부분 여기까지 오지 않아도 위의 방법으로 해결이 될 것입니다.

$ sudo apt-get install aptitude -y
$ sudo aptitude safe-upgrade

Julia를 apt-get 으로 설치하면 옛날 버전이 설치됩니다. 최신 버전을 설치하려면 직접 홈페이지에서 다운받아야 합니다.

 

1. 줄리아 다운로드 페이지로 갑니다.

https://julialang.org/downloads/

 

2. 컴퓨터 사양에 맞는 버전을 다운로드합니다. 제 경우는 Generic Linux on x86 64-bit (glibc) 용 1.8.0 버전으로 진행하였습니다.

wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.0-linux-x86_64.tar.gz

 

3. tar로 압축을 풉니다.

tar -xvzf julia-1.8.0-linux-x86_64.tar.gz

 

4. /opt/로 복사함으로써 설치를 합니다. /opt/는 apt-get이 아닌 다른 방법으로 설치된 프로그램들이 있는 곳입니다. 관리자 권한이 필요합니다.

sudo mv ./julia-1.8.0 /opt/

 

5. /usr/local/에  symbolic link를 만들어서 어디서나 편하게 사용하도록 합니다.

sudo ln -s /opt/julia-1.8.0/bin/julia /usr/local/bin/julia

 

6. 이제 터미널 환경에서 julia만 입력하면 julia를 실행할 수 있습니다.

$ julia

 

참조한 곳: https://medium.com/coffee-in-a-klein-bottle/install-julia-1-5-on-ubuntu-bb8be4b2571d

[리눅스] 특정 디렉토리 내 파일 개수 보기


ls -l | grep ^- | wc -l


라고 치시면 현재 디렉토리 내에 있는 파일의 개수를 보실 수 있습니다.

아래 명령어로 리눅스 종류와 버전을 확인할 수 있습니다.


grep . /etc/*-release


제가 사용하는 서버에서는 아래와 같은 결과가 나오네요.


/etc/centos-release:CentOS Linux release 7.4.1708 (Core) 

/etc/os-release:NAME="CentOS Linux"

/etc/os-release:VERSION="7 (Core)"

/etc/os-release:ID="centos"

/etc/os-release:ID_LIKE="rhel fedora"

/etc/os-release:VERSION_ID="7"

/etc/os-release:PRETTY_NAME="CentOS Linux 7 (Core)"

/etc/os-release:ANSI_COLOR="0;31"

/etc/os-release:CPE_NAME="cpe:/o:centos:centos:7"

/etc/os-release:HOME_URL="https://www.centos.org/"

/etc/os-release:BUG_REPORT_URL="https://bugs.centos.org/"

/etc/os-release:CENTOS_MANTISBT_PROJECT="CentOS-7"

/etc/os-release:CENTOS_MANTISBT_PROJECT_VERSION="7"

/etc/os-release:REDHAT_SUPPORT_PRODUCT="centos"

/etc/os-release:REDHAT_SUPPORT_PRODUCT_VERSION="7"

/etc/redhat-release:CentOS Linux release 7.4.1708 (Core) 

/etc/system-release:CentOS Linux release 7.4.1708 (Core)

+ Recent posts