How to: Linux Play DivX .avi video codec file

last updated in Categories Debian Linux, Linux, Linux desktop, Linux distribution, Ubuntu Linux

From my mail bag:


I’ve downloaded .avi files which is compressed into small sizes while maintaining relatively high visual quality using DivX format. How do I play DivX compressed files under Debian / Ubuntu Linux?

The current version of the DivX Community Codec for the Windows platform is version 6.6, and for Mac OS X is 6.6x. There is no Linux version available however with the help of VLC and DivX for Linux codec, you should able to play all sort of DivX files.

Download and Install DivX Linux Codec

Open terminal and type the following command to download DivX codec:
$ cd /tmp
$ wget

Untar DivX 6.1.1 codec for Linux:
$ tar -zxvf divx611-20060201-gcc4.0.1.tar.gz
Install divx611 codec:
$ cd divx611-20060201-gcc4.0.1
$ sudo ./

Press Q after reading agreement, please type yes to install codes.

Install vlc player

The VLC media player can be installed using apt-get command, type:
$ sudo apt-get update
$ sudo apt-get install vlc

How do I play files?

Open VLC player by Visiting Applications > Sound and Video > VLC Player. You can also open terminal and type the command:
$ vlc /path/to/my-downloaded-movie.avi

Further readings:


Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

36 comment

  1. I tried the above procedure mentioned. But after i did ” sudo ./ ” , it asked me to enter a password.

    I’m even unable to extract the files because it is password protected. How do I resolve this to install divx codecs on my linux ??

  2. thankyou sooo much for the instructions on installing the divx codec… worked only thing is…i still cant figure out how to watch a streaming movie even with the codec….the further instructions and after installing vlc…i even removed mplayer…for example on a site such as…..the website still tells me that i’m missing the codec…even though i have installed it and i even tried reinstalling it just in case.but it says its installed…can anyone help…im out of ideas…

  3. You don’t need to install any codecs.
    VLC Media player does the job without any assistance. You will only have problems with .asf, .wmv and .rm (Proprietary media formats)

    It works both for Linux as well as Windows

    Go read the home page.

  4. Well, after installed the codec, the existing VLC 0.9 beta still could not open those DIVX video, any ideas?

    I found nothing been left after the installation inside /tmp

    How to incorporate the codec to work with VLC?

  5. As mentioned above; VLC uses it’s own codecs; installing the DivX codec pack will not make it play in VLC.

    I’m at a loss as to any tool that actually uses the “official” DivX library.

  6. i types my own password but it didnt work, by own pass word what do you mean, if you mean the password to log onto the computer, it doesnt work, so please tell me what password to type

  7. brian@brian:/tmp/divx611-20060201-gcc4.0.1$ $ sudo ./
    bash: $: command not found

    um.. how can i fix this because i followed all directions up to here — it is hopefully apparent to you all that i am stuck.

    any help would be of great use to me.
    thanks, brian

  8. sudo needs root password. If your guys are so dumb why are you using Linux in the first place? Stick to StupidSoft.

      1. sudo gives a regular user account super/root rights. You put sudo in the front of your command when it requires you to read or write system files that you’re regular account is not a owner/group member of.

  9. I ran through the steps without a problem. Except I am trying to us VLC as my streaming video client for play divx videos through firefox. How can I set that up?

  10. i did all the steps..but vlc’s only got sound and no video…did i do something wrong? i got confirmation that divx installed properly but no go =( help!

  11. Me too have the password problem as karthik and Adam
    I think contents.dat is separately password protected.

    Brian pls chk ur help files to know correct usage of ‘sudo’ command
    { sudo **ur extracted file path**/}
    to goto root type sodo -i at terminal and follow the steps above

  12. In order to use sudo you must have an entry in /etc/sudoers file.
    Usually in the following format:
    username ALL=(ALL) ALL

    When using sudo command you will need to provide your own username password.

    If sudo has not been setup you need to become a root user (just type: su and provide root password) and then add the following line into /etc/sudoers file. After that sudo should work.

  13. @jimmyjiggle
    m8 suppose you’ve born with linux pre installed inside your brain…
    give a chance to 0thers jump into Linux, is what Linux forums standing for.
    If you do not want to be helpful, maybe windows is a better place for u.
    After all there has not to be any answer , simply cause everything is locked 😉

  14. if sudo doesn’t work try sudo’s for ubuntu and some other versions. it will ask you your password and after you submit it it will change u to superuser. after you do whatever u want enter exit to became a regular user again.

  15. I installed was able to run the installation file for divx code on fedora 10 but i open some sort of agreement text and didnt move further could anyone guide me what to do next.

  16. Rocky – “Press Q after reading agreement, please type yes to install codes.”
    Thanks – this works on the Aspire One’s Linux.

  17. Hello!
    I’ve got also kubuntu and line : sudo apt-get vlc doesn’t works…
    what might be the problem and how to fix it?

  18. Hi,
    during apt-get update i recieved the following error:

    pc000113:/tmp/divx611-20060201-gcc4.0.1 # apt-get update
    Ign update/11.1 repomd.xml
    Get:1 11.1/repo/oss/suse repomd.xml [951B]
    Fetched 951B in 0s (6395B/s)
    Err update/11.1/ primary.xml
      404 Not Found
    Err update/11.1/ filelists.xml
      404 Not Found
    Hit 11.1/repo/oss/suse/ primary.xml
    Hit 11.1/repo/oss/suse/ filelists.xml
    Failed to fetch  404 Not Found
    Failed to fetch  404 Not Found
    Reading Package Lists... Error!
    E: Dynamic MMap ran out of room
    E: Error occured while processing transmission-gtk (NewVersion1)
    E: Problem with MergeList /var/lib/apt/lists/ftp-1.gwdg.de_pub_opensuse_distribution_11.1_repo_oss_suse_repodata_primary.xml
    E: The package lists or status file could not be parsed or opened.


  19. I’m a Mac user who is just now venturing into Linux.
    I too was having a problem with the install.
    Pressing “Q” worked. Thank you!

    But how was a newbie supposed to know that I needed to press “Q”?
    That’s not very intuitive.


  20. I followed the instructions to the letter, divx is definitely installed but still cannot play files either on vlc, xine or gstreamer… annnnnnd vlc does not appear to have any codecs at all installed for use…weird…

  21. Many thanks for your instructions for installing DIV X, they worked perfectly with Xubuntu and VLC Player.

  22. How to play mp3, .avi, .3gp, .mpeg, .dob, and .flv files in ubuntu and fedora.
    How to install other software like vlc player, powr dvd on ubuntu and fedora
    Please reply

  23. good morning every one !!!

    could any one plz tell me how to get direct download to vlc player then direct command to install it on suse linux with out problems so i can watch my flv,mpeg files..etc that are only working on windows …i do really appreciate your efforts

  24. VNC install doesn’t work – when running ‘sudo apt-get vlc’ I get an error (E: Invalid operation vlc)

  25. Hi!

    Thanks for the tutorial…
    But instead of “sudo apt-get vlc” you should type “sudo apt-get install vlc”

    Have a question? Post it on our forum!