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

 

 

 

disappearing sudo

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
seog
Posts: 7
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
Debian Developer
Debian Developer
Posts: 412
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 77 times

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
Emeritus
Emeritus
Posts: 2435
Joined: 2010-12-07 19:55
Has thanked: 14 times
Been thanked: 54 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
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 461 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: 12
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
Debian Developer
Debian Developer
Posts: 412
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 77 times

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: 7
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
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: disappearing sudo

#8 Post by dilberts_left_nut »

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

seog
Posts: 7
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
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 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: 7
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
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 461 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!

cynwulf

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: 7
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

cynwulf

Re: disappearing sudo

#15 Post by cynwulf »

seog wrote: 2022-08-09 04:112) bash under Xfce is pickier than under gdm.
bash is bash, regardless of whether you are running a desktop or some display manager. It's not at all relevant.

Regardless of the shell in use, those characters would have likely caused the same problem.

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

Re: disappearing sudo

#16 Post by seog »

You are right, maybe I'm too rushy at jumping at wrong conclusions, it's only that I used that very same line (containing those pesky special characters) for months when under gnome without a hitch and the problem popped up after switching to Xfce environment.
Anyway, presently the special character is eliminated and bash responds as expected for which I'd like to thank all who found time to help me understand the issue.
Yours`
sehrguey

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: disappearing sudo

#17 Post by Head_on_a_Stick »

So was this a copy&paste issue? Or were you just using the up arrow to bring up the old command?

The OP shows a lamentable lack of detail that should be avoided in future. Always explain exactly what you have done in as much detail as possible. We're not psychic.
deadbang

cynwulf

Re: disappearing sudo

#18 Post by cynwulf »

Some clues about those characters here:

https://stackoverflow.com/questions/572 ... les-m-om-m

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

Re: disappearing sudo

#19 Post by seog »

yes, Sir Head_, so it was, the copy&paste from a file and not revoking the line from the terminal history. Sorry for the paranoically curt style of the OP, Sir. Never-never again. Faith.

dear cynwulf thank You for the link provided, I'll sure follow it. right now cannot find the button here to click up my gratitude to You

Post Reply