1

I have installed my programs by "synaptic" previously, but now it shows errors and doesn't install any programs, for example, I want to install xserver-xorg-dev but synaptic shows below errors:

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.
2
  • 2
    To clarify the PATH problem: type (in a command line) sudo -i then type echo $PATH and edit your question with the output, then close that session with exit. – guntbert Aug 19 '13 at 14:25
  • Have you ever checked if you have the flipping tar installed? sudo apt-get install tar. – Fran Marzoa Aug 17 '16 at 15:13
1

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:

root@devubuntu:/usr/bin# sudo chmod 755 /bin/tar
root@devubuntu:/usr/bin# sudo apt-get install --reinstall tar
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  xfonts-encodings php-console-table xfonts-utils libmcrypt4 libxfont1 xfonts-base php5-mcrypt
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 7 not upgraded.
Need to get 0 B/218 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 335218 files and directories currently installed.)
Preparing to replace tar 1.26-4ubuntu1 (using .../tar_1.26-4ubuntu1_amd64.deb) ...
Unpacking replacement tar ...
Processing triggers for man-db ...
Setting up tar (1.26-4ubuntu1) ...

when i use virtualmins "Re-Check Configuration" I now get:

All commands needed to create and restore backups are installed.

The selected package management and update systems are installed OK.

.. your system is ready for use by Virtualmin.

please notice, that

Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.

is just a general information and NOT an actual error message! when I got this message, /usr/local/sbin, /usr/sbin and /sbin were already contained in my $PATH variable. so do not let it confuse you.

1
  • This doesn't seem to make too much sense. Is there any chance that you had overwritten and/or changed /bin/tar permissions by accident before? – Fran Marzoa Aug 17 '16 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.