Konsole recognizes no commands

I have looked around here for a bit, but, so far, I have not seen anyone with the issue quite in my flavor.

In the Konsole, I can no longer get any commands to work. I think that the only command that I’ve used that I can get to currently do anything is cd. Every other command that I try, even ls, I get the same errors over and over again:

(base) Nerdberry@fedora:~$ sudo dnf install vlc
bash: sudo: command not found…
Install package ‘sudo’ to provide command ‘sudo’? [N/y] y

  • Waiting in queue…
  • Loading list of packages… Failed to install packages: sudo-1.9.17-2.p1.fc42.x86_64 is already installed

(base) Nerdberry@fedora:~$ dnf install konsole
bash: dnf: command not found…
Install package ‘dnf5’ to provide command ‘dnf’? [N/y] y

  • Waiting in queue…
  • Loading list of packages… Failed to install packages: dnf5-5.2.13.1-1.fc42.x86_64 is already installed

(base) Nerdberry@fedora:~$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
nvm install node
bash: bash: command not found…
bash: curl: command not found…
Install package ‘bash’ to provide command ‘bash’? [N/y] Install package ‘curl’ to provide command ‘curl’? [N/y] y

  • Waiting in queue… Failed to install packages: bash-5.2.37-1.fc42.x86_64 is already installed

and so on. The wheels just keep spinning. I can still install things through the Software Center, and things still seem to run stably. But currently, the Konsole seems completely useless.

Any help would be greatly appreciated.

I haven’t quite had my computer for a month yet. But installing and getting everything set up so far has been pretty smooth until now.
System Info:
Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.2
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1
Kernel Version: 6.15.5-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen AI 9 HX 370 w/ Radeon 890M
Memory: 96 GiB of RAM (93.6 GiB usable)
Graphics Processor: AMD Radeon 890M Graphics
Manufacturer: Framework
Product Name: Laptop 13 (AMD Ryzen AI 300 Series)
System Version: A9

What is the output of echo $PATH ?

1 Like

(base) Nerdberry@fedora:~$ echo $PATH
“$(bash --norc -ec ‘IFS=:; paths=($PATH); for i in ${!paths[@]}; do if [[ ${paths[i]} == "’‘/home/Nerd
berry/.pyenv/shims’'” ]]; then unset ‘'‘paths[i]’'’; fi; done; echo “${paths[*]}”')" export PATH=“/h
ome/Nerdberry/.pyenv/shims:${PATH}” command pyenv rehash 2>/dev/null

We think you have a problem with your .bashrc or .bash_profile, have you edited them?
You may have changed PATH to a value that does not work.

If you run this does it work?

/usr/bin/sudo /usr/bin/dnf

I am fairly certain that I did not change them. I put off updates from the “Discover” center for a week. Then, after performing an update, that’s when my issue started.

(base) Nerdberry@fedora:~$ /usr/bin/sudo
usage: sudo -h | -K | -k | -V
usage: sudo -v [-ABkNnS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-ABkNnS] [-g group] [-h host] [-p prompt] [-U user]
[-u user] [command [arg …]]
usage: sudo [-ABbEHkNnPS] [-r role] [-t type] [-C num] [-D directory]
[-g group] [-h host] [-p prompt] [-R directory] [-T timeout]
[-u user] [VAR=value] [-i | -s] [command [arg …]]
usage: sudo -e [-ABkNnS] [-r role] [-t type] [-C num] [-D directory]
[-g group] [-h host] [-p prompt] [-R directory] [-T timeout]
[-u user] file …
(base) Nerdberry@fedora:~$ /usr/bin/dnf
Missing command. Add “–help” for more information about the arguments.

From the (base) in your prompt, and the contents of your $PATH, I’m wondering if this is some conda install script gone wrong.

Do you have conda or a similar Python env management package installed?

1 Like

Yes, I did install conda and venv

That is not a valid PATH value. Find the file you put that in are replace it with

export PATH=/usr/bin

FYI PATH should only be changed in your ~/.bash_profile, not in your ~/.bashrc.

Could be that a package has added a script to /etc/profile.d that is doing this.

For example I use micromamba (kind of a minimalised variant of conda), and it creates /etc/profile.d/micromamba.sh to modify the PATH appropriately.

So I wonder if OP has a dodgy /etc/profile.d/conda.sh or something like that.

Could be…

Is it this gem that is giving me troubles then from /etc/profile.d/conda.sh?

Ah, that actually doesn’t look like the culprit - it seems pretty benign doesn’t really explain the contents you showed in your $PATH.

It looks like a script somewhere is trying to modify $PATH, but somehow is inserting the script itself into PATH.

  1. Is there anything in ~/.bashrc that resembles the contents of your $PATH?

  2. Is there anything elsewhere in /etc/profile.d that could explain it? For example, do you get any output from grep "pyenv" /etc/profile.d ?

So, searching all over in several of the directories for all kinds of configs or profiles, I have found something that has almost exactly what is currently stuck in the $PATH above.
In ~/.pyenv/libexec/ there is a file pyenv-init that contains the following text, which is almost, but not exactly what is in the current $PATH.
Thoughts?
Sorry, I keep forgetting that just copying from KWrite really doesn’t look good here…


Same picture below, but highlighting the code.

Put a triple backtick ``` on a line before your pasted text, and the same on a line after it. That way the text is both sensibly formatted, and (unlike screenshots) copy-pasteable.

OK, so it looks like that file is implicated somehow.

Did you use these steps when installing pyenv? Have they resulted in weird content in your ~/.bashrc or ~/.profile or ~/.bash_profile ?

It seems that there were a couple of issues here, but I finally have this running.|
I had a ~/.bash_profile but no ~/.profile I don’t know if this was the actual source of the issue, but I looked up a basic .profile and created that.
But the real issue for me was in ~/.bashrc
After installing Conda, the last line of the file was export PATH="$HOME/.pyenv/bin:$PATH" echo eval "$(pyenv init --path)" written all as a single line.
All I had to do was to separate the lines to

export PATH="$HOME/.pyenv/bin:$PATH" echo eval "$(pyenv init --path)"

and perform

source ~/.bashrc

and now,

echo $PATH
which sudo

both return proper values. I also just used dnf to install a program to test.

Thanks guys! I appreciate all of your help!

1 Like

Cool. (Generally you shouldn’t need a ~/.profile though, unless you’re very sure you have a specific use case for it.)

Got it. Thanks