How to convert mkv file into avi file format with ffmpeg.

This is very simple. You need to use ffmpeg tool.
If your file is named my_file.mkv then use this command:
ffmpeg -acodec copy -vcodec copy -i my_file.mkv out_file.avi
The output will be out_file.avi with directly copy the audio and video streams from the mkv to an avi .