The "-" is optional for tar options. (More correctly, either the standard option syntax or the historic bundled form are accepted. In bundled form, all the characters of the first argument are options, and all the values for the options come in later arguments. In option form, options can come anywhere, but values must immediately follow their options. So "tar fx file.tar" works, whereas "tar -fx file.tar" mistakes "x" as the filename for "-f".)
The error message in the original post is incomplete, but most likely the file was not downloaded correctly. The only other reason for the third command to fail is if gzip is broken on the system.
DougieLawson wrote:If it's tar.bz2 then use tar -xjvf filename.tar.bz2
If it's tar.gz then use tar -xzvf filename.tar.gz
In recent versions you can use "tar -x
avf" to autodetect the compression based on the extension. This avoids the need to remember that there is also -J for .xz and -Z for .Z, and several others.