Score:1

The command could not be located because '/bin:/usr/bin' is not included in the PATH

my flag

I was trying to get the finger command to work on Ubuntu as I was learning Linux. Several hours later, Ubuntu does not start properly any more.

When I start Ubuntu, I get lines and lines of:

Command 'uname' is available in the following places
 * /bin/uname
 * /usr/bin/uname
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
uname: command not found
Command 'lesspipe' is available in the following places
 * /bin/lesspipe
 * /usr/bin/lesspipe
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
lesspipe: command not found
Command 'dircolors' is available in the following places
 * /bin/dircolors
 * /usr/bin/dircolors
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.

This goes on and on and ends with:

Command 'tr' is available in the following places
 * /bin/tr
 * /usr/bin/tr
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
tr: command not found
-bash: export: `=/home/mpl/miniconda3/bin/x86_64-conda-linux-gnu-strings': not a valid identifier
Command 'uname' is available in the following places
 * /bin/uname
 * /usr/bin/uname
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
uname: command not found

$ echo $PATH prints:

/home/mpl/bin:/home/mpl/bin:PATH

$ export PATH=$PATH:/usr/bin

$ sudo nano /etc/environment

prints:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
hr flag
It looks like there's a `$` missing in `/home/mpl/bin:/home/mpl/bin:PATH` (should be `/home/mpl/bin:/home/mpl/bin:$PATH`). Check shell startup files ~/.profile, ~/.bashrc and so on
Score:0
cu flag

This will fix your problem:

cp ~/.bashrc ~/.bashrc.bak
cp /etc/skel/.bashrc ~/
source ~/.bashrc

Note that this will overwrite your ~/.bashrc, and any customizations must be inserted from the backup file ~/.bashrc.bak.

Score:0
cn flag

You appear to have fiddled, likely with the ~/.profile file where the system path is further adjusted.

Likely following will already solve the issue: open ~/.profile in a text editor and correct

/home/mpl/bin:/home/mpl/bin:PATH

to read

/home/mpl/bin:$PATH

Note that we changed PATH to $PATH, which is required to have that string substituted by the contents of the variable PATH at that point.

Note also that we deleted the second occurrence of /home/mpl/bin:. This repeats the same path, and the only effect is that this slows your system down because the same path is searched twice for an executable.

If you badly messed up with your personal bash files, i.e. .profile and .bashrc, you can consider replacing them by default files, which can be found in /etc/skel.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.