LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Help! Tar is missing (https://www.linuxquestions.org/questions/linux-software-2/help-tar-is-missing-4175571419/)

Lpjj 02-04-2016 10:26 AM

Help! Tar is missing
 
Hi, I've been running Mint 17 for some time now. Somehow, now it seems, that Tar is missing from my system. I've tried loading it from Terminal, from Software Manager, and from Synaptic Package Manager, all fail. This is preventing me from downloading other software that I need including JDK,JRE Oracle Java8, and Oracle virtualbox. In the Synaptic Package Manager dpkg shows, Broken dependency due to missing Tar. Does anyone know how to fix this problem? Thankyou!!!

Following is the Terminal history I get when trying to install it:

jack@Built-by-Jack ~ $ tar
The program 'tar' is currently not installed. You can install it by typing:
sudo apt-get install tar
jack@Built-by-Jack ~ $ sudo apt-get install tar
[sudo] password for jack:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libcurl3
Use 'apt-get autoremove' to remove it.
Suggested packages:
ncompress tar-scripts
The following NEW packages will be installed:
tar
0 upgraded, 1 newly installed, 0 to remove and 674 not upgraded.
Need to get 0 B/195 kB of archives.
After this operation, 803 kB of additional disk space will be used.
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)

when I try to install Tar from Synaptic Package Manager it fails with this MSG.

(synaptic:21283): GLib-CRITICAL **: g_child_watch_add_full: assertion 'pid > 0' failed
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
A package failed to install. Trying to recover:
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin

kilgoretrout 02-04-2016 10:43 AM

Post the output of the following:
Code:

sudo which tar
sudo echo $PATH

The tar command is usually located in /bin in Debian based systems like Mint. If it's not there and won't install you can take a look at this similar post where the guy solved the problem by copying tar into /bin from another working ubuntu system:

https://askubuntu.com/questions/3345...not-executable

Lpjj 02-04-2016 12:42 PM

Thanks so much Kilgoretrout, It looks like exactly the same problem. On my system there is no tar in Bin, like theirs. however, they had another working system to copy it over from, they solved it doing that copy. I don't have another Linux machine around. More Suggestions! Best,

ardvark71 02-04-2016 12:57 PM

Quote:

Originally Posted by Lpjj (Post 5495201)
Thanks so much Kilgoretrout, It looks like exactly the same problem. On my system there is no tar in Bin, like theirs. however, they had another working system to copy it over from, they solved it doing that copy. I don't have another Linux machine around. More Suggestions! Best,

Hi...

If you would, please post the results of the command kilgoretrout mentioned. ;)

Regards...

Lpjj 02-04-2016 03:22 PM

jack@Built-by-Jack ~ $ sudo which tar
jack@Built-by-Jack ~ $ sudo echo tar
tar
jack@Built-by-Jack ~ $ sudo which tar
[sudo] password for jack:
jack@Built-by-Jack ~ $ sudo echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
jack@Built-by-Jack ~ $

Habitual 02-04-2016 03:32 PM

You missed half the output message:
dpkg: warning: 'tar' not found in PATH or not executable
Have you checked permissions on /bin/tar ?

jefro 02-04-2016 03:41 PM

Agreed. " checked permissions on /bin/tar ?"

May be in some odd location too. Maybe use find -name from /

Some other program may be installed to do a similar task but that isn't what you wanted.

kilgoretrout 02-04-2016 04:04 PM

Quote:

Agreed. " checked permissions on /bin/tar ?"
He said he already looked in /bin and tar was not there. To be doubly sure run and post the output of:

Code:

$ sudo find / -name "tar"
If "/bin/tar" is not in the output of the above command, tar is not there, just like in the ubuntu thread I posted earlier. If you don't get a location for tar in another location in the above output, it's nowhere on your system. I think that will be the likely outcome here, but I would like it clearly established before continuing.

Habitual 02-04-2016 05:32 PM

Quote:

Originally Posted by kilgoretrout (Post 5495320)
He said he already looked in /bin and tar was not there. To be doubly sure run and post the output of:

Code:

$ sudo find / -name "tar"
If "/bin/tar" is not in the output of the above command, tar is not there, just like in the ubuntu thread I posted earlier. If you don't get a location for tar in another location in the above output, it's nowhere on your system. I think that will be the likely outcome here, but I would like it clearly established before continuing.

Well, at first he did, then
Quote:

Originally Posted by Lpjj (Post 5495201)
However, they had another working system to copy it over from, they solved it doing that copy.

I'm confused.

I just wanted to point out that 1\2 the error message was being ignored. :)

kilgoretrout 02-04-2016 06:07 PM

Quote:

I'm confused.

I just wanted to point out that 1\2 the error message was being ignored.
I understand, but if tar is not there(likely), it's not a permission problem. If it is we can check to see if tar has executable permission.

If tar is not there and won't install, the next step would be to download the tar deb package and try to force the install with dpkg like so:

Code:

$ sudo dpkg -i --force-all <tar deb package>

Habitual 02-04-2016 06:24 PM

Quote:

Originally Posted by kilgoretrout (Post 5495375)
I understand, but if tar is not there(likely), it's not a permission problem. If it is we can check to see if tar has executable permission.

If tar is not there and won't install, the next step would be to download the tar deb package and try to force the install with dpkg like so:

Code:

$ sudo dpkg -i --force-all <tar deb package>

Gonna be a tough one as dpgk is depending on it...
dpkg: warning: 'tar' not found in PATH or not executable

Download it:
Code:

sudo apt-get download tar
the force-all hopefully will work. ;)

and if it doesn't, depending on the arch, a straight copy from a similar LM system may also work.

Lpjj 02-04-2016 07:44 PM

Ter isnt there!

Lpjj 02-04-2016 08:15 PM

jack@Built-by-Jack ~ $ sudo find / -name "tar"
[sudo] password for jack:
/usr/share/bash-completion/completions/tar
jack@Built-by-Jack ~ $

Lpjj 02-04-2016 08:16 PM

above was after running



sudo apt-get download tar

kilgoretrout 02-04-2016 08:43 PM

Quote:

Ter isnt there!(sic)
OK. Next, you want to download the tar package from the repo with the command Habitual gave you above, namely:
Code:

$ sudo apt-get download tar
That should download the tar package to /var/cache/apt/archives/ and not attempt to install the package. Actually, it might already be there from your last failed install attempt. You might want to check that first. If you are running 64bit, the tar package will have a name like "tar_1.27.1-1_amd64.deb"; if 32bit, the tar package will have a name like "tar_1.27.1-1_i386.deb". The version numbers may be different but the package names will be something like that. Once you get the tar deb package successfully downloaded, run the following:
Code:

$ cd /var/cache/apt/archives/
$ sudo dpkg -i --force-all <insert name of tar deb package>

If it refuses to install, post the error output.

JJJCR 02-05-2016 01:30 AM

check out this link:
http://askubuntu.com/questions/33453...cutable/345116

From above link:
I just solved it. I don't know how sustainable my solution is.

I copied tar from another machine's /bin/tar, then i CHMOD'ed it to 755 on my destination machine's /bin/tar.

now reinstalling tar via apt-get works flawlessly:

Habitual 02-05-2016 09:23 AM

Quote:

Originally Posted by JJJCR (Post 5495507)
check out this link:
http://askubuntu.com/questions/33453...cutable/345116

From above link:
I just solved it. I don't know how sustainable my solution is.

I copied tar from another machine's /bin/tar, then i CHMOD'ed it to 755 on my destination machine's /bin/tar.

now reinstalling tar via apt-get works flawlessly:

You created a new LQ Identity for just for this subject?

Lpjj 02-05-2016 10:11 AM

jack@Built-by-Jack /usr/share/bash-completion/completions $ cd /var/cache/apt/archives/
jack@Built-by-Jack /var/cache/apt/archives $ sudo dpkg -i –force-all tar_1.27.1-1_amd64.deb
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
jack@Built-by-Jack /var/cache/apt/archives $


continuing on and looking around...
jack@Built-by-Jack /var/cache/apt/archives $ sudo dpkg -i –force-all tar_1.27.1-1_amd64.deb
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
jack@Built-by-Jack /var/cache/apt/archives $ cd /usr/share/bash-completion/completions
jack@Built-by-Jack /usr/share/bash-completion/completions $ sudo dpkg -i –force-all tar_1.27.1-1_amd64.deb
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
jack@Built-by-Jack /usr/share/bash-completion/completions $ cd
jack@Built-by-Jack ~ $ sudo dpkg -i –force-all tar_1.27.1-1_amd64.deb
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
paul@Built-by-Jack ~ $ cd /paul/local/sbin
bash: cd: /jack/local/sbin: No such file or directory
jack@Built-by-Jack ~ $ cd /jack/sbin
bash: cd: /jack/sbin: No such file or directory
jack@Built-by-Jack ~ $ cd sbin
bash: cd: sbin: No such file or directory
jack@Built-by-Jack ~ $ cd /sbin
jack@Built-by-Jack /sbin $ sudo dpkg -i –force-all tar_1.27.1-1_amd64.deb
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
jack@Built-by-Jack /sbin $


I'm really a dummy, I don't know how to find the file. Using the file viewer I find in the home directory, a hidden archive:
/home/jack/tar_1.27.1-1_amd64.deb 195.4kB Archive
Does this need to be installed? if so how to? You folks are so nice to help me out thank you!

Habitual 02-05-2016 11:32 AM

Yes, since dpkg seems to depend on tar, I am not sure how this is going to work out.
Open your terminal and issue:
Code:

sudo dpkg -i --force-all /home/jack/tar_1.27.1-1_amd64.deb
Let us know the result.

Can you also give us the output of
Code:

inxi -S
if it still doesn't work.

If you're on Linux Mint 17.1 Rebecca 64 bit
then I'll just send you the bin binary and you can manually copy it to /bin/

Lpjj 02-05-2016 12:46 PM

Still not there.

jack@Built-by-Jack ~ $ sudo dpkg -i --force-all /home/jack/tar_1.27.1-1_amd64.deb
dpkg: warning: 'tar' not found in PATH or not executable
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
dpkg-deb (subprocess): unable to execute tar (tar): No such file or directory
dpkg-deb: error: subprocess tar returned error exit status 2
dpkg: error processing archive /home/jack/tar_1.27.1-1_amd64.deb (--install):
subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
/home/jack/tar_1.27.1-1_amd64.deb
jack@Built-by-Jack ~ $ inxi -S
System: Host: Built-by-Jack Kernel: 3.13.0-24-generic x86_64 (64 bit) Desktop: Gnome Distro: Linux Mint 17 Qiana
jack@Built-by-Jack ~ $

Habitual 02-05-2016 01:32 PM

Stick a fork in me, I'm done. Sorry.

toothandnail 02-05-2016 01:40 PM

I thought that .deb packages used tar internally. In which case, there is no way to install the tar package.

My suggestion would be to use the install media you used to install Mint in the first place. Boot from it and run a live session. Once its up, mount the / partition from your installed copy, open a terminal, find tar (/bin/tar)? and use "sudo cp" to copy it to the correct place on your root partition. Coming from the same source, it should work.

Habitual 02-05-2016 01:54 PM

or Install LM 17 Qiana to Virtualbox and copy /usr/bin to your Host...?

jefro 02-05-2016 04:37 PM

Wonder if you could use apt-get clean (clean all) then apt-get remove tar and then try again.

BW-userx 02-05-2016 09:12 PM

DownLoad TAR and just install it = easy fix

ondoho 02-06-2016 04:26 PM

one could also copy the tar executable from a compatible system, but not to /usr/bin, but , say, to /usr/local/bin or some other location that can be temporarily added to the $PATH.
that way one could safely and conveniently reinstall tar, then just remove the other copy afterwards.
feels safer that way.

Lpjj 02-06-2016 11:28 PM

Hmmmmm. Thank you all for your wonderful suggestions. I'm tired of this issue, so I'm backing up all my data on thumb drives in preparation for tomorrow, when I'll upgrade from Mint 17 to 17.3. Going from 15 to 17 was easy, so I'm hoping for the same seamless transition this time. It seems this should actually be easier (for dummy me) and a better path, than just working on this one broken dependency. Despite this issue, I still love Linux. I want to try to run Oracle Virtualbox on top of this, to be able to run the two Windows programs, that I still use a windows machine. I tried WINE a couple years ago, but that was not good experiment for me. Again, thank you all for helping me, what a fantastic community this is!!! Enjoy your day! Case Closed


All times are GMT -5. The time now is 04:43 AM.