Apr 28, 2015

f Comment

Unix command tar: fixing "Exiting with failure status due to previous errors" in SECONDS!

Amazon When you execute the tar command in Unix, you may see the following error:

tar: Exiting with failure status due to previous errors

Read on to see the cause of this error and how to fix it.

My Unix version: Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-43-generic x86_64)

Background

The command I was trying to run is:

tar -zcvf someFolder.tar.gz someFolder

It ran for a while, but in the end it gave the error:

tar: Exiting with failure status due to previous errors

Read on to see how to fix this tar error.

Solution 1

The fix is simple. You need to know what "previous errors" are. But with the -v option, the errors quickly get lost in the verbiage. So run the command again without "v" so that you see the errors. Here's the command:

tar -zcf someFolder.tar.gz someFolder

This time you should be able to see the errors and fix them accordingly. If for some reason you are not willing to run the tar command again, read on.

Solution 2

A probable cause of this tar error is because some files you are trying to compress may have been created by root, and you don't have the permission to compress them. Therefore, simply use sudo like so:

sudo tar -zcf someFolder.tar.gz someFolder

This command fixed my problem. If it still doesn't fix the problem for you, let me know.

Questions? Let me know!
Please leave a comment here!
One Minute Information - by Michael Wen
ADVERTISING WITH US - Direct your advertising requests to Michael