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

 

 

 

Basic commands not working

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Janne00
Posts: 6
Joined: 2016-01-17 17:41

Basic commands not working

#1 Post by Janne00 »

Background and setup:
I did a new installation of Debian 11 on an old PC (fitpc2) with an Intel Atom processor.
I did a command line installation of the i386 image and opted for the SSH server and the standard system utilities.
I set the root password and defined one user (myself) and chose a separate home partition which I set to the maximum size.
I succeeded with access from a Windows 10 desktop using Putty and I set up smb server since the Debian PC will be a file server for music and photos.
My problems:
-I cannot make basic commands work. I can only give root commands by typing just su and then the administrator pathword, i.e. logging in as root. I would rather type e.g. su update (or su apt-get...), but I get an error message user update (apt-get) does not exist. Am I missing something?
-I cannot make any shutdown commands work. With the commands shutdown and poweroff I just get an error message that the command does not exist. The only reboot that works is ctrl+alt+del. What am I missing?

steve_v
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1395
Joined: 2012-10-06 05:31
Location: /dev/chair
Has thanked: 78 times
Been thanked: 173 times

Re: Basic commands not working

#2 Post by steve_v »

Janne00 wrote: 2021-09-16 07:48I would rather type e.g. su update (or su apt-get...), but I get an error message user update (apt-get) does not exist.
Uhh, yeah. su takes a username as the first argument, it always has. You likely want sudo [command] or su -c [command].
Janne00 wrote: 2021-09-16 07:48Am I missing something?
Yup, reading the manual. See 'man su'. Also 'man sudo', 'man bash' and 'man whereis'.
Janne00 wrote: 2021-09-16 07:48I cannot make any shutdown commands work. With the commands shutdown and poweroff I just get an error message that the command does not exist.
Command not found is expected, as /sbin (location of the shutdown binary) and /usr/sbin are not in a normal (non-root) users PATH by default. Generally you need superuser privileges to use stuff in there anyway.
If you're trying shutdown as root, you might have a look here WRT changes to the su command and setting PATH.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Janne00
Posts: 6
Joined: 2016-01-17 17:41

Re: Basic commands not working

#3 Post by Janne00 »

Thank you. Looks like some things have changed since Debian Lenny :-)
You are right, I should be using sudo now. I thought it was included but obviously the command needs to be installed and user added to sudoers.
Now it looks like that took care of the other problem as well because shutdown commands and other commands are now accessible. Great!

User avatar
4D696B65
Site admin
Site admin
Posts: 2696
Joined: 2009-06-28 06:09
Been thanked: 85 times

Re: Basic commands not working

#4 Post by 4D696B65 »

Janne00 wrote: 2021-09-16 16:22 Thank you. Looks like some things have changed since Debian Lenny :-)
You are right, I should be using sudo now.
Yes things changed but that doesn't mean you should be using sudo. su changed to su -, that's all.

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Basic commands not working

#5 Post by Segfault »

For all users who have this "commands not working" issue. I have a recommendation. Every time you have a coffee break take one command from /bin or /sbin and read up on it. Won't take long, your commands will start working.

User avatar
sunrat
Administrator
Administrator
Posts: 6382
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 115 times
Been thanked: 456 times

Re: Basic commands not working

#6 Post by sunrat »

There was a recent thread about a possible bug where apt-get command didn't work whereas the same command using the newer apt worked fine.
viewtopic.php?t=150414
https://linux.debian.bugs.dist.narkive. ... -to-accept
I find apt is better for most purposes anyway. Another change since Lenny. :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!

Post Reply