[리눅스] 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

[이클립스] C/C++ Build Settings에 Tool Settings가 없을 경우 해결법

 

1. Properties -> C/C++ Build -> Settings에 가면 Tool Settings가 없는 경우가 있습니다.

2. 그럴 경우 Properties -> C/C++ Build로 가서 Makefile generation에 있는 Generate Makefiles automatically와 Expand Env. Variable Refs in Makefiles를 체크해주고 Apply and Close를 누릅니다.

3. 다시 Properties -> C/C++ Build -> Settings에 가면 Tool Settings가 나타나 있습니다.

 

 

 

 

분명 numpy를 설치했는데 파이썬에서 numpy를 사용하려 하면 다음과 같이 AttributeError: module 'numpy' has no attribute ... 하는 에러가 뜰 때가 있습니다.

import numpy as np

print(np.__version__)
# AttributeError: module 'numpy' has no attribute '__version__'

 

이는 numpy가 설치는 되었지만 시스템에서 파이썬 라이브러리로 제대로 연결이 안 되어서 그렇습니다. 이럴 경우 맥에서 homebrew를 사용할 때를 기준으로

brew link --overwrite numpy

 

를 실행해주면 문제가 해결됩니다.

 

참조한 곳: https://github.com/Homebrew/homebrew-core/issues/15698#issuecomment-315730732

+ Recent posts