This is very simple. You need to use the ffmpeg tool.
If your file is named my_file.mkv then use this command:
1 | 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 .