Handbrake is a free and open-source video transcoding tool for those looking to convert their videos from one format to another. Compatible with various popular formats such as MP4, AVI, MKV, and M4V, Handbrake offers users the ability to reduce the file size of a video, change the container or codec of a video, and also extract audio tracks from a video. On top of its transcoding capabilities, Handbrake takes things further by providing features like adding subtitles, cropping and resizing videos, and adjusting both video and audio settings.
In the following tutorial, you will learn how to install Handbrake on Linux Mint 21 or Linux Mint 20 using the command line terminal with various methods to install the transcoding software and update and remove the software if needed.
Update Linux Mint – Upgrade System Packages
First, update your system to ensure all existing packages are up to date to avoid any conflicts during the installation.
sudo apt update
Optionally, you can list the updates for users who require review or are curious.
sudo apt --list upgradable
Proceed to upgrade any outdated packages using the following command.
sudo apt upgrade
Method 1: Install HandBrake with APT Default
Handbrake is available in the default repository, making it easy to install. The only downside of this method is in time, which can be a few versions behind the current.
Use the following command to begin the installation.
sudo apt install handbrake -y
Method 2: Install HandBrake with APT and a PPA
The second option is to use the LaunchPAD PPA APT repository by Rob Savoury. This PPA contains the latest version of HandBrake at all times and is probably the best option for Linux Mint users to grab the newest version without resorting to third-party package managers such as Flatpak. I will advise this method can cause system issues potentially, so if you are very new to Linux, I suggest using Method 3 or 1.
Use the following command to install or check if the packages are installed before importing the PPA.
sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https -y
For users who have not previously imported a GPG key from the Ubuntu keyserver, the command line terminal will often have issues importing GPG keys from LaunchPAD PPAs because the directories are not created. This is an easy fix. Use the following command that will, in turn, generate the directories.
sudo gpg --list-keys
Example output:
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
This can be skipped, but if you encounter an issue, just run the command and re-try.
Next, import the GPG key needed for all the repositories.
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/rob-savoury.gpg --keyserver keyserver.ubuntu.com --recv-keys E996735927E427A733BB653E374C7797FB006459
Example output:
gpg: keybox '/usr/share/keyrings/rob-savoury.gpg' created
gpg: key 374C7797FB006459: public key "Launchpad PPA for Rob Savoury" imported
gpg: Total number processed: 1
gpg: imported: 1
Import the PPAs as this build of HandBrake is built with FFMpeg 4 and 5; this will modify your system files more than usual, so I suggest taking a backup of your system before installing it just in case you notice any side effects. Overall, these versions of FFMpeg are more up-to-date than the standard distribution versions but potentially can clash with other third-party installations.
Ensure you import the correct command that matches your Linux Mint distribution.
Import HandBrake LaunchPAD PPAs for Linux Mint 21
echo 'deb [signed-by=/usr/share/keyrings/rob-savoury.gpg] https://ppa.launchpadcontent.net/savoury1/handbrake/ubuntu jammy main' | sudo tee -a /etc/apt/sources.list.d/handbrake-rob-savoury.list
echo 'deb [signed-by=/usr/share/keyrings/rob-savoury.gpg] https://ppa.launchpadcontent.net/savoury1/ffmpeg4/ubuntu jammy main' | sudo tee -a /etc/apt/sources.list.d/ffmpeg-4-rob-savoury.list
echo 'deb [signed-by=/usr/share/keyrings/rob-savoury.gpg] https://ppa.launchpadcontent.net/savoury1/ffmpeg5/ubuntu jammy main' | sudo tee -a /etc/apt/sources.list.d/ffmpeg-5-rob-savoury.list
Import HandBrake LaunchPAD PPAs for Linux Mint 20
echo 'deb [signed-by=/usr/share/keyrings/rob-savoury.gpg] https://ppa.launchpadcontent.net/savoury1/handbrake/ubuntu focal main' | sudo tee -a /etc/apt/sources.list.d/handbrake-rob-savoury.list
echo 'deb [signed-by=/usr/share/keyrings/rob-savoury.gpg] https://ppa.launchpadcontent.net/savoury1/ffmpeg4/ubuntu focal main' | sudo tee -a /etc/apt/sources.list.d/ffmpeg-4-rob-savoury.list
echo 'deb [signed-by=/usr/share/keyrings/rob-savoury.gpg] https://ppa.launchpadcontent.net/savoury1/ffmpeg5/ubuntu focal main' | sudo tee -a /etc/apt/sources.list.d/ffmpeg-5-rob-savoury.list
Next, run an APT update to reflect the new additions.
sudo apt update
Before you continue, run an APT upgrade, as many dependencies will need to be upgraded, it is best to do this before the installation. Remember, before upgrading, please ensure you have done a backup just in case anything breaks.
sudo apt upgrade
Now install HandBrake from the PPA using the following apt install command.
sudo apt install handbrake -y
Method 3: Install HandBrake with Flatpak and Flathub
The third option is to use the popular package manager Flatpak. By default, this should be already installed on your Linux Mint desktop.
First, re-install Flatpak if you have removed it previously. If unsure, just run the command.
sudo apt install flatpak -y
The next step is to reboot your system if you have re-installed Flatpak; if not, skip it.
reboot
Next, you need to enable Flatpack using the following command in your terminal:
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Now begin the installation using the following flatpak command.
flatpak install flathub fr.handbrake.ghb -y
Troubleshoot HandBrake Flatpak Installation
First, the most common error when installing a Flatpak from Flathub is the following error output.
"error: Unable to load summary from remote flathub: Can't fetch summary from disabled remote 'flathub,"
The fix is simple, run the following command to enable Flathub.
flatpak remote-modify --enable flathub
This will fix the issue the above issue. The next issue can be access to system files. I would only recommend using the following command if you have access permission with your installation accessing files; use the override command below.
sudo flatpak override fr.handbrake.ghb --filesystem=host
Please do not use this command by default unless it is needed.
How to Launch HandBrake
With the installation complete from either method, you can run the application in a few different ways.
First, while you are in your terminal, you can use the following command:
handbrake
Flatpak users will need to launch using the command below from a terminal instance:
flatpak run fr.handbrake.ghb
For most desktop users, you would follow the path.
Taskbar > Sound & Video > HandBrake.
Example:
Now open Handbrake to the default landing screen. From here, you can begin using the transcoding software.
Example:
Additional Commands & Tips
How to Update HandBrake
Updates should appear in notifications, but if these fail to show sometimes, it is recommended to check using the terminal regardless; use one of the following commands to check for updates.
HandBrake APT Update Method
sudo apt update
HandBrake Flatpak Update Method
flatpak update
How to Remove (Uninstall) HandBrake
Use one of the following commands to suit the original installation method for users who no longer require the paint application.
HandBrake APT Remove Method
sudo apt autoremove handbrake --purge -y
Now, for users that installed FFMpeg 4 and 5 from the PPA, use the following command to remove it.
sudo apt autoremove ffmpeg --purge
Lastly, you must remove the PPA sources list file, or else you may install system files from this PPA again.
sudo rm /etc/apt/sources.list.d/ffmpeg-5-rob-savoury.list \
/etc/apt/sources.list.d/ffmpeg-4-rob-savoury.list \
/etc/apt/sources.list.d/handbrake-rob-savoury.list
HandBrake Flatpak Remove Method
flatpak remove --delete-data fr.handbrake.ghb -y
Next, run the following command for any leftover clean-ups required, similar to the autoremove command described for the apt remove example command.
flatpak remove --unused
Conclusion
HandBrake is a great way to reduce the size of your video files without any noticeable loss in quality. If you have a lot of videos that need converting or want to save some space on your hard drive, Handbrake is worth checking out.
For more information, visit the official Handbrake documentation.