Translate

2016년 3월 1일 화요일

[Ubuntu] NodeJS 최신버전으로 업데이트하기



OS: Ubuntu 15.10 (Gnome)



증상

아래와 같이 nodejs 를 설치했는데도 이미 최신버전 이라고 나오며 업데이트를 하지 않는상황이 발생했다.


lucifer@lucifer-Vostro-V13:~$ sudo apt-get install nodejs
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
nodejs 패키지는 이미 최신 버전입니다.
0개 업그레이드, 0개 새로 설치, 0개 제거 및 3개 업그레이드 안 함.
lucifer@lucifer-Vostro-V13:~$
lucifer@lucifer-Vostro-V13:~$
lucifer@lucifer-Vostro-V13:~$ node -v
v0.10.25
lucifer@lucifer-Vostro-V13:~$











해결방법

설치하고자 하는 버전에 따라 명령어가 다르다.

NodeJS v0.12: curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
NodeJS v4: curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
NodeJS v5: curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -



나의 경우에는 v0.12 로 업데이트를 했다.


lucifer@lucifer-Vostro-V13:~$
lucifer@lucifer-Vostro-V13:~$ curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
[sudo] password for lucifer:

## Installing the NodeSource Node.js 0.12 repo...


## Populating apt-get cache...

+ apt-get update
기존 http://kr.archive.ubuntu.com wily InRelease
기존 http://kr.archive.ubuntu.com wily-updates InRelease
기존 http://kr.archive.ubuntu.com wily-backports InRelease
기존 http://kr.archive.ubuntu.com wily/main Sources
기존 http://kr.archive.ubuntu.com wily/restricted Sources
기존 http://kr.archive.ubuntu.com wily/universe Sources
무시http://dl.google.com stable InRelease
기존 http://kr.archive.ubuntu.com wily/multiverse Sources
기존 http://kr.archive.ubuntu.com wily/main amd64 Packages
기존 http://kr.archive.ubuntu.com wily/restricted amd64 Packages
기존 http://kr.archive.ubuntu.com wily/universe amd64 Packages
기존 http://kr.archive.ubuntu.com wily/multiverse amd64 Packages
기존 http://kr.archive.ubuntu.com wily/main i386 Packages
기존 http://kr.archive.ubuntu.com wily/restricted i386 Packages
기존 http://kr.archive.ubuntu.com wily/universe i386 Packages
기존 http://kr.archive.ubuntu.com wily/multiverse i386 Packages
기존 http://kr.archive.ubuntu.com wily/main Translation-ko
기존 http://kr.archive.ubuntu.com wily/main Translation-en
기존 http://kr.archive.ubuntu.com wily/multiverse Translation-en
기존 http://kr.archive.ubuntu.com wily/restricted Translation-ko
기존 http://kr.archive.ubuntu.com wily/restricted Translation-en
기존 http://kr.archive.ubuntu.com wily/universe Translation-ko
기존 http://kr.archive.ubuntu.com wily/universe Translation-en
기존 http://kr.archive.ubuntu.com wily-updates/main Sources
기존 http://dl.google.com stable Release.gpg
기존 http://kr.archive.ubuntu.com wily-updates/restricted Sources
기존 http://kr.archive.ubuntu.com wily-updates/universe Sources
기존 http://kr.archive.ubuntu.com wily-updates/multiverse Sources
기존 http://kr.archive.ubuntu.com wily-updates/main amd64 Packages
기존 http://kr.archive.ubuntu.com wily-updates/restricted amd64 Packages
기존 http://kr.archive.ubuntu.com wily-updates/universe amd64 Packages
기존 http://dl.google.com stable Release
기존 http://kr.archive.ubuntu.com wily-updates/multiverse amd64 Packages
기존 http://kr.archive.ubuntu.com wily-updates/main i386 Packages
기존 http://kr.archive.ubuntu.com wily-updates/restricted i386 Packages
기존 http://kr.archive.ubuntu.com wily-updates/universe i386 Packages
기존 http://kr.archive.ubuntu.com wily-updates/multiverse i386 Packages
기존 http://kr.archive.ubuntu.com wily-updates/main Translation-en
기존 http://kr.archive.ubuntu.com wily-updates/multiverse Translation-en
받기:1 http://security.ubuntu.com wily-security InRelease [65.9 kB]
기존 http://kr.archive.ubuntu.com wily-updates/restricted Translation-en
기존 http://kr.archive.ubuntu.com wily-updates/universe Translation-en
기존 http://kr.archive.ubuntu.com wily-backports/main Sources
기존 http://kr.archive.ubuntu.com wily-backports/restricted Sources
기존 http://kr.archive.ubuntu.com wily-backports/universe Sources
기존 http://kr.archive.ubuntu.com wily-backports/multiverse Sources
기존 http://kr.archive.ubuntu.com wily-backports/main amd64 Packages
기존 http://kr.archive.ubuntu.com wily-backports/restricted amd64 Packages
기존 http://dl.google.com stable/main amd64 Packages
기존 http://kr.archive.ubuntu.com wily-backports/universe amd64 Packages
기존 http://kr.archive.ubuntu.com wily-backports/multiverse amd64 Packages
기존 http://kr.archive.ubuntu.com wily-backports/main i386 Packages
기존 http://kr.archive.ubuntu.com wily-backports/restricted i386 Packages
기존 http://kr.archive.ubuntu.com wily-backports/universe i386 Packages
기존 http://kr.archive.ubuntu.com wily-backports/multiverse i386 Packages
기존 http://kr.archive.ubuntu.com wily-backports/main Translation-en
기존 http://kr.archive.ubuntu.com wily-backports/multiverse Translation-en
기존 http://kr.archive.ubuntu.com wily-backports/restricted Translation-en
기존 http://dl.google.com stable/main i386 Packages
기존 http://kr.archive.ubuntu.com wily-backports/universe Translation-en
받기:2 http://security.ubuntu.com wily-security/main Sources [38.7 kB]
받기:3 http://security.ubuntu.com wily-security/restricted Sources [2,854 B]
받기:4 http://security.ubuntu.com wily-security/universe Sources [8,955 B]
받기:5 http://security.ubuntu.com wily-security/multiverse Sources [2,772 B]
받기:6 http://security.ubuntu.com wily-security/main amd64 Packages [126 kB]
받기:7 http://security.ubuntu.com wily-security/restricted amd64 Packages [10.9 kB]
받기:8 http://security.ubuntu.com wily-security/universe amd64 Packages [45.0 kB]
받기:9 http://security.ubuntu.com wily-security/multiverse amd64 Packages [6,249 B]
무시http://dl.google.com stable/main Translation-ko_KR
받기:10 http://security.ubuntu.com wily-security/main i386 Packages [124 kB]
무시http://dl.google.com stable/main Translation-ko
무시http://dl.google.com stable/main Translation-en
받기:11 http://security.ubuntu.com wily-security/restricted i386 Packages [10.8 kB]
받기:12 http://security.ubuntu.com wily-security/universe i386 Packages [45.1 kB]
받기:13 http://security.ubuntu.com wily-security/multiverse i386 Packages [6,434 B]
기존 http://security.ubuntu.com wily-security/main Translation-en
기존 http://security.ubuntu.com wily-security/multiverse Translation-en
기존 http://security.ubuntu.com wily-security/restricted Translation-en
기존 http://security.ubuntu.com wily-security/universe Translation-en
내려받기 494 k바이트, 소요시간 8초 (59.8 k바이트/초)
패키지 목록을 읽는 중입니다... 완료

## Confirming "wily" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_0.12/dists/wily/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
OK

## Creating apt sources list file for the NodeSource Node.js 0.12 repo...

+ echo 'deb https://deb.nodesource.com/node_0.12 wily main' > ~/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_0.12 wily main' >> ~/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
기존 http://kr.archive.ubuntu.com wily InRelease
기존 http://kr.archive.ubuntu.com wily-updates InRelease
기존 http://kr.archive.ubuntu.com wily-backports InRelease
기존 http://kr.archive.ubuntu.com wily/main Sources
기존 http://kr.archive.ubuntu.com wily/restricted Sources
기존 http://kr.archive.ubuntu.com wily/universe Sources
기존 http://kr.archive.ubuntu.com wily/multiverse Sources
기존 http://kr.archive.ubuntu.com wily/main amd64 Packages
기존 http://kr.archive.ubuntu.com wily/restricted amd64 Packages
기존 http://kr.archive.ubuntu.com wily/universe amd64 Packages
무시http://dl.google.com stable InRelease
기존 http://kr.archive.ubuntu.com wily/multiverse amd64 Packages
기존 http://kr.archive.ubuntu.com wily/main i386 Packages
기존 http://kr.archive.ubuntu.com wily/restricted i386 Packages
기존 http://kr.archive.ubuntu.com wily/universe i386 Packages
기존 http://kr.archive.ubuntu.com wily/multiverse i386 Packages
기존 http://kr.archive.ubuntu.com wily/main Translation-ko
기존 http://kr.archive.ubuntu.com wily/main Translation-en
기존 http://kr.archive.ubuntu.com wily/multiverse Translation-en
기존 http://kr.archive.ubuntu.com wily/restricted Translation-ko
기존 http://kr.archive.ubuntu.com wily/restricted Translation-en
기존 http://dl.google.com stable Release.gpg
기존 http://kr.archive.ubuntu.com wily/universe Translation-ko
기존 http://kr.archive.ubuntu.com wily/universe Translation-en
기존 http://kr.archive.ubuntu.com wily-updates/main Sources
기존 http://kr.archive.ubuntu.com wily-updates/restricted Sources
기존 http://kr.archive.ubuntu.com wily-updates/universe Sources
기존 http://kr.archive.ubuntu.com wily-updates/multiverse Sources
기존 http://kr.archive.ubuntu.com wily-updates/main amd64 Packages
기존 http://kr.archive.ubuntu.com wily-updates/restricted amd64 Packages
기존 http://kr.archive.ubuntu.com wily-updates/universe amd64 Packages
기존 http://dl.google.com stable Release
기존 http://kr.archive.ubuntu.com wily-updates/multiverse amd64 Packages
기존 http://kr.archive.ubuntu.com wily-updates/main i386 Packages
기존 http://kr.archive.ubuntu.com wily-updates/restricted i386 Packages
기존 http://kr.archive.ubuntu.com wily-updates/universe i386 Packages
기존 http://security.ubuntu.com wily-security InRelease
기존 http://kr.archive.ubuntu.com wily-updates/multiverse i386 Packages
기존 http://kr.archive.ubuntu.com wily-updates/main Translation-en
기존 http://kr.archive.ubuntu.com wily-updates/multiverse Translation-en
기존 http://kr.archive.ubuntu.com wily-updates/restricted Translation-en
기존 http://kr.archive.ubuntu.com wily-updates/universe Translation-en
기존 http://kr.archive.ubuntu.com wily-backports/main Sources
기존 http://dl.google.com stable/main amd64 Packages
기존 http://kr.archive.ubuntu.com wily-backports/restricted Sources
기존 http://kr.archive.ubuntu.com wily-backports/universe Sources
기존 http://kr.archive.ubuntu.com wily-backports/multiverse Sources
기존 http://kr.archive.ubuntu.com wily-backports/main amd64 Packages
기존 http://kr.archive.ubuntu.com wily-backports/restricted amd64 Packages
기존 http://kr.archive.ubuntu.com wily-backports/universe amd64 Packages
기존 http://kr.archive.ubuntu.com wily-backports/multiverse amd64 Packages
기존 http://kr.archive.ubuntu.com wily-backports/main i386 Packages
기존 http://kr.archive.ubuntu.com wily-backports/restricted i386 Packages
기존 http://dl.google.com stable/main i386 Packages
기존 http://kr.archive.ubuntu.com wily-backports/universe i386 Packages
기존 http://kr.archive.ubuntu.com wily-backports/multiverse i386 Packages
기존 http://kr.archive.ubuntu.com wily-backports/main Translation-en
기존 http://kr.archive.ubuntu.com wily-backports/multiverse Translation-en
기존 http://kr.archive.ubuntu.com wily-backports/restricted Translation-en
기존 http://kr.archive.ubuntu.com wily-backports/universe Translation-en
기존 http://security.ubuntu.com wily-security/main Sources
기존 http://security.ubuntu.com wily-security/restricted Sources
받기:1 https://deb.nodesource.com wily InRelease [3,911 B]
기존 http://security.ubuntu.com wily-security/universe Sources
받기:2 https://deb.nodesource.com wily/main Sources [764 B]
기존 http://security.ubuntu.com wily-security/multiverse Sources
받기:3 https://deb.nodesource.com wily/main amd64 Packages [976 B]
기존 http://security.ubuntu.com wily-security/main amd64 Packages
받기:4 https://deb.nodesource.com wily/main i386 Packages [976 B]
기존 http://security.ubuntu.com wily-security/restricted amd64 Packages
받기:5 https://deb.nodesource.com wily/main Translation-ko_KR [162 B]
기존 http://security.ubuntu.com wily-security/universe amd64 Packages
받기:6 https://deb.nodesource.com wily/main Translation-ko [162 B]
무시http://dl.google.com stable/main Translation-ko_KR
무시http://dl.google.com stable/main Translation-ko
기존 http://security.ubuntu.com wily-security/multiverse amd64 Packages
받기:7 https://deb.nodesource.com wily/main Translation-en [162 B]
무시http://dl.google.com stable/main Translation-en
기존 http://security.ubuntu.com wily-security/main i386 Packages
받기:8 https://deb.nodesource.com wily/main Translation-ko_KR [162 B]
받기:9 https://deb.nodesource.com wily/main Translation-ko [162 B]
기존 http://security.ubuntu.com wily-security/restricted i386 Packages
받기:10 https://deb.nodesource.com wily/main Translation-en [162 B]
기존 http://security.ubuntu.com wily-security/universe i386 Packages
받기:11 https://deb.nodesource.com wily/main Translation-ko_KR [162 B]
기존 http://security.ubuntu.com wily-security/multiverse i386 Packages
받기:12 https://deb.nodesource.com wily/main Translation-ko [162 B]
기존 http://security.ubuntu.com wily-security/main Translation-en
받기:13 https://deb.nodesource.com wily/main Translation-en [162 B]
받기:14 https://deb.nodesource.com wily/main Translation-ko_KR [162 B]
기존 http://security.ubuntu.com wily-security/multiverse Translation-en
받기:15 https://deb.nodesource.com wily/main Translation-ko [162 B]
기존 http://security.ubuntu.com wily-security/restricted Translation-en
받기:16 https://deb.nodesource.com wily/main Translation-en [162 B]
기존 http://security.ubuntu.com wily-security/universe Translation-en
받기:17 https://deb.nodesource.com wily/main Translation-ko_KR [162 B]
무시https://deb.nodesource.com wily/main Translation-ko_KR
받기:18 https://deb.nodesource.com wily/main Translation-ko [162 B]
무시https://deb.nodesource.com wily/main Translation-ko
받기:19 https://deb.nodesource.com wily/main Translation-en [162 B]
무시https://deb.nodesource.com wily/main Translation-en
내려받기 6,627 바이트, 소요시간 8초 (790 바이트/초)
패키지 목록을 읽는 중입니다... 완료

## Run `apt-get install nodejs` (as root) to install Node.js 0.12 and npm

lucifer@lucifer-Vostro-V13:~$
lucifer@lucifer-Vostro-V13:~$
lucifer@lucifer-Vostro-V13:~$
lucifer@lucifer-Vostro-V13:~$ sudo apt-get install -y nodejs
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  gyp javascript-common kde-l10n-engb kde-l10n-ko libc-ares-dev libc-ares2 libjs-inherits libjs-jquery libjs-node-uuid libjs-underscore libssl-dev
  libssl-doc libv8-3.14-dev libv8-3.14.5 node-abbrev node-ansi node-ansi-color-table node-archy node-async node-block-stream node-combined-stream
  node-cookie-jar node-delayed-stream node-forever-agent node-form-data node-fstream node-fstream-ignore node-github-url-from-git node-glob
  node-graceful-fs node-gyp node-inherits node-ini node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp
  node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once node-osenv node-qs node-read node-read-package-json
  node-request node-retry node-rimraf node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent node-underscore node-which zlib1g-dev
Use 'apt-get autoremove' to remove them.
다음 패키지를 더 설치할 것입니다:
  rlwrap
다음 패키지를 지울 것입니다:
  nodejs-dev npm
다음 새 패키지를 설치할 것입니다:
  rlwrap
다음 패키지를 업그레이드할 것입니다:
  nodejs
1개 업그레이드, 1개 새로 설치, 2개 제거 및 3개 업그레이드 안 함.
7,206 k바이트 아카이브를 받아야 합니다.
이 작업 후 28.1 M바이트의 디스크 공간을 더 사용하게 됩니다.
받기:1 http://kr.archive.ubuntu.com/ubuntu/ wily/universe rlwrap amd64 0.41-1 [74.2 kB]
받기:2 https://deb.nodesource.com/node_0.12/ wily/main nodejs amd64 0.12.10-1nodesource1~wily1 [7,132 kB]
내려받기 7,206 k바이트, 소요시간 5초 (1,253 k바이트/초)
(데이터베이스 읽는중 ...현재 222862개의 파일과 디렉터리가 설치되어 있습니다.)
Removing npm (1.4.21+ds-2) ...
Processing triggers for man-db (2.7.4-1) ...
Selecting previously unselected package rlwrap.
(데이터베이스 읽는중 ...현재 222180개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../rlwrap_0.41-1_amd64.deb ...
Unpacking rlwrap (0.41-1) ...
Processing triggers for man-db (2.7.4-1) ...
dpkg: nodejs-dev: dependency problems, but removing anyway as you requested:
 node-gyp 패키지는 다음 패키지에 의존: nodejs-dev.

(데이터베이스 읽는중 ...현재 222210개의 파일과 디렉터리가 설치되어 있습니다.)
Removing nodejs-dev (0.10.25~dfsg2-2ubuntu1) ...
(데이터베이스 읽는중 ...현재 222144개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../nodejs_0.12.10-1nodesource1~wily1_amd64.deb ...
Unpacking nodejs (0.12.10-1nodesource1~wily1) over (0.10.25~dfsg2-2ubuntu1) ...
Processing triggers for man-db (2.7.4-1) ...
rlwrap (0.41-1) 설정하는 중입니다 ...
update-alternatives: using /usr/bin/rlwrap to provide /usr/bin/readline-editor (readline-editor) in auto mode
nodejs (0.12.10-1nodesource1~wily1) 설정하는 중입니다 ...
lucifer@lucifer-Vostro-V13:~$
lucifer@lucifer-Vostro-V13:~$
lucifer@lucifer-Vostro-V13:~$ node -v
v0.12.10
lucifer@lucifer-Vostro-V13:~$






PS.

E: Some index files failed to download. They have been ignored, or old ones used instead.

업데이트 중 위와 같이 로그가 나오며 정상적으로 되지 않는 경우에는 아래의 링크로 이동해서 확인하기 바란다.
http://1004lucifer.blogspot.kr/2016/03/ubuntu-e-some-index-files-failed-to.html




참조
http://askubuntu.com/questions/594656/how-to-install-the-latest-versions-of-nodejs-and-npm-for-ubuntu-14-04-lts
https://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories/



댓글 없음 :

댓글 쓰기