I think the easiest and most reliable tool for that is
libav-tools, Ubuntu's successor of the once venerable
ffmpeg. It is the backend for many of the GUI tools cited in other answers.
Changing container without re-enconding content could not be simpler:
avconv -i input.mkv -codec copy output.mp4
It auto-detects a Matroska > MPEG4 container conversion based on input/output filenames.
-codec copy tells all content should be copied as-is without re-encoding.
If format auto-detection fails, you can use the
-f option before either input, output, or both. From the manual:
f fmt (input/output)
Force input or output file format. The format is normally
autodetected for input files and guessed from file extension for
output files, so this option is not needed in most cases.
Also, after reading the comments, it is worth noting: the above syntax will copy all the files' content to the new container, but some containers may not support some content. So check if your chosen container format, be it
mp4 or even
avi has support for all the content in your files (video type, audio type, subtitles, etc). For example,
mp4 does not support soft subtitles (