LoginSignup
5
4

More than 5 years have passed since last update.

ubuntu14.04でphantomjsをインストールした話

Posted at

前提

Vagrant 1.9.1
Ubuntu 14.04

phantomjsのインストール

今回は私のローカル環境で起こったエラーをふまえての話
rootで作業を行っています

phantomjsインストール
$ wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
$ $ tar jxvf phantomjs-2.1.1-linux-x86_64.tar.bz2.1
$mv phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/
$ cd /usr/local/bin/
$ ls
phantomjs

これでphantomjsのインストールができているはず...

version確認
& phantomjs --version
bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

というエラーが出てきた...
調べてみるとfontconfigがインストールされていないようだったのでインストールしてみた。

fontconfig
$ apt-get install fontconfig
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

違うプロセスで使用されているよってエラーだと考えた。
ここも調べるとlockファイルが存在しているためらしいので、消去する。

delete
$ rm /var/lib/apt/lists/lock
$ rm /var/cache/apt/archives/lock
$ rm /var/lib/dpkg/lock

を実行して再度実行

version確認
$ apt-get install fontconfig
$ phantomjs --version
2.1.1

とバージョンが確認できた!

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4