Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: messed up my $PATH and /sbin

  1. #1
    Join Date
    May 2013
    Beans
    14

    messed up my $PATH and /sbin

    While switching from KDE to XFCE i managed to mess up my $PATH (least I believe). When i enter
    Code:
    ifconfig
    into my terminal i get the error.
    Code:
    Command 'ifconfig' is available in '/sbin/ifconfig'
    The command could not be located because '/sbin' is not included in the PATH environment variable.
    This is most likely caused by the lack of administrative privileges associated with your user account.
    ifconfig: command not found
    when i echo $PATH i get
    Code:
    echo $PATH
    /usr/local/bin:/usr/bin:/bin:/usr/games
    so far my googling has found a temp fix
    Code:
    export PATH=/sbin:$PATH
    so far I have reached two questions. Is this the best method of restoring my /sbin path? and how do i make it perminant?
    Last edited by linxlimbo; May 6th, 2013 at 11:01 PM. Reason: wrong copy and paste

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,604
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: messed up my $PATH and /sbin

    Hi linxlimbo.

    If you dynamically changed it in a terminal, just close it and open a new one.

    If you don't want to close your terminal, try this:
    Code:
    source /etc/environment
    Hope it helps. Let us know how it goes.
    Regards.

  3. #3
    Join Date
    May 2013
    Beans
    14

    Re: messed up my $PATH and /sbin

    Thanks papibe for the quick reply,
    unfortunately when i
    Code:
    source /etc/environment
    and then quit out of terminal and open a new one the same warning comes up.

  4. #4
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,604
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: messed up my $PATH and /sbin

    I see.

    I think you made a permanent change, then.

    Do you remember what file did you change?

    Could you post the result of this command?
    Code:
    grep PATH ~/.*
    Regards.

  5. #5
    Join Date
    May 2013
    Beans
    14

    Re: messed up my $PATH and /sbin

    this wasn't a recent change so nothing that can be pulled from recent history, i'm not sure if you can find what you're looking for in there. But here's the outcome of your request
    Code:
    /home/user/.bash_history:export PATH=$PATH:/usr/sbin
    /home/user/.bash_history:export PATH=$PATH:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/bin:/usr/games
    /home/user/.bash_history:echo $PATH
    /home/user/.bash_history:export PATH=/sbin:$PATH
    /home/user/.bash_history:echo $PATH
    /home/user/.bash_history:echo $PATH
    /home/user/.bash_history:export PATH=/sbin:$PATH
    /home/user/.bash_history:export PATH=/sbin:$PATH
    /home/user/.bash_history:echo $PATH
    /home/user/.bash_history:export PATH=/sbin:$PATH
    /home/user/.bash_history:echo $PATH
    /home/user/.bash_history:export PATH=/sbin:$PATH
    /home/user/.profile:# set PATH so it includes user's private bin if it exists
    /home/user/.profile:    PATH="$HOME/bin:$PATH"

  6. #6
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,604
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: messed up my $PATH and /sbin

    By any chance did you edit files on /etc?

    Could you post the result of this command?
    Code:
    grep -i path /etc/bash.bashrc /etc/profile
    Regards.

  7. #7
    Join Date
    May 2013
    Beans
    14

    Re: messed up my $PATH and /sbin

    that grep results in nothing, big issue?

  8. #8
    Join Date
    May 2013
    Beans
    14

    Re: messed up my $PATH and /sbin

    I just looked into "bash" and came across this article about bash and the order it invokes.
    .bashrc exsists, but .bash_profile doesn't. Is this the issue? If so, where is echo $PATH pulling from? because if I perform the same command under root it results in a different answer.

  9. #9
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,604
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: messed up my $PATH and /sbin

    Quote Originally Posted by linxlimbo View Post
    bash_profile doesn't. Is this the issue?
    Not really.
    Quote Originally Posted by linxlimbo View Post
    I perform the same command under root it results in a different answer.
    That sounds like a good thing. I'm guessing you set the changes only for your account and not for the whole system.

    Let's compare you bash config files with the base ones. Could you post the result of these 2 commands?
    Code:
    diff /etc/skel/.bashrc ~/.bashrc
    
    diff /etc/skel/.profile ~/.profile
    Regards.

  10. #10
    Join Date
    May 2013
    Beans
    14

    Re: messed up my $PATH and /sbin

    neither of those commands result in anything, does this mean there's no difference?

    Edit: after reading up on this command and doing a quick manual command I realize this is just showing there is no difference between the two files.
    Last edited by linxlimbo; May 7th, 2013 at 08:44 PM.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •