ebextensions: yum 不安装包

Posted

技术标签:

【中文标题】ebextensions: yum 不安装包【英文标题】:ebextensions: yum does not install package 【发布时间】:2015-05-01 23:06:56 【问题描述】:

我正在尝试制作一个将安装 wkhtmltopdf 的 ebextensions 文件。

目前看起来是这样的:

packages: 
 yum:
  xorg-x11-fonts-75dpi: []
  libpng: []
  xz: [] 
  urw-fonts: []
  libXext: []
  openssl-devel: []
  libXrender: []
rpm:
   wkhtmltopdf: https://s3-eu-west-1.amazonaws.com/myS3Account/wkhtmltox-0.12.2.1_linux-centos5-amd64.rpm

在这种情况下,wkthmltopdf 无法安装。我收到以下错误:

Failed dependencies:
  xorg-x11-fonts-75dpi is needed by wkhtmltox-1:0.12.2.1-1.x86_64

如果我使用 SSH 连接到我的 EC2 实例,我可以通过手动运行“yum install xorg-x11-fonts-75dpi”,然后运行“wget wkthmltopdf-...”和“rpm --install”来成功安装 wkhtml wkhtmltopdf-..”。如果我跳过 yum 步骤,rpm 会抱怨 wkhtmltopdf 需要 xorg 包。

似乎 ebextensions 在部署时未安装 xorg-x11-fonts-75dpi。我做错了吗?

【问题讨论】:

【参考方案1】:

根据文档:

Packages are processed in the following order: rpm, yum, and then rubygems and python.

Elastic beanstalk 首先处理您的 rpm 包,导致错误并且永远不会访问 yum 包。

有几种方法可以解决这个问题。

1) 通过类似的命令运行 rpm 安装

commands:
    install_wkhtmltox:
        command: yum -y install https://s3-eu-west-1.amazonaws.com/myS3Account/wkhtmltox-0.12.2.1_linux-centos5-amd64.rpm

这应该会通过 yum 自动解决依赖关系。

2) 将 .ebextensions 文件拆分为两个:01_install_dependencies.config 和 02_install_wkhtmltox.config。在 01 文件中安装 yum 包,在 02 文件中安装 rpm。这样你就可以“覆盖”包安装顺序

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-packages

【讨论】:

嗨,我在使用此扩展安装 ffmpeg 时遇到了这个问题:任何帮助将不胜感激。 ` Yum 没有可用于安装的 commands-06-pecl。 EBExtension 中列出的包安装失败。'

以上是关于ebextensions: yum 不安装包的主要内容,如果未能解决你的问题,请参考以下文章

yum 安装包时提示:[Errno 5] [Errno 2] No such file or dir

Execute yum update—File”/usr/libexec/urlgrabber-ext-down”,line75,in

已安装软件包时避免 yum 错误

AWS codeBuild 不运行 .ebextension 配置

yum安装软件之后如何保存rpm安装包

使用 Rails 部署 AWS - .ebextensions 中的配置文件