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

Thread: PATH$ error

  1. #1
    Join Date
    Apr 2012
    Location
    Missouri, USA
    Beans
    94
    Distro
    Ubuntu

    [SOLVED] PATH$ error

    Welcome to all! I haven't been on ubuntuforums for a while, meaning i haven't had any problems, but alas! I have yet another problem and need your peaoples help. I was installing something using terminal, and the PATH$ said that i need to choose the location of the path. I did so, and the command worked fine. The problem is, every time i enter a command involving path, i get the error

    The command could not be located because '/usr/bin (in this case, any location)' is not included in the PATH environment variable.
    How do i fix this??? How do i get the PATH$ back to what it's suppose to be?Thanks for your time and help,
    Linux Junkie
    Last edited by linux junkie; February 7th, 2013 at 02:53 AM.

  2. #2
    Join Date
    Sep 2006
    Beans
    8,055
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: PATH$ error

    If you close the terminal and open it again, the $PATH should be reset to what is set in ~/.profile or /etc/environment. That is, if you did not change it in ~/.bashrc or ~/.profile. Where did you change it?
    The Truth Shall Make Ye Fret.

  3. #3
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: PATH$ error

    What is your path now? Please post the output of the following command
    Code:
    echo $PATH
    I'm running Ubuntu 12.04 and I have the following path

    Code:
    /home/sudodus/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/games
    - There is a duplicate for games (that should be removed).
    - The first item was automatically added, when I made a ~/bin directory for my own executables.
    - The second item was automatically added because of the X display manager used in my system (lightdm).

    - I think the rest of the items come from the file /etc/environment

    which contains one line for PATH and one line for LANG

    Code:
    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    LANG="sv_SE.UTF-8"
    So I suggest that you make a backup copy of that file

    Code:
    sudo cp /etc/environment /etc/environment.old
    and then edit the file to include what should be there (for example copy the content of my PATH=... line, but keep your language entry)
    Code:
    sudo nano /etc/environment
    Use nano or the editor you like the best, but remember to run it with superuser privileges.

    Reboot and see if it helps. If no luck, there is something that overwrites your path, and you need to find it, or overwrite it again, which might be tricky.

  4. #4
    Join Date
    Apr 2012
    Location
    Missouri, USA
    Beans
    94
    Distro
    Ubuntu

    Re: PATH$ error

    Quote Originally Posted by sudodus View Post
    What is your path now? Please post the output of the following command
    Code:
    echo $PATH
    I'm running Ubuntu 12.04 and I have the following path

    Code:
    /home/sudodus/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/games
    - There is a duplicate for games (that should be removed).
    - The first item was automatically added, when I made a ~/bin directory for my own executables.
    - The second item was automatically added because of the X display manager used in my system (lightdm).

    - I think the rest of the items come from the file /etc/environment

    which contains one line for PATH and one line for LANG

    Code:
    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    LANG="sv_SE.UTF-8"
    So I suggest that you make a backup copy of that file

    Code:
    sudo cp /etc/environment /etc/environment.old
    and then edit the file to include what should be there (for example copy the content of my PATH=... line, but keep your language entry)
    Code:
    sudo nano /etc/environment
    Use nano or the editor you like the best, but remember to run it with superuser privileges.

    Reboot and see if it helps. If no luck, there is something that overwrites your path, and you need to find it, or overwrite it again, which might be tricky.

    Mk, so the output is:
    $/Home/Dev/:/home/jeremiah/Dev/android-sdk-linux/tools:/home/jeremiah/Dev/android-sdk-linux/platform-tools
    I think thats the problem... And about your other commands, every time i do a sudo command i get the same error: Command
    'sudo' is available in '/usr/bin/sudo'
    So i guess i permanently changed the PATH$, screwing it up...
    EDIT: The reason it says android is because i was trying to install an android emulator, and one command told me to put in my path file, which may have screwed it up.
    Last edited by linux junkie; February 3rd, 2013 at 04:11 AM.

  5. #5
    Join Date
    Apr 2012
    Location
    Missouri, USA
    Beans
    94
    Distro
    Ubuntu

    Re: PATH$ error

    Not sure where, but i think i permanently changed the path.

  6. #6
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: PATH$ error

    Try to repair it booted from a live system: Boot from your Ubuntu install CD/USB drive.

    Run
    Code:
    sudo fdisk -lu
    and
    Code:
    sudo blkid
    to identify your partitions.

    Mount the root partition of the installed ubuntu system, probably /dev/sda1, /dev/sda5 or /dev/sda6. Use the file browser to mount/umount. Let's say your system is mounted on /media/ubuntu (the name may vary depending of if you use labels).

    Code:
    sudo cp /media/ubuntu/etc/environment /media/ubuntu/etc/environment.old
    and edit the file with
    Code:
    sudo nano /media/ubuntu/etc/environment
    But if that file is good, and your path is still bad, it is changed somewhere. Check also the locations suggested by Lars Noodén, where ~ should translate to something like
    Code:
    /media/ubuntu/home/jeremiah
    when running the live system.

    You might also try to search for PATH= in the /etc directory

    Code:
    sudo grep -r "PATH=" /media/ubuntu/etc/*
    and for android-sdk-linux
    Code:
    sudo grep -r "android-sdk-linux" /media/ubuntu/etc/*
    which might help you find where your path is reset.

  7. #7
    Join Date
    Apr 2012
    Location
    Missouri, USA
    Beans
    94
    Distro
    Ubuntu

    Re: PATH$ error

    So, basically reset my PATH$? I have used commands before, but never got too far into it, and sadly your help doesn't make too much sense, lol... But i could look up like a tutorial and follow that, right? Or make your commands a wee bit easier to understand for me? The partition is /dev/sda2 i don't think it has a name other than that... And my username is jeremiah . So, could you make your commands fit these specifications? It would be great...

  8. #8
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: PATH$ error

    Quote Originally Posted by linux junkie View Post
    So, basically reset my PATH$? I have used commands before, but never got too far into it, and sadly your help doesn't make too much sense, lol... But i could look up like a tutorial and follow that, right? Or make your commands a wee bit easier to understand for me? The partition is /dev/sda2 i don't think it has a name other than that... And my username is jeremiah . So, could you make your commands fit these specifications? It would be great...
    0. Boot from the install CD/USB drive

    1. Use the file browser to mount /dev/sda2 (click on its icon in the left panel)

    2. Run the command
    Code:
    df
    and post the output.

    Then I will try to give detailed instructions

  9. #9
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,459
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: PATH$ error

    somehow you have overwritten the $PATH variable entirely instead of merely appending your own directories to the default value
    it should be
    Code:
    PATH=$PATH:/some/dir1:/some/dir2
    not
    Code:
    PATH=/some/dir1:/some/dir2
    if your question is answered, mark the thread as [SOLVED]. Thx.
    To post code or command output, use [code] tags.
    Check your bash script here // BashFAQ // BashPitfalls

  10. #10
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: PATH$ error

    Quote Originally Posted by linux junkie View Post
    Welcome to all! I haven't been on ubuntuforums for a while, meaning i haven't had any problems, but alas! I have yet another problem and need your peaoples help. I was installing something using terminal, and the PATH$ said that i need to choose the location of the path. I did so, and the command worked fine. The problem is, every time i enter a command involving path, i get the error



    How do i fix this??? How do i get the PATH$ back to what it's suppose to be?Thanks for your time and help,
    Linux Junkie
    hi
    i must tell you: this error message i have never seen !!!! (sytem will tell you "command not found - or ???).

    just a hint: it's not PATH$ it is $PATH and if you want to expand your orginal PATH (take the last line in your ~/.bashrc) you have to do it in the following way:
    PATH=$PATH:/your_new_paths seperated by ":"
    export PATH
    by the side: i know you can write: export PATH=bla blabla
    but the original "sh" will give you an error if you write it on the same line
    cheers
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •