This simple tutorial shows how to install the latest version of MPV media player in Debian 11, which also works on Ubuntu 20.04/18.04.
MPV is a fork of MPlayer/MPlayer 2. It’s a free and open-source media player works on Linux, Windows, macOS, and BSD. And some popular media players, e.g., SMPlayer and Celluloid (aks Gnome MPV), use MPV as backend.
Though it’s a command-line application, MPV has app shortcut and can open video from files’ context (right-click) menu. And it provides basic mouse actions to control video playback. As well, there are many keyboard shortcuts, you can find them via
man mpv command.
How to Install MPV in Debian:
Install MPV via official Debian repository:
The Debian 11 bullseye repository includes MPV 0.32 and provides only security updates for the package.
terminal from your system start menu.
Then you can install it via single command:
sudo apt update && sudo apt install mpv
Install the Latest MPV and keep up-to-date:
For those prefer the latest features as well as bug-fixes, MPV refers to the apt repository for both Debian and Ubuntu LTS.
The repository provides up-to-date MPV packages, v0.33.1 at the moment, for 64-bit desktop computers & laptops.
1.) Install the repository key:
To make your system trust the packages from the repository, you have to first download & install keyring.
To get the key, copy and paste the command below into terminal and hit Enter:
curl https://non-gnu.uvt.nl/debian/uvt_key.gpg --output uvt_key.gpg
For Ubuntu, curl is not available out-of-the-box, install it via
sudo apt install curl if you don’t have it.
And to install the key, just move the key to ‘/etc/apt/trusted.gpg.d‘ directory since apt-key command is deprecated. To do so, run command:
sudo mv uvt_key.gpg /etc/apt/trusted.gpg.d
2.) Enable https support for apt package manager.
This can be done easily by installing the “apt-transport-https” package via command:
sudo apt install apt-transport-https
3.) Add the apt repository for MPV:
You can now create a source file under “/etc/apt/sources.list.d” directory, and insert the line below to add the apt repository:
deb [arch=amd64] https://non-gnu.uvt.nl/debian CODE_NAME uvt
And this can be done by running a single command in terminal (copy & paste, then hit Enter):
sudo sh -c 'echo "deb [arch=amd64] https://non-gnu.uvt.nl/debian $(lsb_release -sc) uvt" >> /etc/apt/sources.list.d/non-gnu-uvt.list'
NOTE: The command works for current Debian stable & Ubuntu LTS (Ubuntu 20.04, Ubuntu 18.04), since “
$(lsb_release -sc)” outputs system code name automatically. Other systems (e.g., elementary OS, Deepin, Zorin OS) have to replace it with “bullseye”, “focal”, or “bionic” depends on which one your system based on.
And update system package cache by running command:
sudo apt update
4.) Set apt repository priority:
The repository by default has a low priority. When you trying to install a package, it will use the one from Debian repositories first, even an older version is preferred. When means, it won’t install the latest MPV package until you set a higher priority.
Firstly, open terminal and run command to create & edit a config file:
sudo nano /etc/apt/preferences.d/non-gnu-uvt
When the file opens, write following lines to set the priority of MPV package from UvT repository to 500.
Pin: release o=UvT
Then press Ctrl+X, type y, and hit Enter to save it.
5.) Finally, install / upgrade MPV:
You can finally install or upgrade mpv media player via apt command:
sudo apt install mpv
Or use system update manager (Software Updater) if any.
Uninstall MPV & apt repository:
For Gnome Desktop, there’s a ‘Software & Updates‘ utility. You can open it and navigate to “Other Software” tab to manage third-party apt repositories.
Or just remove the source file by running command in terminal:
sudo rm /etc/apt/sources.list.d/non-gnu-uvt.list
As well, remove the package priority file via command:
sudo rm /etc/apt/preferences.d/non-gnu-uvt
And to remove mpv media player, use command:
sudo apt remove --autoremove mpv