Linux 编译安装Ghostscript

Ghostscript安装

要将Ghostscript 9.27安装到指定目录"/opt/ghostscript",可以按照以下步骤进行操作:

  1. 安装Ghostscript的依赖包。使用以下命令安装所需的依赖项(可以先进行下面的步骤,如果编译安装时报错需要安装依赖,再进行安装):

    yum  install  -y  build-essential libjpeg-dev libtiff5-dev libpng-dev zlib1g-dev libx11-dev libxext-dev libxrender-dev
    
  2. 下载Ghostscript 9.27安装包:

    cd   /opt/software/
    wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs927/ghostscript-9.27.tar.gz
    
  3. 解压缩下载的源代码包。使用以下命令解压缩压缩包:

    tar xzf ghostscript-9.27.tar.gz
    
  4. 进入解压后的目录:

    cd ghostscript-9.27
    
  5. 配置编译选项,并指定安装目录为"/opt/ghostscript"。使用以下命令配置编译选项和安装目录:

    ./configure --prefix=/opt/ghostscript
    
  6. 编译和安装Ghostscript。使用以下命令进行编译和安装:

    make
    make install
    
  7. 等待编译和安装过程完成。

    完成上述步骤后,Ghostscript 9.27将成功安装到指定目录/opt/ghostscript中。你可以使用/opt/ghostscript/bin/gs命令来执行Ghostscript相关操作。例如,你可以在终端中运行以下命令来验证Ghostscript的安装:

    /opt/ghostscript/bin/gs  --version 
    
  8. 做软连接

    ln -s /opt/ghostscript/bin/gs /usr/bin/ghostscript
    
  9. 配置环境变量

    #vim /etc/profile 
    
    export PATH="/opt/ghostscript/bin:$PATH"
    
    #source  /etc/profile
    
  10. 添加环境后可直接使用 gs --version 命令 来验证是否安装成功

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值