Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ebextensions: yum does not install package

I am trying to make an ebextensions file which will install wkhtmltopdf.

Currently it looks like this:

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

In this case, wkthmltopdf fails to install. I get the following error:

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

If I use SSH to connect to my EC2 instance, I can sucessfully install wkhtml by manually running "yum install xorg-x11-fonts-75dpi", followed by "wget wkthmltopdf-..." and "rpm --install wkhtmltopdf-..". If I skip the yum step, rpm complains that wkhtmltopdf needs the xorg package.

It seems like xorg-x11-fonts-75dpi is not installed by ebextensions on deploy. Am I doing something wrong?

like image 472
DkM Avatar asked Mar 01 '15 15:03

DkM


People also ask

How do I install a package using yum?

1. Install a package using yum install. To install a package, do 'yum install packagename'. This will also identify the dependencies automatically and install them.

What is Ebextensions?

You can add AWS Elastic Beanstalk configuration files ( . ebextensions ) to your web application's source code to configure your environment and customize the AWS resources that it contains. Configuration files are YAML- or JSON-formatted documents with a . config file extension that you place in a folder named .

How do I install yum from a specific repo?

Install a Package from a Specific Repository To install a particular package from a specific enabled or disabled repository, you must use --enablerepo an option in your yum command. For example to Install the PhpMyAdmin package, just execute the command.

Is Elastic Beanstalk is object based storage?

Elastic Beanstalk creates an Amazon S3 bucket named elasticbeanstalk- region - account-id for each region in which you create environments. Elastic Beanstalk uses this bucket to store objects, for example temporary configuration files, that are required for the proper operation of your application.


Video Answer


1 Answers

According to the docs:

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

Elastic beanstalk first processes your rpm package, causing the error and never gets to the yum packages.

There are a few ways to solve this.

1) Run the rpm install through a command like

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

This should automatically solve dependencies through yum.

2) Split the .ebextensions files to two: 01_install_dependencies.config and 02_install_wkhtmltox.config. In the 01-file install yum packages, in the 02 file install the rpm. This way you can "override" the package installation order

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

like image 108
user541905 Avatar answered Sep 25 '22 20:09

user541905