Ghostscript安装
要将Ghostscript 9.27安装到指定目录"/opt/ghostscript",可以按照以下步骤进行操作:
-
安装Ghostscript的依赖包。使用以下命令安装所需的依赖项(可以先进行下面的步骤,如果编译安装时报错需要安装依赖,再进行安装):
yum install -y build-essential libjpeg-dev libtiff5-dev libpng-dev zlib1g-dev libx11-dev libxext-dev libxrender-dev
-
下载Ghostscript 9.27安装包:
cd /opt/software/ wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs927/ghostscript-9.27.tar.gz
-
解压缩下载的源代码包。使用以下命令解压缩压缩包:
tar xzf ghostscript-9.27.tar.gz
-
进入解压后的目录:
cd ghostscript-9.27
-
配置编译选项,并指定安装目录为"/opt/ghostscript"。使用以下命令配置编译选项和安装目录:
./configure --prefix=/opt/ghostscript
-
编译和安装Ghostscript。使用以下命令进行编译和安装:
make make install
-
等待编译和安装过程完成。
完成上述步骤后,Ghostscript 9.27将成功安装到指定目录
/opt/ghostscript
中。你可以使用/opt/ghostscript/bin/gs
命令来执行Ghostscript相关操作。例如,你可以在终端中运行以下命令来验证Ghostscript的安装:/opt/ghostscript/bin/gs --version
-
做软连接
ln -s /opt/ghostscript/bin/gs /usr/bin/ghostscript
-
配置环境变量
#vim /etc/profile export PATH="/opt/ghostscript/bin:$PATH" #source /etc/profile
-
添加环境后可直接使用
gs --version
命令 来验证是否安装成功