Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Software] nano gives command not found, but sudo nano works

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
MCaspers
Posts: 4
Joined: 2023-02-01 13:21

[Software] nano gives command not found, but sudo nano works

#1 Post by MCaspers »

Hi,

Does someone know how to troubleshoot this issue further?

Since today i'm having a problem with a Debian (10) installation.

When in the terminal i type nano to start the text editor it won't start, and it reports something about micro, command not found.

However if i type sudo nano it just works.

If i do which nano it gives me /usr/bin/nano
sudo which nano gives me the same folder.

If i do echo $PATH i see that /usr/bin is in there.
If i do sudo echo $PATH i get a path that's slightly smaller, but it still includes /usr/bin.

If i do an ls on /usr/bin i see nano there.
The owner of the file is root:root (checked with ls -la), but that's true for everything in /usr/bin, i don't know if that's normal, but it seems to work just fine for everything else.

If do cd /usr/bin and type ./nano it works too, so it doesn't seem a rights problem.

I don't know how to go further from there.
How do you troubleshoot further if the file is there, the path seems to point to the correct folders, the command does work if typed in directly in the same folder using ./, but otherwise only accessible from anywhere else with sudo?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: [Software] nano gives command not found, but sudo nano works

#2 Post by p.H »

MCaspers wrote: 2023-02-01 13:56 i type nano to start the text editor it won't start, and it reports something about micro, command not found.
Please post the complete and exact message.
Any shell alias ?

Code: Select all

type nano
What happens if you type

Code: Select all

/usr/bin/nano

MCaspers
Posts: 4
Joined: 2023-02-01 13:21

Re: [Software] nano gives command not found, but sudo nano works

#3 Post by MCaspers »

Thanks for your quick reply!

Your questions put me on the path to the solution.

Just for reference, the exact error message:

bash: micro: command not found

/usr/bin/nano just works fine.

type nano gives:
nano is aliased to 'micro'.

This alias for micro is not in my .bashrc and it's also not in .bash_aliases (that file doesn't exist).
I didn't set it.

I don't know why it didn't "click" for me earlier that it couldn't be anything else but an alias given the error message.

Finally I did find that the alias was set inside /etc/bash.bashrc
Removing the alias fixed the issue.

Thanks again for your help.

Post Reply