LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 08-23-2012, 10:07 AM   #1
vjramana
Member
 
Registered: Sep 2009
Posts: 88

Rep: Reputation: 0
how to resetting PATH in ubuntu 10.10


Friends,

Recently I installed texlive2012 in home directory. Upon finish installing, I executed "texhash" command. After running this command, I can not execute any commands such as sed, awk, ls, or any other commands from my terminal. Even If I open new terminal the same result. (I also restarted this machine few time adn still the problem exist).

For example, if I execute "ls" I get message as below:

Quote:
vijay@glycomod:~$ ls
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found
vijay@glycomod:~$
I can understand the path setting are missing but I do not know how to fix this.
Can anyone help to fix this?

Thank you.
 
Old 08-23-2012, 10:17 AM   #2
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Do you modify the path in .bashrc? If so please post this:
Code:
/bin/cat .bashrc
 
Old 08-23-2012, 12:10 PM   #3
vjramana
Member
 
Registered: Sep 2009
Posts: 88

Original Poster
Rep: Reputation: 0
this is my .bashrc file
Code:
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
	# We have color support; assume it's compliant with Ecma-48
	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
	# a case would tend to support setf rather than setaf.)
	color_prompt=yes
    else
	color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -l'
#alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

#########################################333
# AMBER installation

AMBERHOME=/usr/local/amber9
export AMBERHOME 

PATH=$PATH:$AMBERHOME/exe
export PATH


# For NAMD
# NAMD=/home/vijay/NAMD/NAMD_2.8_Source/Linux-x86_64-g++
NAMD=/usr/local/NAMD_2.8_Source/Linux-x86_64-g++
export NAMD

PATH=$PATH:$NAMD
export PATH

# for texlive2012

PATH=/home/vijay/.texlive2012-install/texlive/2012/texmf/doc/man  #to MANPATH, if not dynamically determined.
PATH=/home/vijay/.texlive2012-install/texlive/2012/texmf/doc/info #to INFOPATH.
PATH=/home/vijay/.texlive2012-install/texlive/2012/bin/x86_64-linux


##PATH=/usr/local/texlive/2012/bin/i386-linux:$PATH 
#PATH=/usr/local/texlive/2012/texmf/doc/man:$PATH  # to MANPATH.
#PATH=/usr/local/texlive/2012/texmf/doc/info:$PATH # to INFOPATH.
#PATH=/usr/local/texlive/2012/bin/x86_64-linux:$PATH

Last edited by onebuck; 08-24-2012 at 08:43 AM. Reason: fix VBcode tags to clean up post
 
Old 08-23-2012, 12:46 PM   #4
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Quote:
Originally Posted by vjramana View Post
PATH=/home/vijay/.texlive2012-install/texlive/2012/texmf/doc/man #to MANPATH, if not dynamically determined.
PATH=/home/vijay/.texlive2012-install/texlive/2012/texmf/doc/info #to INFOPATH.
PATH=/home/vijay/.texlive2012-install/texlive/2012/bin/x86_64-linux
These lines overwrite the PATH variable, try commenting them out to see if that fixes the problem
 
Old 08-23-2012, 07:45 PM   #5
vjramana
Member
 
Registered: Sep 2009
Posts: 88

Original Poster
Rep: Reputation: 0
I have tried comment those lines but the problem still remains.
 
Old 08-23-2012, 07:55 PM   #6
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Post:
Code:
/bin/echo $PATH
 
Old 08-23-2012, 08:58 PM   #7
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,591

Rep: Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244
Hi,

you won't really be able to do much until you reset your path. After that you can fix your .bashrc so that the path will be ok in new shells. Do the following in a terminal
Code:
echo $PATH
PATH="/usr/bin:/bin"
echo $PATH
Please post the output of the above so that we can see what is going on.

Now in the same terminal you can open your .bashrc in an editor and replace the texlive2012 lines with the following
Code:
export MANPATH=$HOME/.texlive2012-install/texlive/2012/texmf/doc/man #to MANPATH, if not dynamically determined.
export INFOPATH=$HOME/.texlive2012-install/texlive/2012/texmf/doc/info #to INFOPATH.
PATH="$PATH:$HOME/.texlive2012-install/texlive/2012/bin/x86_64-linux"

Now try opening an new terminal and check your path
Code:
echo $PATH
Evo2.
 
Old 08-23-2012, 09:00 PM   #8
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,591

Rep: Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244
Hi,
Quote:
Originally Posted by byannoni View Post
Post:
Code:
/bin/echo $PATH
while /bin/echo may exist, it is also a shell builtin so "echo $PATH" should work regardless of what PATH is set to.

Evo2.
 
1 members found this post helpful.
Old 08-23-2012, 09:51 PM   #9
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Quote:
Originally Posted by evo2 View Post
Hi,

while /bin/echo may exist, it is also a shell builtin so "echo $PATH" should work regardless of what PATH is set to.

Evo2.
Oh, that's good to know, thanks.
 
  


Reply

Tags
path


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PATH variable resetting after reboot derrekito Linux - General 3 05-08-2012 05:59 PM
Resetting Windows password with Ubuntu. rockr101 General 7 03-08-2012 10:53 AM
Ubuntu 8.04 iptable resetting boothcat4320 Linux - Networking 4 02-13-2009 11:50 AM
resetting passwords in Ubuntu nm_pepper Linux - General 4 03-03-2008 06:51 AM
Resetting Ubuntu system fonts Reegz Linux - Desktop 1 02-15-2008 12:13 PM


All times are GMT -5. The time now is 11:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration