disappearing sudo

If none of the more specific forums is the right place to ask
Post Reply
Message
Author
seog
Posts: 5
Joined: 2022-08-05 17:48

disappearing sudo

#1 Post by seog »

hi there
could you help me crack the meaning of what my terminal says, please?

Code: Select all

sehrguey@debian:~$ sudo apt install sudo
[sudo] password for sehrguey: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
sudo is already the newest version (1.9.5p2-3).
0 upgraded, 0 newly installed, 0 to remove and 50 not upgraded.
sehrguey@debian:~$ sudo mount  /dev/sda1 teradisk
bash: sudo: command not found
I am on Xfce (whatever it means) in the Bull-Eye

yours`
sehrguey

lindi
Posts: 25
Joined: 2022-07-12 14:10
Been thanked: 1 time

Re: disappearing sudo

#2 Post by lindi »

First guess is that you have some non-printable special characters. You should see them with:

Code: Select all

history | tail -n 2 | cat -A

arochester
Global Moderator
Global Moderator
Posts: 2233
Joined: 2010-12-07 19:55
Has thanked: 7 times
Been thanked: 21 times

Re: disappearing sudo

#3 Post by arochester »

1) Did you reboot after sudo was initially installed?

2)
and 50 not upgraded.

Code: Select all

sudo apt update

Code: Select all

sudo apt full-upgrade
Then what happens? What does it say?

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 4545
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 39 times
Been thanked: 114 times

Re: disappearing sudo

#4 Post by sunrat »

seog wrote: 2022-08-05 18:04

Code: Select all

sehrguey@debian:~$ sudo mount  /dev/sda1 teradisk
bash: sudo: command not found
There are 2 spaces after "mount", should only be one.
Command won't work unless you are in the directory containing "teradisk" directory; otherwise specify full path to it.
Maybe filesystem needs to be specified if not defined in fstab (not sure about this one).

Or possibly something else.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

kskruser
Posts: 8
Joined: 2020-12-31 22:02

Re: disappearing sudo

#5 Post by kskruser »

seog:
sunrat is exactly right. It's not sudo itself that bash is complaining about; rather it's the malformed mount command. I can re-create the behavior on my system by mis-spelling mount.

lindi
Posts: 25
Joined: 2022-07-12 14:10
Been thanked: 1 time

Re: disappearing sudo

#6 Post by lindi »

sunrat wrote: 2022-08-05 22:53 There are 2 spaces after "mount", should only be one.
You can use multiple whitespace characters if you like. See "man bash", section on "Word splitting":

Code: Select all

 A sequence of IFS whitespace characters is also treated as a delimiter.
sunrat wrote: 2022-08-05 22:53 Command won't work unless you are in the directory containing "teradisk" directory; otherwise specify full path to it.
Maybe filesystem needs to be specified if not defined in fstab (not sure about this one).
Good point but the error would be different in that case:

Code: Select all

mount: teradisk: mount point does not exist.

seog
Posts: 5
Joined: 2022-08-05 17:48

Re: disappearing sudo

#7 Post by seog »

thank you all, gentlemen
here is a scrap from another talk with terminal:

Code: Select all

sehrguey@debian:~$ sudo mkdir 1
sehrguey@debian:~$ 
sehrguey@debian:~$ sudo mount /dev/sda1 teradisk
bash: sudo: command not found
sehrguey@debian:~$ sudo rm -r 1
sehrguey@debian:~$ 
which clears apt of all suspicions and this time the odd space was eliminated from 'sudo mount' and I be f***ed if I can see any rexp or misspelling in the command.
Now, to make a short story long (not my fault you asked for it) I am lazy and so as not to type 'sudo mount...' I kept it in a Text Editor file and used to use when needed. It worked OK. Then gnome slowed down immodestly prompting to switch over to Xfce. Now everything is nice except for mounting the usual way.
Noteworthy: when I type the command manually bash is happy and keeps quiet just doing its job. But I am still lazy.
Any idea or suggestion would be dearly appreciated.

yours`
sehrguey

User avatar
dilberts_left_nut
Global Moderator
Global Moderator
Posts: 5267
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 2 times
Been thanked: 28 times

Re: disappearing sudo

#8 Post by dilberts_left_nut »

AdrianTM wrote:There's no hacker in my grandma...

seog
Posts: 5
Joined: 2022-08-05 17:48

Re: disappearing sudo

#9 Post by seog »

dear dilberts_left_nut,

before switching to Xfcee (while at gnome) I used the same copy-past technique from that very Text Editor for months. And yes, I tried the remedy suggested in viewtopic.php?p=757228#p757228 with the result presented in my second message.
OK, it's not really a situation, I can type yet, however just from pure curiosity - what the heck?

yours`
sehrguey

User avatar
dilberts_left_nut
Global Moderator
Global Moderator
Posts: 5267
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 2 times
Been thanked: 28 times

Re: disappearing sudo

#10 Post by dilberts_left_nut »

That post is not a 'remedy' but a method to get more information about the issue - and no, you didn't.
AdrianTM wrote:There's no hacker in my grandma...

seog
Posts: 5
Joined: 2022-08-05 17:48

Re: disappearing sudo

#11 Post by seog »

Dear dilberts_left_nut

You can't believe to something you choose not to believe to. I believe there was the yes with conscientiously reproducing each of steps You suggested (whew! 498 MB downloaded at 'apt full-upgrade'!)
Anyway I feel this conversation deviates from the issue at hand and slides into piquing of super geeks personalities. No thank you! Let's forget this little quirk and enjoy life instead.
Please mark the thread as solved. (I don't know how to do it).

Yours`
sehrguey

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 4545
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 39 times
Been thanked: 114 times

Re: disappearing sudo

#12 Post by sunrat »

seog wrote: 2022-08-08 04:39Please mark the thread as solved. (I don't know how to do it).
Edit the title of your first post to add [SOLVED] :wink:
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
cynwulf
Posts: 2451
Joined: 2008-09-25 08:49
Has thanked: 19 times
Been thanked: 16 times

Re: disappearing sudo

#13 Post by cynwulf »

lindi wrote: 2022-08-06 07:37You can use multiple whitespace characters if you like. See "man bash", section on "Word splitting":
Good point but the error would be different in that case:

Code: Select all

mount: teradisk: mount point does not exist.
+1

The above two posts by @lindi are absolutely correct.
seog wrote: 2022-08-05 18:04

Code: Select all

sehrguey@debian:~$ sudo apt install sudo
[sudo] password for sehrguey: 
[...]
sehrguey@debian:~$ sudo mount  /dev/sda1 teradisk
bash: sudo: command not found
The first output show's sudo successful execution.

The second shows that "sudo " is simply not found at all - it is nothing to do with the mount command, nor the number of spaces, but one of those is not a space - so some "non-printable special characters" (from copy and paste), is almost certainly the culprit.

seog
Posts: 5
Joined: 2022-08-05 17:48

Re: disappearing sudo

#14 Post by seog »

OK, great

Code: Select all

sehrguey@debian:~$ sudo mount /dev/sda1 teradisk
bash: sudo: command not found
sehrguey@debian:~$ history | tail -n 2 | cat -A
  969  M-oM-;M-?sudo mount /dev/sda1 teradisk$
  970  history | tail -n 2 | cat -A$
I tried it before yet did not get the meaning of '?' in the output. After the invisible culprit was deleted the command worked as expected and hence 2 conclusions:
1) I owe you an apology to You for taking up so much of Your precious time;
2) bash under Xfce is pickier than under gdm.
Thank You for Your tolerance and patience.

Yours`
sehrguey

Post Reply