Problems installing ffmpeg for my Django project

New to Circle. Previous dev set up environment and I need to add ffmpeg to our image since we run a system call for ffmpeg. I can’t use a docker image for ffmpeg because that’s not how our system runs.

I tried the following as a test:

version: 2
jobs:
  build:
    docker:
      - image: circleci/python:3.6.4
    steps:
      - checkout
      - run: echo "A first hello"
      - run:
          name: Add apt repo for ffmpeg
          command: |
            sudo apt-get install software-properties-common
            sudo add-apt-repository -y ppa:jonathonf/ffmpeg-4
            sudo apt-get update
      - run: sudo apt-get install ffmpeg

But got a lot of errors:

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease Unable to find expected entry ‘main/binary-amd64/Packages’ in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://ppa.launchpad.net/jonathonf/ffmpeg-4/ubuntu/dists/jessie/main/binary-amd64/Packages 404 Not Found

I read somewhere to use “docker run” to install ffmpeg directly onto the image but I’m not experienced in docker either. Can someone help me out?

This forum search will reveal a number of recent duplicate questions. Debian Jessie, which appears to be the parent OS of circleci/python:3.6.4, has been archived by Debian upstream.

A quick check on DockerHub indicates that 3.8 is probably the latest tag, and 3.6 is probably deprecated. Can you bump up to a later version of Python?

3.8.0a3 has a similar problem. I get:

W: The repository ‘http://ppa.launchpad.net/jonathonf/ffmpeg-4/ubuntu eoan Release’ does not have a Release file.
N: Data from such a repository can’t be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/jonathonf/ffmpeg-4/ubuntu/dists/eoan/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Exited with code 100

I tried to use an ubuntu:18.04 image and install ffmpeg. It seemed to work but at the end I read this message:

Download is performed unsandboxed as root as file ‘/var/cache/apt/archives/partial/multiarch-support_2.27-3ubuntu1_amd64.deb’ couldn’t be accessed by user ‘_apt’. - pkgAcquire::Run (13: Permission denied)

Does that mean it failed?

Ah, that’s because your packages index does not exist yet, or is stale. Add this before your installations:

apt-get update && apt-get upgrade -y

That updates the available software index, then brings the OS up-to-date with improvements and security patches. You might get away without an upgrade, but I tend to do it anyway.

I tried 3.7.3 and 3.8.0a3. Both give me the same error:

#!/bin/bash -eo pipefail
sudo sh -c 'echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list'
sudo apt-get update && sudo apt-get upgrade -y
Ign:1 http://deb.debian.org/debian stretch InRelease

(some stuff)

W: The repository 'http://ftp.debian.org/debian jessie-backports Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ftp.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Exited with code 100

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

An alternative idea I tried was to use the ubuntu 18.04 image. I was then able to add ffmpeg without problem but then I do not have circleci group or user…

What is this?

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

That looks like you (or an upstream) are forcing the use of Jessie when, presumably, it is not needed. I accept that it was current for old/deprecated versions of Python, but assuming 3.8 is the latest and greatest, why is that using Jessie? It should be using Stretch (and no modifications to the sources list should be necessary).