[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash: which: command not found? + (E: Unable to locate package which? ...)



On Fri, 2022-07-08 at 05:02 -0500, Albretch Mueller wrote:
>  Actually, I just noticed I couldn't run "cat" as regular user but I
> could as root how could that form a "multiversing" be -technically-
> happening (other than having forces actively messing with your work)?
> 
> export _GRAALVM_HOME=.../graalvm-ce-java17-22.1.0

There's one too many '.' characters there, but that shouldn't be the
cause of your issue.

> export PATH=${PATH}:${_GRAALVM_HOME}/bin
> which javac
> which java
> $
> 
> bash: which: command not found

So, did you check what $PATH contains? (e.g. echo $PATH) It seems
likely it's corrupted or missing the right directory (/usr/bin see
below).

> 
> # apt-get install which
> Reading package lists... Done
> Building dependency tree... Done
> Reading state information... Done
> E: Unable to locate package which

Because there's no package called 'which', the which command is
provided by debianutils. Which you could have found by Googling for the
ways to find out the package. For me, the first search result was...
https://superuser.com/questions/10997/find-what-package-a-file-belongs-to-in-ubuntu-debian

[...]


# which bash
/usr/bin/bash

So, $PATH in your root environment is OK. So you could have run

#which which
/usr/bin/which

So it's in /usr/bin and you could have found the package it belongs with using:

#dpkg -S /usr/bin/which
debianutils: /usr/bin/which

-- 
Tixy


Reply to: