Ubuntu does not automatically install some multimedia media codecs and fonts due to licensing and legal reasons. Ubuntu considers DVD, MP3, Quicktime, Windows Media, and a few others as restricted formats you need to install explicitly. You will get the following Unable to play the file error if you try to play files without the proper codec installed.
You have the option to install all these codecs when installing Ubuntu by ticking the Install third-party software for graphics and Wi-Fi hardware and additional media formats checkbox in the Updates and other software panel. The installation will require an active internet connection because the packages are not included in the installer disc or ISO image.
If you missed the option, you can install them using apt. apt repository contains a meta package called ubuntu-restricted-extras that includes these codecs and other proprietary software such as Microsoft fonts.
$ sudo apt update [sudo] password for user: Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB] Hit:2 http://jp.archive.ubuntu.com/ubuntu focal InRelease Hit:3 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:4 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease Fetched 107 kB in 2s (61.1 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date.
$ sudo apt install --assume-yes ubuntu-restricted-extras Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: cabextract chromium-codecs-ffmpeg-extra gstreamer1.0-libav gstreamer1.0-plugins-ugly gstreamer1.0-vaapi i965-va-driver intel-media-va-driver liba52-0.7.4 libaacs0 libaom0 libaribb24-0 libass9 libavcodec-extra libavcodec-extra58 libavfilter7 libavformat58 libavutil56 libbdplus0 libbluray2 libbs2b0 libchromaprint1 libcodec2-0.9 libdvdnav4 libdvdread7 libfftw3-double3 libflite1 libgme0 libgsm1 libgstreamer-plugins-bad1.0-0 libigdgmm11 liblilv-0-0 libmpeg2-4 libmysofa1 libnorm1 libopencore-amrnb0 libopencore-amrwb0 libopenmpt0 libpgm-5.2-0 libpostproc55 librubberband2 libserd-0-0 libshine3 libsidplay1v5 libsnappy1v5 libsord-0-0 libsratom-0-0 libssh-gcrypt-4 libswresample3 libswscale5 libva-drm2 libva-wayland2 libva-x11-2 libva2 libvdpau1 libvidstab1.1 libvo-amrwbenc0 libx264-155 libx265-179 libxvidcore4 libzmq5 libzvbi-common libzvbi0 mesa-va-drivers mesa-vdpau-drivers ocl-icd-libopencl1 ttf-mscorefonts-installer ubuntu-restricted-addons unrar va-driver-all vdpau-driver-all Suggested packages: gstreamer1.0-vaapi-doc i965-va-driver-shaders libbluray-bdj libdvdcss2 libfftw3-bin libfftw3-dev serdi sidplay-base sordi opencl-icd libvdpau-va-gl1 nvidia-vdpau-driver nvidia-legacy-340xx-vdpau-driver nvidia-legacy-304xx-vdpau-driver Recommended packages: gstreamer1.0-fluendo-mp3 The following NEW packages will be installed: cabextract chromium-codecs-ffmpeg-extra gstreamer1.0-libav gstreamer1.0-plugins-ugly gstreamer1.0-vaapi i965-va-driver intel-media-va-driver liba52-0.7.4 libaacs0 libaom0 libaribb24-0 libass9 libavcodec-extra libavcodec-extra58 libavfilter7 libavformat58 libavutil56 libbdplus0 libbluray2 libbs2b0 libchromaprint1 libcodec2-0.9 libdvdnav4 libdvdread7 libfftw3-double3 libflite1 libgme0 libgsm1 libgstreamer-plugins-bad1.0-0 libigdgmm11 liblilv-0-0 libmpeg2-4 libmysofa1 libnorm1 libopencore-amrnb0 libopencore-amrwb0 libopenmpt0 libpgm-5.2-0 libpostproc55 librubberband2 libserd-0-0 libshine3 libsidplay1v5 libsnappy1v5 libsord-0-0 libsratom-0-0 libssh-gcrypt-4 libswresample3 libswscale5 libva-drm2 libva-wayland2 libva-x11-2 libva2 libvdpau1 libvidstab1.1 libvo-amrwbenc0 libx264-155 libx265-179 libxvidcore4 libzmq5 libzvbi-common libzvbi0 mesa-va-drivers mesa-vdpau-drivers ocl-icd-libopencl1 ttf-mscorefonts-installer ubuntu-restricted-addons ubuntu-restricted-extras unrar va-driver-all vdpau-driver-all 0 upgraded, 71 newly installed, 0 to remove and 0 not upgraded. Need to get 44.0 MB of archives. After this operation, 186 MB of additional disk space will be used. Do you want to continue? [Y/n] ##### snipped
Replace ubuntu-restricted-extras with kubuntu-restricted-extras, lubuntu-restricted-extras or xubuntu-restricted-extras accordingly if you're using the corresponding Ubuntu derivatives.
Comment anonymously. Login not required.