Phantom JS 설치하기

패키지 관리도구로 손쉽게 설치

실제로 안되는 경우가 많다.

$ sudo apt-get install phantomjs
시스템에 폰트 설치하기 (한글폰트가 없는 경우 스크린샷 등 깨져서 나오게 된다)

$ sudo apt-get install fonts-unfonts-core
$ sudo apt-get install fonts-unfonts-extra

PhantomJS 삭제하기

Ubuntu 14.04 에서 단순 삭제를 하기위해서 터미널에 아래 명령어를 입력해보자.
sudo apt-get remove phantomjs

위 명령어로는 깔끔하게 모든게 지워진게 아니다.
phantomjs 패키지와 사용하지 않을 관련된 모든 패키지들을 깔끔하게 삭제해보자.
sudo apt-get remove --auto-remove phantomjs

Purge 명령어로 환경설정과 데이터 파일들도 모두 삭제하자.
sudo apt-get purge phantomjs
관련있는 모든 설정을 제거하자.
sudo apt-get purge --auto-remove phantomjs

특정 버전의 PhantomJS 설치하기

wget 으로 1.9.8 버전을 다운로드 받는다
$ wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2

압축을 해제한다
$ sudo tar -xvjf phantomjs-1.9.8-linux-x86_64.tar.bz2

압축 해제된 phantomjs 폴더를 /usr/local/share 폴더로 이동한다.
$ sudo mv phantomjs-1.9.8-linux-x86_64 /usr/local/share/

실행가능한 심볼릭 링크를 생성한다

$ sudo ln -sf /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs
$ sudo ln -sf /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
$ sudo ln -sf /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/bin/phantomjs

한글 폰트 표시문제

화면캡쳐 등 한글이 표시가 안될 경우 아래 명령어를 입력해보자.
sudo apt-get install libfontconfig

폰트가 설치하기기

$ sudo apt-get install fonts-unfonts-core
$ sudo apt-get install fonts-unfonts-extra

Subscribe to Keun's newsletter and stay updated.

Don't miss anything. Get all the latest posts delivered straight to your inbox. It's free!
Great! Check your inbox and click the link to confirm your subscription.
Error! Please enter a valid email address!