Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dpkg: warning: 'tar' not found in PATH or not executable #4128

Closed
Dmole opened this issue Jul 31, 2019 · 6 comments
Closed

dpkg: warning: 'tar' not found in PATH or not executable #4128

Dmole opened this issue Jul 31, 2019 · 6 comments

Comments

@Dmole
Copy link
Contributor

Dmole commented Jul 31, 2019

Problem description
Steps to reproduce

pkg install busybox
Hit:1 https://termux.net stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
28 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
busybox is already the newest version (1.30.1-4).
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
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 /data/data/com.termux/files/usr/bin/dpkg returned an error code (2)

echo $PATH
/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets

Expected behavior

Additional information
I did not expect apt-get -qq upgrade to break everything

/data/data/com.termux/files/usr/bin/busybox  tar
BusyBox v1.30.1 (2019-07-28 21:51:06 UTC) multi-call b.   inary.

Usage: tar c|x|t [-ZzJjahmvokO] [-f TARFILE] [-C DIR] [-T FILE] [-X FILE] [--exclude PATTERN]... [FILE]...

Create, extract, or list files from a tar file

    c       Create
    x       Extract
    t       List
    -f FILE Name of TARFILE ('-' for stdin/out)
    -C DIR  Change to DIR before operation
    -v      Verbose
    -O      Extract to stdout
    -m      Don't restore mtime
    -o      Don't restore user:group
    -k      Don't replace existing files
    -Z      (De)compress using compress
    -z      (De)compress using gzip
    -J      (De)compress using xz
    -j      (De)compress using bzip2
    -a      (De)compress using lzma
    -h      Follow symlinks
    -T FILE File with names to include
    -X FILE File with glob patterns to exclude
    --exclude PATTERN       Glob pattern to exclude

cd /data/data/com.termux/files/usr/bin/
ln -s busybox tar

Ok that let me finish the busybox config but now

pkg install wget
Hit:1 https://termux.net stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
28 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  pcre
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  bzip2 diffutils dpkg gzip libandroid-support
  libbz2 libiconv liblzma pcre2 tar xz-utils
  zlib
The following NEW packages will be installed:
  bzip2 diffutils gzip libiconv pcre2 tar
  xz-utils zlib
The following packages will be upgraded:
  dpkg libandroid-support libbz2 liblzma wget
5 upgraded, 8 newly installed, 0 to remove and 23 not upgraded.
Need to get 0 B/2071 kB of archives.
After this operation, 4923 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
E.: This installation run will require temporarily removing the essential package libandroid-
support:aarch64 due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it,     activate the APT::Force-LoopBreak option.
E: Internal Error, Could not early remove libandroid-support:aarch64 (2)

Which I assume is the origonal issue

Another apt-get -qq upgrade fixed things though I lost a few of my package selections (grep findutils).

Bad repo? Temp bug?

@ghost
Copy link

ghost commented Jul 31, 2019

Bad repo? Temp bug?

Better to do pkg upgrade or apt full-upgrade instead of apt-get -qq upgrade.
Busybox is being deprecated and replaced by coreutils/findutils/etc... standalone packages.

@ghost ghost closed this as completed Jul 31, 2019
@Dmole
Copy link
Contributor Author

Dmole commented Jul 31, 2019

@xeffyr note that apt-get recoverd the broken state when pkg did not.

If apt-get is going to break things should it be removed?

apt has no quite option and states it is not sutable for scripting, so why would it be less likely to break stuff than apt-get?

What's the deal with libandroid-support?

Is there a list of things I should install before removing busybox (like tar, to avoid a busted package manager) ?

Was some change made or will apt-get still break things?

There still seem to be issues;

pkg install coreutils
Hit:1 https://termux.net stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
16 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  bzip2 diffutils dpkg gzip libandroid-support
  libiconv tar xz-utils zlib
The following NEW packages will be installed:
  bzip2 diffutils gzip libiconv tar xz-utils
  zlib
The following packages will be upgraded:
  coreutils dpkg libandroid-support
3 upgraded, 7 newly installed, 0 to remove and. 13 not upgraded.
Need to get 0 B/2168 kB of archives.
After this operation, 4559 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
E: This installation run will require temporarily removing the essential package libandroid-support:aarch64 due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force LoopBreak option.
E: Internal Error, Could not early remove libandroid-support:aarch64 (2)

@ghost
Copy link

ghost commented Jul 31, 2019

If apt-get is going to break things should it be removed?

It doesn't break anything if properly used. There is a big difference between upgrade and full-upgrade (it also has alias dist-upgrade).

apt has no quite option and states it is not sutable for scripting, so why would it be less likely to break stuff than apt-get?

It has, apt can do anything that apt-get does. apt is a replacement for "old" apt-get.

What's the deal with libandroid-support?

More like issue actually is #3762.

apt-get still break things

If you will do apt upgrade instead of apt full-upgrade (or as recommended pkg upgrade), things most likely will be broken.

Apt isn't well suitable for rolling-release distributions.

@Dmole
Copy link
Contributor Author

Dmole commented Jul 31, 2019

@xeffyr Is calling apt-get -qq upgrade using it improperly? because that's all that my script did for years before it suddenly broke.
If apt is not suitable and will most likely break things why is it even installed by default (let alone installable at all)?

As I mentioned apt (like pkg) has no quiet option (show errors only) and will spit out
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
on stderr which is not suitable for scripting.

@Dmole
Copy link
Contributor Author

Dmole commented Jul 31, 2019

@xeffyr I think the bottom line is that apt-get should not attempt to replace BusyBox on upgrade but instead should leave it to dist-upgrade

@ghost
Copy link

ghost commented Jul 31, 2019

apt-get should not attempt to replace BusyBox

That's not possible due to multiple reasons:

  1. Busybox has symlink $PREFIX/bin/env which conflicts with package coreutils.

  2. Busybox is getting deprecated and will no longer provide symlinks. But apt is not working without utilities provided by busybox or coreutils.

So you have no choice. If you want upgrade, a replacement should be done, otherwise package manager will be completely broken.


Yesterday there was a short time when termux.net was in broken state and updates for apt, coreutils and dpkg were not uploaded (they had dependency fixes). You perhaps did upgrade at this time and tar disappeared due to updated busybox.

@termux termux locked and limited conversation to collaborators Oct 9, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant