Search code examples
ubuntudockerffmpegapt-get

How to install ffmpeg for ubuntu using command line?


A lit background... This is a piece of code in my Dockerfile. I want to deploy my app to google app engine. Somehow I couldn't install ffmpeg.

ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH
RUN apt-get install ffmpeg

This is error log:

E: Unable to locate package ffmpeg
The command '/bin/sh -c apt-get install ffmpeg' returned a non-zero code: 100
ERROR
ERROR: build step "gcr.io/cloud-builders/docker@sha256:ef2e6744a171cfb0e8a0ef27f9b9a34970341bfc0c3d401afdeedca72292cf73" failed: exit status 100

I found this but it didn't work for me. It complained about add-apt-repository is not valid command. https://askubuntu.com/questions/691109/how-do-i-install-ffmpeg-and-codecs

Anyone can help me with this? Thanks!!!


Solution

  • To use the add-apt-repository command you need to:

    apt-get install software-properties-common
    

    This is valid for Ubuntu 14.04 and 16.04.

    sudo add-apt-repository ppa:mc3man/trusty-media
    sudo apt-get update
    sudo apt-get install ffmpeg
    

    Or you can use latest official static builds from here.