11

I try tar -zxvf plugin\:xyz.tgz and received the error:

rsh: Could not resolve hostname plugin: Name or service not known
tar: plugin\:thold-latest.tgz: Cannot open: Input/output error
tar: Error is not recoverable: exiting now

Can someone help me?

5 Answers 5

1

You could do the following:

mv plugin\:xyz.tgz plugin-xyz.tgz
tar xvfp plugin-xyz.tgz

The name of the archive itself is not really that critical, and the files will extract to the same locations regardless of the archive name.

32

Try --force-local option:

tar -zxvf plugin:xyz.tgz --force-local

From info pages

If you need to use a file whose name includes a colon, then the remote tape drive behavior can be inhibited by using the `--force-local' option.

9

the answer by @csg is spot on.

Another alternative, however, is specifying a path to the archive instead of its filename. This can either be an absolute path, or more simply a path relative to the current directory:

tar -zxvf ./plugin:xyz.tgz

this will force tar to interpret the name as a local file.

1
  • Given how many fewer keystrokes ./ is compared to --force-local (not to mention it's probably easier to remember), I'm astonished this isn't upvoted more than it is...
    – Matthew
    Dec 27, 2020 at 18:08
1

Use the absolute path of tar.

Like this:

/usr/bin/tar -xf plugin:thold-latest.tgz

The part before the ":" is interpreted as a host name, the part after would be a file. Tt tries to execute remsh. But with the absolute path of tar, it won't. Also, if you don't know where tar is on your system, run:

whereis tar

2
  • Hi emb1995, I've already tried your command. It was unsuccessful. Tar keep interpreting ":" as the remote hostname. I had to rename to file and extract it.
    – Dzung
    May 23, 2011 at 3:06
  • @Dzung Try it without the slash after "plugin". Is the slash part of the actual file name?
    – evan.bovie
    May 23, 2011 at 19:25
0

Try Bandit's suggestion of quotes around the filename tar zxvf "blah:23.tar.gz"

Last resort, rename the file at the command line or through an SFTP/SCP application like WinSCP or FileZilla.. You could do this on your local machine and re-upload the renamed file or just login with WinSCP/FileZilla and right-click the file on the remote side and select rename.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .