yingfeng
The heart is as bright as a mirror. If you don't, you won't be welcomed

Debian installation completed, no command resolution found

A Debian virtual machine was set up during the previous test. As a result, many problems were found after the system was installed. Even the most basic commands, such as service, reboot, poweroff, could not be used. I once suspected that my system was not installed properly, or even reinstalled, but I still couldn't find the commands

The reason for this problem is that the directory path (system user directory) of/sbin is not added to the $PATH variable

 #View current $PATH root@debian :/home/user# echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

If there is no/sbin, you can use the following command

 root@debian :/home/user# export PATH=$PATH:/sbin/ root@debian :/home/user#

temporary Add the corresponding road reinforcement to the $PATH variable to test whether it is available.
But this is only a temporary addition. Disconnecting ssh and reconnecting will invalidate it. You need to permanently add and edit the. bashrc file (each user has a. bashrc file. If you want each user to use it normally, you need to edit each user's. bashrc file)

 #Switch to the root directory root@debian :/home/user# cd ~ root@debian :~#  #Edit File root@debian :~# vim .bashrc

Add on the last line

 export PATH=$PATH:/usr/sbin
 # ~/.bashrc: executed by bash(1) for non-login shells.  # Note: PS1 and umask are already set in /etc/profile.  You should not  # need this unless you want different defaults for root.  # PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '  # umask 022  # You may uncomment the following lines if you want `ls' to be colorized:  # export LS_OPTIONS='--color=auto'  # eval "`dircolors`"  # alias ls='ls $LS_OPTIONS'  # alias ll='ls $LS_OPTIONS -l'  # alias l='ls $LS_OPTIONS -lA'  #  # Some more alias to avoid making mistakes:  # alias rm='rm -i'  # alias cp='cp -i'  # alias mv='mv -i'  export PATH=$PATH:/usr/sbin

After saving, execute

 root@debian :~# source ~/.bashrc root@debian :~#

Then review the $PATH variable

 root@debian :~# echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/sbin

As you can see, there are more/usr/sbin

Now you can use the reboot, service and other commands normally.

This article is published at: yingfeng Blog >> Debian installation completed, no command resolution found , please indicate the source for reprinting.

comment five

  • Nickname (required)
  • Email (required)
  • website
  1. #0

    Thanks for sharing

    Cross border e-commerce 7 months ago (09-27) reply
  2. #0

    Thank you, God. I just installed the printer driver, but I can't use it. You can do it as you do. Thank you

    frigo Two years ago (2022-04-09) reply
  3. #0

    Where can Debian be so disabled? I usually only encounter some thin images like this on the docker hub, and the description is not complete.

    yfresh Three years ago (2021-10-28) reply