yingfeng

  • home page
  • Friendly Links
  • Apply for friend chain
  • About me
  • Contact me
  • donation
  • Privacy Policy
yingfeng
The heart is as bright as a mirror. If you don't, you won't be welcomed
  1. home page
  2. Technical Tutorial
  3. text

Debian installation completed, no command resolution found

2020-10-25 20515 point heat 1 person likes 5 comments

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 work is licensed under the Creative Commons Attribution 4.0 International License Agreement
label: Debian Linux environment variable
Last updated: 2021-06-16

yingfeng

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

Reward give the thumbs-up
<Previous
Next>

Article comments

  • Cross border e-commerce

    Thanks for sharing

    2023-09-27
    reply
  • frigo

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

    2022-04-09
    reply
  • yfresh

    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.

    2021-10-28
    reply
    • yingfeng

      @yfresh I don't understand. After all, it's just like this

      2021-11-10
      reply
      • The rising sun warms the face

        @yingfeng It should be this problem https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918754

        2023-02-16
        reply
  •  razz  evil  exclaim  smile  redface  biggrin  eek  confused  idea  lol  mad  twisted  rolleyes  wink  cool  arrow  neutral  cry  mrgreen  drooling  persevering
    Cancel Reply

    yingfeng

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

    newest hotspot random
    newest hotspot random
    The first meteor shower in 2025: the Quadrant Meteor Shower Let's Encrypt Free SSL Certificate Application and Automatic Renewal Some sharing about my use of z30 for a period of time (verbose, much nonsense) Yinlin's "Whether the Mountains Are Beautiful" Tour • Shenzhen Station UNAS replaces the hard disk in the volume group, leaving the directory unchanged Linux Replace Hard Disk in Volume Group
    Simple evaluation of k2p Gaoke firmware Did you meet her, a girl named Xuanji Clear the right click video card menu on the Windows system desktop Share an embarrassing case in work Linux Replace Hard Disk in Volume Group Some sharing about my use of z30 for a period of time (verbose, much nonsense)
    Recent comments
    Yingfeng released 10 months ago (September 20) Your site is down
    Siyang was released 10 months ago (September 4) Forget it. It's still from Taiwan's Apple ID
    Ali7 was released one year ago (June 8) The newly established website has just been migrated from the intranet to the WAN~ You have added a friend chain for the boss http://blog.alise.t...
    FreelyTomorrow was released one year ago (February 12) Hello, if my website is set up abroad, is it not convenient to exchange links with domestic websites
    Cross border e-commerce was released two years ago (September 27) Thanks for sharing

    COPYRIGHT © 2025 yingfeng. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    Min ICP Bei No. 15026537 - 1