Ubuntu 无法在CircleCi 2.0上安装ffmpeg

Ubuntu 无法在CircleCi 2.0上安装ffmpeg,ubuntu,ffmpeg,debian,ubuntu-14.04,Ubuntu,Ffmpeg,Debian,Ubuntu 14.04,我有一个RubyonRails项目,它使用CircleCi来运行测试。过去我使用CircleCi 1.0,但现在我迁移到CircleCi 2.0。我在安装ffmpeg时遇到问题。Circleci2.0使用Ubuntu 14.04。我是这样安装ffmpeg的: # ffmpeg installation sudo add-apt-repository ppa:mc3man/trusty-media -y sudo apt-get update sudo apt-get install ffmpeg

我有一个RubyonRails项目,它使用CircleCi来运行测试。过去我使用CircleCi 1.0,但现在我迁移到CircleCi 2.0。我在安装ffmpeg时遇到问题。Circleci2.0使用Ubuntu 14.04。我是这样安装ffmpeg的:

# ffmpeg installation
sudo add-apt-repository ppa:mc3man/trusty-media -y
sudo apt-get update
sudo apt-get install ffmpeg
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
我的
circle.yml
config文件如下所示:

# ffmpeg installation
sudo add-apt-repository ppa:mc3man/trusty-media -y
sudo apt-get update
sudo apt-get install ffmpeg
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
当我在CircleCi上运行build时,它返回以下错误:

#!/bin/bash -eo pipefail
bash deploy/circle-dependencies.sh

Fetching: bundler-1.16.0.gem (100%)
Successfully installed bundler-1.16.0
1 gem installed
sudo: add-apt-repository: command not found


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

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

10% [1 InRelease 13.8 kB/145 kB 10%] [Waiting for headers] [Connecting to securHit http://deb.debian.org jessie Release.gpg

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

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

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

Get:4 http://security.debian.org jessie/updates InRelease [63.1 kB]

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

100% [3 Packages 9063 kB]100% [3 Packages 9063 kB]Fetched 9904 kB in 1s (8178 kB/s)

Reading package lists... 1%
Reading package lists... 61%
Reading package lists... Done


Reading package lists... 1%
Reading package lists... Done


Building dependency tree... 0%
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

我怎样才能解决这个问题呢?

因为系统现在是Debian 8.0(jessie)而不是Ubuntu 14.04。您需要启用后端口

sudo sh -c 'echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list'
apt update
apt install -y ffmpeg

因为系统现在是Debian8.0(jessie)而不是Ubuntu 14.04。您需要启用后端口

sudo sh -c 'echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list'
apt update
apt install -y ffmpeg

似乎您遇到了类似“sudo:addaptreepository:commandnotfound”的错误。试着安装一个特殊的软件包“apt-get-install-software-properties-common”,我已经把它添加到了我的构建中,但问题仍然是一样的。哦,这太糟糕了。找到了一些解决方案,只需查看下面的链接。你能添加
cat/etc/os发行版吗?@TarunLalwani:PRETTY\u NAME=“Debian GNU/Linux 8(jessie)”NAME=“Debian GNU/Linux”VERSION\u ID=“8”VERSION=“8(jessie)”ID=Debian HOME\u URL=”“SUPPORT\u URL=”“BUG\u REPORT\u URL=”“似乎你遇到了类似“sudo:add apt repository:command not found”的错误。试着安装一个特殊的软件包“apt-get-install-software-properties-common”,我已经把它添加到了我的构建中,但问题仍然是一样的。哦,这太糟糕了。找到了一些解决方案,只需查看下面的链接。你能添加
cat/etc/os发行版
看看你能得到什么信息吗?@TarunLalwani:PRETTY_NAME=“Debian GNU/Linux 8(jessie)”NAME=“Debian GNU/Linux”VERSION\u ID=“8”VERSION=“8(jessie)”ID=Debian HOME\u URL=”“SUPPORT\u URL=”“BUG\u REPORT\u URL=”“此错误如下:
包ffmpeg不可用,但被另一个包引用。这可能意味着包装丢失,已经过时,或者只能从另一个源获得E:Package'ffmpeg'没有代码为100的安装候选退出
而且我认为添加Backport失败:
deploy/circle-dependencies.sh:line 5:/etc/apt/sources.list:权限被拒绝
我已经尝试使用sudo,但结果相同。需要检查circle ci是否允许添加报告此gaves mi以下错误:
包ffmpeg不可用,但被另一个包引用。这可能意味着包装丢失,已经过时,或者只能从另一个源获得E:Package'ffmpeg'没有代码为100的安装候选退出
而且我认为添加Backport失败:
deploy/circle-dependencies.sh:line 5:/etc/apt/sources.list:权限被拒绝
我已经尝试使用sudo,但结果相同。需要检查circle ci是否允许添加回购协议