Unable to instal ffmpeg on CircleCi 2.0

ruby
docker
circle.yml
debugging

#1

I have Ruby on Rails project which uses CircleCi to run tests. In the past I was using CircleCi 1.0 but now I migrated to CircleCi 2.0. I have problem with installing ffmpeg. CircleCi 2.0 uses Ubuntu 14.04. I install ffmpeg like this:

# ffmpeg installation
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:mc3man/trusty-media -y
sudo apt-get update
sudo apt-get install ffmpeg

and my circle.yml config file looks like this:

version: 2
environment:
  TZ: "/usr/share/zoneinfo/America/Los_Angeles"

jobs:
  build:
    parallelism: 2
    working_directory: ~/circleci-survey-builder
    docker:
      - image: circleci/ruby:2.4.1-node
        environment:
          PGHOST: 127.0.0.1
          PGUSER: ubuntu
          RAILS_ENV: test
      - image: circleci/postgres:9.6-alpine
        environment:
          POSTGRES_USER: ubuntu
          POSTGRES_DB: circle_test
          POSTGRES_PASSWORD: ''
    steps:
      - checkout

      - run:
          name: 'Install CircleCI dependencies'
          command: bash deploy/circle-dependencies.sh

      - type: cache-restore
        key: dashboard-{{ checksum "Gemfile.lock" }}

      - run:
          name: 'Install gems'
          command: bundle install --path vendor/bundle

      - type: cache-save
        key: dashboard-{{ checksum "Gemfile.lock" }}
        paths:
          - vendor/bundle

      - run:
          name: 'Install postgresql-client'
          command: sudo apt install postgresql-client

      - run:
          name: 'Create database.yml'
          command: mv config/database.ci.yml config/database.yml

      - run:
          name: Set up SurveyBuilder database
          command: bundle exec rake db:structure:load --trace

      - run:
          name: 'Run tests'
          command: |
            bundle exec rspec spec

It returns following error when I run build:

et:1 http://security.debian.org jessie/updates InRelease [63.1 kB]

Ign http://ppa.launchpad.net jessie InRelease

Get:2 http://security.debian.org jessie/updates/main amd64 Packages [610 kB]

Ign http://deb.debian.org jessie InRelease

Get:3 http://deb.debian.org jessie-updates InRelease [145 kB]

Ign http://ppa.launchpad.net jessie Release.gpg

Hit http://deb.debian.org jessie Release.gpg

Get:4 http://deb.debian.org jessie-updates/main amd64 Packages [23.2 kB]

Ign http://ppa.launchpad.net jessie Release

Hit http://deb.debian.org jessie Release

Err http://ppa.launchpad.net jessie/main amd64 Packages
  

Get:5 http://deb.debian.org jessie/main amd64 Packages [9063 kB]

Err http://ppa.launchpad.net jessie/main amd64 Packages
  

Err http://ppa.launchpad.net jessie/main amd64 Packages
  

Err http://ppa.launchpad.net jessie/main amd64 Packages
  

Err http://ppa.launchpad.net jessie/main amd64 Packages
  404  Not Found

Fetched 9905 kB in 1s (5992 kB/s)
W: Failed to fetch http://ppa.launchpad.net/djcj/hybrid/ubuntu/dists/jessie/main/binary-amd64/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

Reading package lists... Done


Building dependency tree       


Reading state information... Done

Package ffmpeg is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'ffmpeg' has no installation candidate
Exited with code 100

How can I fix this? Everything was working fine on Circle Ci 1.0…


#2

CircleCi 2.0 uses Ubuntu 14.04

Actually, the 2.0 images are debian-based, so you’ll either need to use an ubuntu-based image or make your install script debian-compatible.


#3

@solumos I noticed that after creating this question, but I was still not able to install ffmpeg for Debian…


#4

By installing whatever during a deployment, you’ll pay a time penalty on each deployment, which is not what you want.

Since you’ve moved to CircleCI 2.0, I suggest you to build your own Docker image: use circleci/ruby:2.4.1-node as a base image and install ffmpeg with Docker’s RUN. Then upload this image to https://hub.docker.com/ and specify it in your config.yml.


#5

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.