Quick Tip: How to Install Media Codecs in Ubuntu 21.10 Impish Idri

Last updated: September 22, 2021

Due to legal reasons, Ubuntu does NOT include multi-media codecs out-of-the-box for audio and video playback. It’s however easy to install them via a single command.

During the Ubuntu installing process, it provides an option “Install third party software for graphics and Wi-Fi hardware and additional media formats” in the wizard. If you didn’t enable it, Ubuntu refuses to play movie and sound via the default Totem media player and Rhythmbox music player.

Without installing third-party player with bundled codecs, you can simply install the ubuntu-restricted-extras package to fix the issue. The package does not contain anything, but tells to install the following packages for you:

  • ttf-mscorefonts-installer – Install Microsoft TrueType core fonts.
  • unrar – non-free package enables ability to extract rar package in Ubuntu.
  • libavcodec-extra – FFmpeg library with encoder / decoder for audio and video codecs.
  • chromium-codecs-ffmpeg-extra – FFmpeg codecs for Chromium based web browser.
  • And a few gstreamer1.0 plugins for audio / video playback, recording and editing.

How to Install Media Codecs in Ubuntu:

Firstly, open a terminal window either by searching from the ‘Activities‘ overview screen or by pressing Ctrl+Alt+T on keyboard.

When terminal opens, copy and paste the command below into it and hit Enter:

sudo apt update && sudo apt install ubuntu-restricted-extras

Type your password (no visual feedback for security reason) when it prompts and hit Enter

For Ubuntu flavors, e.g, KUbuntu, and LUbuntu, there are relevant package to install the commonly used media codecs and fonts.

For KUbuntu users, open terminal emulator from start menu and run the command below instead:

sudo apt update && sudo install kubuntu-restricted-extras

And for LUbuntu, open terminal from start menu and run the command:

sudo apt update && sudo install lubuntu-restricted-extras

That’s all. Enjoy!


I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

23 responses to Quick Tip: How to Install Media Codecs in Ubuntu 21.10 Impish Idri

  1. wow !! its working very well………….thanks jim

  2. Thanks, great work!!!

  3. hi it’s not work on 17.10

  4. Thanks man. I couldn’t do without my music and movies.

  5. Well done Jim

  6. When I try to sudo the restricted extras package I get an error saying it cannot locate such package.

    • You need to run “sudo apt-get update” before it will work.

      • I still dont understand,
        its say “E: Unable to locate package ubuntu-restricted-extras”

        what should i do, when i want try instal from Ubuntu Software Center its stuck at installing but never done

        my Internet connection very fast

        • 1. Search for and launch “Software & Updates” from app launcher. In first tab, make sure the top 4 check-boxes (main, universe, restricted, multiverse) are enabled.

          2. Reload your system repositories when close “Software & Updates”, or run command:

          sudo apt-get update

          Try the 2 steps and it should work

  7. please i just finish installing but it stock with the license
    i can click on okay to continue

  8. Mee too it won’t let me click ok

  9. You need to press TAB to activate the “OK” button. Not immediately obvious!

  10. i’m rewrite this article on my blog

  11. please help me

  12. Thank you so much ! I was lost without music and movies.

  13. Worked 100%. Thankss alot…

  14. Hi it’s not work in ubuntu 17.10

  15. sanjay yadav May 5, 2018 at 7:56 am

    Thank you..

    That worked like butter..

  16. I want to install media files on my laptop which has Ubuntu OS. Can you explain in laymens terms how i do that please.