Linux 安装 FireFox 浏览器

该文档为FireFox在Linux系统上的安装说明文档,适用于CentOS6.4

安装依赖

  1. 准备安装包
    atk-2.4.0.tar.xz
    cairo-1.12.2.tar.xz
    gdk-pixbuf-2.26.3.tar.xz
    glib-2.32.4.tar.xz
    gtk+-3.4.4.tar.xz
    pango-1.30.1.tar.xz
    pixman-0.26.2.tar.xz

  2. 配置环境变量

export LD_LIBRARY_PATH=/opt/gtk3/lib
export PATH="/opt/gtk3/bin:$PATH"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/gtk3/lib/pkgconfig"
  1. 禁用GTK2
cd /usr/include
mkdir OLDHEADERS
mv atk* cairo glib* gtk* pango* OLDHEADERS
  1. 执行命令按如下顺序编译安装依赖
    glib
    atk
    pango
    pixman
    cairo
    gdk-pixbuf
    gtk
./configure --prefix=/opt/gtk3 && make -j && make install
  1. 编译安装GTK3
export LD_LIBRARY_PATH=/opt/gtk3/lib
export PATH="/opt/gtk3/bin:$PATH"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/gtk3/lib/pkgconfig"
./configure && make && make install

或者

export CFLAGS="-I/opt/gtk3/include -L/opt/gtk3/lib"
export PATH="/opt/gtk3/bin:$PATH"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/gtk3/lib/pkgconfig"
./configure && make && make install

安装FireFox
从官网下载FireFox Linux版解压,执行 firefox –headless 以无头模式运行

关于异常
Exception1: usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15’ not found (required by …)
这个错误是由与GCC库版本低导致的,下载新版本的库并建立软连接即可。下载地址http://ftp.de.debian.org/debian/pool/main/g/

Exception2:D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open “/var/lib/dbus/machine-id”: No such file or directory
执行以下两天命令生成machine-id既可

mkdir -p /var/lib/dbus
dbus-uuidgen  > /var/lib/dbus/machine-id

参考链接:
http://linuxfonts.narod.ru/compiling-and-installing-gtk3-in-centos6_old.html
http://blog.51cto.com/ponyjia/1827695
http://linuxfonts.narod.ru/compiling-and-installing-gtk3-in-centos6_old.html

你可能感兴趣的:(爬虫)