dpkg warning: 'tar' not found in path

Asked by Angel Zone

Synaptics shows that tar is installed, but typing command tar results command not found.
Due to this updates and any application I want to install warning comes tar not found.
I have included path in environment file using export, but still error is there.

Need help...

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu dpkg Edit question
Assignee:
No assignee Edit question
Solved by:
Angel Zone
Solved:
Last query:
Last reply:
Revision history for this message
Eliah Kagan (degeneracypressure) said :
#1

Do packages still install successfully, in spite of the warning?

Please run these commands and paste the output:

apt-cache policy tar
which -a tar
locate -b \\tar
echo $PATH

That should provide useful diagnostic information for solving your problem.

Revision history for this message
Angel Zone (taosifiq) said :
#2

I found the error. "/bin" folder was missing in /etc/environment

thanks for help.

Revision history for this message
Angel Zone (taosifiq) said :
#3

The error appeared again.

I found the Solution;

I copied

/bin/tar
/usr/sbin/rmt-tar

files from another Ubuntu system and it worked. Probably they were deleted somehow.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#4

That's very weird. Unless you can think of how /bin/tar and /usr/sbin/rmt-tar could have been accidentally deleted, you may want to scan your filesystem for errors.

In the future, if you need to replace files and don't have them backed up or on another machine (or you do, but you're not certain that they're the exact same version), then you can reinstall the package containing the files by running

sudo apt-get --reinstall install <package-name>

replacing <package-name> with the name of the packages to which the files belong.

Revision history for this message
Angel Zone (taosifiq) said :
#5

Actually I did a very stupid thing.

I INSTALLED ANTIVIRUS (NOD32)

In my case reinstalling was not the solution. I tried it, but I guess system needs tar to decompress files after download and tar was missing. And I checked the versions before copying. so now system works perfectly without any problem.