How to Install FFMPEG 6.0 in Debian 12 Stable [Step by Step]

This is a step by step guide shows how to install the latest FFMPEG 6.0 media libraries in Debian 12 ‘bookworm’!

1. FFMPEG is an important library that many apps depend on it! Updating FFMPEG might cause dependency issues!
2. ONLY install FFMPEG 6.0 that you do need it, for certain feature or bug-fix!

Step 1: Add Deb Multimedia Repository

The Debian 12 system repository provides FFmpeg 5.1.3, while the latest has reached v6.0. And, the deb-multimedia.org is a popular 3rd party repository that contains many media app packages for Debian, including FFMPEG 6.0.

1. To add the repository, first open terminal emulator (or konsole) either from start/applications menu or ‘Activities’ overview depends on your desktop environment.

2. When terminal opens, run command:

sudo nano /etc/apt/sources.list.d/deb-multimedia.sources

The command creates a source file (if not exist) under ‘/etc/apt/sources.list.d‘ file, then edit it with nano command line text editor.

There copy and paste the following lines into the file:

Types: deb
URIs: https://www.deb-multimedia.org
Suites: stable
Components: main non-free
Signed-By: /etc/apt/trusted.gpg.d/deb-multimedia-keyring.gpg

Finally, press Ctrl+X, type y and hit Enter to save file.

Step 2: Install the Keyring

As you see, the first step has added ‘Signed-By’ section to specify the key. Now, let’s download and install the keyring.

1. Firstly, select download the latest key file. At the moment of writing, it’s ‘deb-multimedia-keyring_2016.8.1_all.deb‘.

2. Once you got the key .deb file, open terminal and run command to install it (assume you saved it under ‘Downloads’ folder):

sudo apt install ~/Downloads/deb-multimedia-keyring*.deb

Step 3: Set the Package Priority

The deb-multimedia repository also contains many other software packages. It’s better to set a lower priority, so your system will NOT install any package from that repository, unless you intend to.

1. Also, open terminal and run command:

sudo nano /etc/apt/preferences.d/99deb-multimedia

This command create a config file under ‘/etc/apt/preferences.d‘, then open with nano command line text editor.

2. When file opens in terminal, copy and paste the following lines:

Package: *
Pin: origin www.deb-multimedia.org
Pin-Priority: 1

Finally, press Ctrl+X, type y and hit Enter to save file.

Step 4: Install FFmpeg 6

After adding source repository, installing the keyring, and setup priority, finally install FFmpeg library by running following commands.

1. First, run command to refresh system package cache:

sudo apt update

2. Then, install or upgrade to FFmpeg 6.0:

sudo apt install -t 'o=Unofficial Multimedia Packages' ffmpeg

NOTE: -t 'o=Unofficial Multimedia Packages' option is required to tell installing package from that repository.

Uninstall

To simply restore FFMPEG to the stock version in your system repository, run command:

sudo apt install ffmpeg=7:5.1.3-1

Change 7:5.1.3.-1, the stock version number, depends on apt policy ffmpeg command output.

However, the last command will leave most other dependency libraries un-downgraded. To, downgrade all the packages, try using synaptic package manager to do force version (‘Package -> Package Version’) for each installed packages.

To remove the deb-multimedia.org repository, run the 2 commands to remove both the source and key files:

sudo rm /etc/apt/sources.list.d/deb-multimedia.sources
sudo rm /etc/apt/trusted.gpg.d/deb-multimedia-keyring.gpg

And finally run sudo apt update to refresh package cache.

Hi, I'm Merilyn Ne, a computer geek working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.