Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

0 votes
2 answers
2982 views
Login loop on Debian 12
I have a login loop error on Debian 12. The final edit on the system that I made was: ```bash su root nano /etc/sudoers ``` Added in `/etc/sudoers`: ``` user_name ALL=(ALL) ALL ``` Since I can't use `sudo` command I did so according to the instructions on the internet, after I shutdown and reopened...
I have a login loop error on Debian 12. The final edit on the system that I made was:
su root
nano /etc/sudoers
Added in /etc/sudoers:
user_name ALL=(ALL)  ALL
Since I can't use sudo command I did so according to the instructions on the internet, after I shutdown and reopened I couldn't login. I've seen a few solutions online, but none of them work. I used Ctrl+Alt+F2, but can't use any command there except cd.
Ls command not found  
Nano command not found  
Sudo command not found  
Apt command not found
Anyone know about this incident? My ssd drive is more than 100Gb free and hdd drive is 1Tb free.
Kaovodich (1 rep)
Jun 26, 2023, 12:25 AM • Last activity: Jul 21, 2025, 04:06 AM
30 votes
5 answers
46413 views
What is the proper way to manage multiple python versions?
I have a machine with Python 2.6 installed as the default Python. Then, I installed Python 2.7, and manually created /usr/bin/python as a symlink to the new installation. Then, I was [running into problems with command-not-found][1]. I'm trying to reinstall it: sudo apt-get remove command-not-found...
I have a machine with Python 2.6 installed as the default Python. Then, I installed Python 2.7, and manually created /usr/bin/python as a symlink to the new installation. Then, I was running into problems with command-not-found . I'm trying to reinstall it: sudo apt-get remove command-not-found and I get this error: /usr/bin/python does not match the python default version. It must be reset to point to python2.6 But I really want Python 2.7 to be the default. How do I fix this mess?
ripper234 (32413 rep)
Mar 20, 2011, 08:02 AM • Last activity: Feb 18, 2025, 03:32 PM
1 votes
2 answers
1093 views
Busybox locale not found
I install a Dockerfile from busybox but when I input "locale" or "locale -a", the command line return "sh: locale: not found". How can I fix this?
I install a Dockerfile from busybox but when I input "locale" or "locale -a", the command line return "sh: locale: not found". How can I fix this?
Leeafay (11 rep)
Jul 20, 2019, 05:03 AM • Last activity: Oct 28, 2024, 10:57 AM
2 votes
1 answers
174 views
Flatpak-installed Calibre: cannot find ebook-convert command
On my Linux Mint 22 Cinnamon (Wilma) based on Ubuntu 24.04 LTS (Noble). I ended up installing Calibre in spite my initial dislike, via Flatpak: ```none $ flatpak install flathub com.calibre_ebook.calibre ``` The installation was successful, **but the the shell can't find the `ebook-convert` command*...
On my Linux Mint 22 Cinnamon (Wilma) based on Ubuntu 24.04 LTS (Noble). I ended up installing Calibre in spite my initial dislike, via Flatpak:
$ flatpak install flathub com.calibre_ebook.calibre
The installation was successful, **but the the shell can't find the ebook-convert command** (official manual page link ). *** Reasoning about choosing Flatpak version: At this point of time, reading upon the changelog here: https://calibre-ebook.com/whats-new It is obvious the developer(s) are very active. The packaged version is Release: 7.6 [01 Mar, 2024], whereas the Flatpak version is the latest available (Release: 7.20 [18 Oct, 2024]). In spite, I originally have thought I would only use the ebook conversion command, this software might *surprise me*,..
Vlastimil Burián (30505 rep)
Oct 21, 2024, 08:06 PM • Last activity: Oct 22, 2024, 06:52 AM
-1 votes
1 answers
824 views
command not found, while it exist in appropriate place
i had fresh installed debian 12 and almost all commands are not found. ``` root@debian:/# dpkg-reconfigure keyboard-configuration bash: dpkg-reconfigure: command not found ``` i find it here ``` root@debian:/home/lm# find /usr -type f -name debconf /usr/bin/debconf /usr/lib/tasksel/tests/debconf /us...
i had fresh installed debian 12 and almost all commands are not found.
root@debian:/# dpkg-reconfigure keyboard-configuration
bash: dpkg-reconfigure: command not found
i find it here
root@debian:/home/lm# find /usr -type f -name debconf
/usr/bin/debconf
/usr/lib/tasksel/tests/debconf
/usr/share/bash-completion/completions/debconf
/usr/share/lintian/overrides/debconf
as it still not found i even reinstall it
root@debian:/home/lm# apt-get install dpkg
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
dpkg is already the newest version (1.21.22
but it still not found
root@debian:/home/lm# dpkg-reconfigure keyboard-configuration
bash: dpkg-reconfigure: command not found
root@debian:/home/lm# apt-get install debconf
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
debconf is already the newest version (1.5.82).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
even after this it still not found, and PATH is looks like this
if [ "$(id -u)" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
so, i don't know, how to reconfigure my keyboard now?
Linux debian 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-2 (2023-07-27) x86_64 GNU/Linux
ant (27 rep)
Jul 30, 2023, 06:36 PM • Last activity: Aug 3, 2024, 09:17 PM
-1 votes
1 answers
2872 views
Command not found despite having just installed it?
As you can see in the screenshot below, I install a command (it's a wrapper for a program called qsiprep), and then try running it, but it says it's not installed...any ideas as to what is happening? I believe it may have something to do with my Python bin not being on the path. That's all I could f...
As you can see in the screenshot below, I install a command (it's a wrapper for a program called qsiprep), and then try running it, but it says it's not installed...any ideas as to what is happening? I believe it may have something to do with my Python bin not being on the path. That's all I could find on the net for searching this problem up. But I'm not exactly sure what it means...I can run python just fine, is the python bin separate from python? Edit: the output from `find / -name 'qsiprep-container' is find: ‘/lost+found’: Permission denied find: ‘/usr/src/evdi-5.2.14’: Permission denied find: ‘/snap/core18/1705/etc/ssl/private’: Permission denied find: ‘/snap/core18/1705/root’: Permission denied find: ‘/snap/core18/1705/var/cache/ldconfig’: Permission denied and many similar messages, all ending in "Permission denied." What should I be looking for here? If I instead append the command with sudo, only one line is output: find: ‘/run/user/1000/gvfs’: Permission denied Image
James Ronald (153 rep)
Jun 29, 2020, 12:45 AM • Last activity: Jul 1, 2024, 09:05 AM
7 votes
1 answers
1916 views
How do I make a custom "command not found" prompt for the terminal?
I want to make a custom "command not found" prompt for the terminal, like [this one][1].  I have the template set up: ``` ___________________________________________ / I see you're trying to use the terminal … \ | Command not found: | | | | xxx | | | \______ __________________________...
I want to make a custom "command not found" prompt for the terminal, like this one.  I have the template set up:
___________________________________________
 / I see you're trying to use the terminal … \
 | Command not found: 			             |
 |					                         |
 |  xxx   				                     |
 |					                         |
 \______ ____________________________________/
   	    v
       ╭─╮
       ⌾ ⌾
       │▕│
       ╰─╯
I want the "xxx" to be replaced by the incorrect command.  How could I achieve this?
Cameron R. (71 rep)
Jun 9, 2015, 12:03 AM • Last activity: May 10, 2024, 07:34 PM
0 votes
1 answers
119 views
How to ask to install package with command-not-found instead of suggesting to install it
`command-not-found` asks a question like this when the command is not found in Kali Linux: ``` Command 'co' not found, but can be installed with: sudo apt install rcs Do you want to install it? (N/y) ``` In Debian, however, it only suggests to install the package with ``` Command 'co' not found, but...
command-not-found asks a question like this when the command is not found in Kali Linux:
Command 'co' not found, but can be installed with:
sudo apt install rcs
Do you want to install it? (N/y)
In Debian, however, it only suggests to install the package with
Command 'co' not found, but can be installed with:
sudo apt install rcs
How do I make Debian ask to install the package with command-not-found?
horsey_guy (421 rep)
Apr 6, 2024, 05:04 AM
13 votes
2 answers
8322 views
update-command-not-found Not Working
So I am running Debian Testing, and I installed the `command-not-found` package, because I just love that functionality in Ubuntu. So I installed it, and when I restarted my terminal, it said I needed to update the cache for the available packages. So I did. I tried the following commands: sudo upda...
So I am running Debian Testing, and I installed the command-not-found package, because I just love that functionality in Ubuntu. So I installed it, and when I restarted my terminal, it said I needed to update the cache for the available packages. So I did. I tried the following commands: sudo update-command-not-found sudo /usr/sbin/command-not-found su and update-command-not-found su and /usr/sbin/update-command-not-found But it just exits and does nothing. No output. Just nothing. I try it and it says I need to update the cache again.
jadenPete (357 rep)
Sep 2, 2016, 01:43 AM • Last activity: Mar 25, 2024, 02:04 AM
1 votes
1 answers
352 views
command not found although it has been installed
I have installed the command" txpp.py" to run a particle-in-cell simulation. Although it works with my account, when I change to another account, it says "command not found". I hope to receive suggestions and recommendations for fixing this problem. Thank you very much
I have installed the command" txpp.py" to run a particle-in-cell simulation. Although it works with my account, when I change to another account, it says "command not found". I hope to receive suggestions and recommendations for fixing this problem. Thank you very much
khoa Sadsad (13 rep)
Jul 31, 2023, 12:13 AM • Last activity: Jul 31, 2023, 12:28 AM
1 votes
1 answers
1867 views
Depmod command not found but kmod is already installed
When I use depmod in the terminal, I got the message "depmod command not found". But kmod is already installed. And I can find a link to something called depmod in sbin. Do you know how to solve this? I use Debian 11 GNOME.
When I use depmod in the terminal, I got the message "depmod command not found". But kmod is already installed. And I can find a link to something called depmod in sbin. Do you know how to solve this? I use Debian 11 GNOME.
Chènevis (111 rep)
Jul 16, 2023, 01:25 PM • Last activity: Jul 16, 2023, 01:42 PM
0 votes
2 answers
349 views
Commands cannot be located after sourcing a bash script
I have a short bash script `cdline` that takes two arguments `PATHS` and `LINE` and changes directory to the respective `LINE` in `PATHS`: ``` #!/bin/bash #command for changing directory to that in the given line... #or that of the file in the given line PATHS=$1 LINE=$2 PATH="$(echo "${PATHS}" | se...
I have a short bash script cdline that takes two arguments PATHS and LINE and changes directory to the respective LINE in PATHS:
#!/bin/bash
#command for changing directory to that in the given line...
#or that of the file in the given line

PATHS=$1
LINE=$2
PATH="$(echo "${PATHS}" | sed -n ${LINE}p)"
PATH="$(/home/gohomology/Scripts/pc_macros/file_system/getdir "${PATH}")"
cd ${PATH}

return 1
This calls getdir which echoes the given path if its a directory, or the directory that includes the file otherwise. I know that when calling a bash script normally it creates a subshell, so trying to call the script normally wouldn't do anything. As far as I understand, the solution for this should be sourcing the script, which one can do adding . or source before calling the script. This indeed works for changing the directory, however, after doing so my terminal cannot find various commands such as ls or find, as demonstrated by the following result from my terminal emulator.
gohomology@gohomology:~/Desktop$ find . -name "example_file"
./example_dir/example_file

gohomology@gohomology:~/Desktop$ . cdline "$(!!)" 1
. cdline "$(find . -name "example_file")" 1

gohomology@gohomology:~/Desktop/example_dir$ ls
Command 'ls' is available in the following places
 * /bin/ls
 * /usr/bin/ls
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
ls: command not found

gohomology@gohomology:~/Desktop/example_dir$ find . -name "example_file"
Command 'find' is available in the following places
 * /bin/find
 * /usr/bin/find
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
find: command not found
The command cd still works after using cdline. I thought that the problem is that I'm stuck within a bash shell, which is why there's return 1 at the end of cdline, but the problem is still existent. I run bash 5.1.16 and gnome-terminal on Ubuntu 22.04.2.
gohomology (3 rep)
Jul 2, 2023, 12:16 PM • Last activity: Jul 2, 2023, 04:10 PM
0 votes
0 answers
30 views
'-bash: line 1: rescanscsi: command not found' error even though script location is in PATH and other script runs fine from same folder
I'm new to linux, trying to switch over from Windows, and I could really use some help. This is actually my first time using a forum such as this so please forgive any errors I make. I'm using Linux Mint XFCE 64-bit and I have two scripts located in /usr/local/bin/custom, as can be seen as follows:...
I'm new to linux, trying to switch over from Windows, and I could really use some help. This is actually my first time using a forum such as this so please forgive any errors I make. I'm using Linux Mint XFCE 64-bit and I have two scripts located in /usr/local/bin/custom, as can be seen as follows:
-shellsession
dasaint@X1:~$ which load-ssh-keys
/usr/local/bin/custom/load-ssh-keys

dasaint@X1:~$ which rescanscsi
/usr/local/bin/custom/rescanscsi

dasaint@X1:~$ whereis rescanscsi
rescanscsi: /usr/local/bin/custom/rescanscsi

dasaint@X1:~$ whereis load-ssh-keys
load-ssh-keys: /usr/local/bin/custom/load-ssh-keys
/usr/local/bin/custom is in my global path, as has been set in /etc/environment
-shellsession
dasaint@X1:~$ echo $PATH
/home/dasaint/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin/custom:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
Yet when I run rescanscsi, I get the following error:
-shellsession
dasaint@X1:~$ sudo rescanscsi
sudo: rescanscsi: command not found
The strange thing is, if I run sudo /usr/local/bin/custom/rescanscsi it works just fine. And if I run the other script, load-ssh-keys, without specifying the absolute path, it also works just fine. The contents of the scripts are:
-bash
#! /usr/bin/bash
#
# /usr/local/bin/custom/rescanscsi
#
# ReScan all SCSI/SATA Hosts
#
for SHOST in /sys/class/scsi_host/host*; do
    echo -n "Scanning ${SHOST##*/}..."
    echo "- - -" > ${SHOST}/scan
    echo Done
done
and
-bash
#! /usr/bin/bash
#
# Script:		load-ssh-keys.sh
# path:			/usr/local/bin/scripts
# Purpose:		add SSH private keys into ssh-agent
# Dependencies:	'/usr/bin/expect'
#				'/usr/bin/ssh-add'
# 
# '/usr/bin' must be included in the system path
#
# SYNOPSIS
# --------
# Reads the passphrase from '~/keypsph' and stores it in the variable, 'PSPH', then
# calls '/usr/bin/expect' to spawn ssh-add to add the SSH private keys into 
# ssh-agent and provide (send) the passphrase for the keys, followed by a .
#
# '/usr/bin/expect'  can be installed with:
#	sudo apt install expect
#
# Guide:	https://stackoverflow.com/questions/13033799/how-to-make-ssh-add-read-passphrase-from-a-file 
#
# Initialize a variable to store an exit code of '0'
EXITCODE=0
#
# Check whether the passphrase file, 'keypsph' exists in the user's home directory. 
# If not terminate the script with an appropriate message and error code.
if [ ! -f ~/.ssh/keypsph ]; then
    echo -e "ERROR: Passphrase file not found in $HOME/.ssh\nExiting..."
    exit 1
fi
# Read the passphrase from file, 'keypsph'
PSPH=$(cat ~/.ssh/keypsph)
#
# Call '/usr/bin/expect' to spawn ssh-add to add the SSH private keys to X2 into 
# ssh-agent and provide (send) the passphrase for the keys, followed by a .
expect .
expect .
expect .
expect << EOF
spawn ssh-add "$HOME/.ssh/x1-x8_key"
expect "Enter passphrase for /home/dasaint/.ssh/x1-x8_key:"
send "$PSPH\r"
expect eof
EOF
# Error Handling...
if [[ $EXITCODE != 0 ]]; then
  echo -e "Error adding x1-x2_key to SSH Agent\nExiting..."
  EXITCODE=$?
  exit $EXIITCODE
fi
#
# Exit the script with the appropriate exit code
exit $EXITCODE
I have searched the internet for answers but no one seems to have a comparable issue. I am at my wits end and I could really use some advice. **PS:** If I log in as root using su - and run rescanscsi without the absolute path, it also runs just fine.
TT Radykal (1 rep)
Apr 16, 2023, 10:31 PM • Last activity: Apr 17, 2023, 03:23 PM
1 votes
1 answers
2114 views
Command not found message
When running invalid commands without any parameters or options, in my experience we get only two kinds of messages which are exemplified below: ~$ Date No command 'Date' found, did you mean: Command 'yate' from package 'yate' (universe) Command 'date' from package 'coreutils' (main) Command 'late'...
When running invalid commands without any parameters or options, in my experience we get only two kinds of messages which are exemplified below: ~$ Date No command 'Date' found, did you mean: Command 'yate' from package 'yate' (universe) Command 'date' from package 'coreutils' (main) Command 'late' from package 'late' (universe) Command 'kate' from package 'kate' (universe) Date: command not found ~$ fjldjflsk fjldjflsk: command not found ~$ I'm interested in knowing more about how this works. Specifically, when can I know which of these two kinds of messages I'm going to get prior to running the command? Is there some kind of environment variable or any other device that would allow me to alter this behavior easily? I'd like to get only the second kind of message.
command_not_found (13 rep)
Feb 17, 2019, 09:53 PM • Last activity: Mar 14, 2023, 08:58 AM
0 votes
0 answers
578 views
Help with zsh: command not found
Attempting to [follow these instructions][1] and I'm receiving error `zsh: command not found: ord` when attempting to do anything in `ord`, including `ord wallet create`. Currently running ohmyzsh and have not altered the .zshrc file. When I use echo $PATH, I receive `/Library/Frameworks/Python.fram...
Attempting to follow these instructions and I'm receiving error zsh: command not found: ord when attempting to do anything in ord, including ord wallet create. Currently running ohmyzsh and have not altered the .zshrc file. When I use echo $PATH, I receive /Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin I'm new to this, so my apologies if the answer is obvious. Any help would be greatly appreciated. terminal window top of .zshrc file
MrP (1 rep)
Feb 9, 2023, 03:51 PM • Last activity: Feb 19, 2023, 12:46 PM
1 votes
1 answers
1519 views
shell saying "not found" for a command within a makefile
When defining a **command** as a constant **within a Makefile**: MY_COMMANDLINE="prog arg1 arg2" and using this constant later to get the command invoked, you could get: /bin/sh: prog arg1 arg2: not found although prog definitely exists. Explicitly giving the whole path of `prog` does not help. ----...
When defining a **command** as a constant **within a Makefile**: MY_COMMANDLINE="prog arg1 arg2" and using this constant later to get the command invoked, you could get: /bin/sh: prog arg1 arg2: not found although prog definitely exists.
Explicitly giving the whole path of prog does not help. ---- There are other questions regarding shell saying "**not found**" (e.g. [this](https://unix.stackexchange.com/questions/18061/why-does-sh-say-not-found-when-its-definitely-there?newreg=efc98d3e21f54520baa1f9f6d158cf45) or [that](https://unix.stackexchange.com/questions/43481/file-not-found-for-file-which-is-there?noredirect=1&lq=1)) . By linking this question others may find this possible cause easier.
MattTT (121 rep)
Nov 29, 2022, 07:00 AM • Last activity: Nov 29, 2022, 07:06 AM
4 votes
1 answers
257 views
Cannot modify bash history inside command_not_found_handle function
I'm trying to make my own `command_not_found_handle` function, which on given a wrong command, asks the user with the most identical command if that was what he meant. If the user accepts that suggestion then it should delete the last command (the wrong command) from the history and add the selected...
I'm trying to make my own command_not_found_handle function, which on given a wrong command, asks the user with the most identical command if that was what he meant. If the user accepts that suggestion then it should delete the last command (the wrong command) from the history and add the selected one. But it isn't working. This is my code
command_not_found_handle(){
  ....

  # replace the previous wrong command with the correct one in bash history
  history -d -1
  history -s "$command $@"
}
When I enter a wrong command and select one from the suggestion, it doesn't modify the history. But if I call the function myself e.g.
command_not_found_handle wrong_command
It updates the history, removing the wrong_command and appending the new one. I verified that the function has read access to the history in both cases by calling the history command inside the function, which returns the history list. But in the first case it cannot write to the history.
Sunlight (43 rep)
Oct 19, 2022, 03:00 AM • Last activity: Nov 28, 2022, 10:13 PM
2 votes
0 answers
90 views
"Could not find foo in PATH" - but it's right there
I see the following behavior: ``` $ foo Could not find foo in PATH $ which foo /usr/local/corp/bin/foo $ readlink -f `which foo` /path/to/opt/foo/foo $ /usr/local/corp/bin/foo starting foo, output for foo, blah blah blah ``` this is a Centos 7 machine with Linux kernel 3.10.0-1160.53.1.el7.x86_64 ....
I see the following behavior:
$ foo
Could not find foo in PATH
$ which foo
/usr/local/corp/bin/foo
$ readlink -f which foo
/path/to/opt/foo/foo
$ /usr/local/corp/bin/foo
starting foo, output for foo, blah blah blah
this is a Centos 7 machine with Linux kernel 3.10.0-1160.53.1.el7.x86_64 . The shell is bash. Notes: * Yes, /usr/local/corp/bin is in my $PATH. * /usr/local/corp/bin/foo is a symlink to /path/to/actual/binary/foo. * hash -r doesn't help.
einpoklum (10753 rep)
Jul 13, 2022, 10:48 AM • Last activity: Jul 13, 2022, 04:16 PM
0 votes
3 answers
5858 views
theharvester not found in Kali Linux
I am running latest 64 bit kali linux in VirtualBox and I am not able to find the theharvester.py anywhere even using locate i cannot find it and it is installed as when i run the install command i get the following output ``` root@kali:~# apt-get install theharvester Reading package lists... Done B...
I am running latest 64 bit kali linux in VirtualBox and I am not able to find the theharvester.py anywhere even using locate i cannot find it and it is installed as when i run the install command i get the following output
root@kali:~# apt-get install theharvester
Reading package lists... Done
Building dependency tree       
Reading state information... Done
theharvester is already the newest version (3.1-0kali2).
theharvester set to manually installed.
The following packages were automatically installed and are no longer required:
  libayatana-ido3-0.4-0 libbfio1
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 44 not upgraded.
and when i run theharvester command in terminal i get
root@kali:/usr/share# theharvester
bash: theharvester: command not found
sachuverma (113 rep)
Dec 17, 2019, 11:36 AM • Last activity: Jul 4, 2022, 08:04 AM
3 votes
1 answers
525 views
How to alias a function and call from function with original name
This is more of an academic exercise but curious of the answer. Here is the current code in question: export original_command_not_found_handler="$(type -f command_not_found_handler)" # original func as string function command_not_found_handler(){ # my custom override echo "my custom handler: $@" ech...
This is more of an academic exercise but curious of the answer. Here is the current code in question: export original_command_not_found_handler="$(type -f command_not_found_handler)" # original func as string function command_not_found_handler(){ # my custom override echo "my custom handler: $@" echo " ${original_command_not_found_handler} command_not_found_handler "$@" " | bash } what I am trying to do is override the original zsh function with my custom function and then call the original function from the override. There are two problems with this code: 1. I am trying to call the original function from a subshell (piping to bash), but it would be best to call from the current shell not subshell. 2. it doesn't work since the original function is not being interpreted as desired in the string.
Alexander Mills (10734 rep)
Feb 20, 2022, 11:53 PM • Last activity: Feb 21, 2022, 06:53 AM
Showing page 1 of 20 total questions