LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error message on bash startup (https://www.linuxquestions.org/questions/linux-newbie-8/error-message-on-bash-startup-4175425665/)

Russell91 09-04-2012 07:34 PM

Error message on bash startup
 
In the process of installing opencv on my computer, I wound up creating an error that pops up each time I open a new terminal:

bash: /PKG_CONFIG_PATH=$/bin:/usr/local/lib/pkgconfig: No such file or directory

Any ideas on what might be causing this?

chrism01 09-04-2012 07:39 PM

Msg means what it says...
Code:

$/bin
meaningless.
You could also check the other path /usr/local/lib/pkgconfig does exist as well.

Russell91 09-04-2012 07:45 PM

Quote:

Originally Posted by chrism01 (Post 4772753)
Msg means what it says...
Code:

$/bin
meaningless.
You could also check the other path /usr/local/lib/pkgconfig does exist as well.

I am not sure what you mean by "Msg means what it says...". I am able to cd into both the bin directory and the /usr/local/lib/pkgconfig without any problems.

teckk 09-04-2012 07:51 PM

Since you don't say what flavor of Linux you use, how you installed opencv,

Look at
~/.bashrc
$PATH which could be stored in several places depending on distro.
Maybe /etc/profile or ~/.profile
Quote:

PATH=$/bin
That's not right.
Quote:

/usr/local/lib/pkgconfig
Is that right?

Find out where that $PATH statement is and change it.

kaotikzen 09-04-2012 07:57 PM

What's happening is that your bash profile thinks you want to execute a command located at a path that doesn't exist (literally: /PKG_CONFIG_PATH=$/bin:/usr/local/lib/pkgconfig).

Check out both ~/.bashrc and ~/.bash_profile and look for this line:

/PKG_CONFIG_PATH=$/bin:/usr/local/lib/pkgconfig

Remove the the leading forward slash so that it looks like this:

PKG_CONFIG_PATH=$/bin:/usr/local/lib/pkgconfig

Then save the file. The next time you load up bash, that error should go away.

(note: if you've edited /etc/profile in your journeys, you may need to look there as well)

Russell91 09-04-2012 09:29 PM

Quote:

Originally Posted by kaotikzen (Post 4772761)
What's happening is that your bash profile thinks you want to execute a command located at a path that doesn't exist (literally: /PKG_CONFIG_PATH=$/bin:/usr/local/lib/pkgconfig).

Check out both ~/.bashrc and ~/.bash_profile and look for this line:

/PKG_CONFIG_PATH=$/bin:/usr/local/lib/pkgconfig

Remove the the leading forward slash so that it looks like this:

PKG_CONFIG_PATH=$/bin:/usr/local/lib/pkgconfig

Then save the file. The next time you load up bash, that error should go away.

(note: if you've edited /etc/profile in your journeys, you may need to look there as well)

This seems like a reasonable explanation, but I did not find any reference to the line in ~.bashrc, ~.profile /etc/profile (pasted below). However, it does seem that I am missing a ~.bash_profile file: ~$ ls -a | grep profile returned only .profile. Perhaps this could be a source of the problem? Also, I am using Ubuntu 11.1 and I could have changed any one of a number of things in the installation process, as it is pretty easy to mess with things when you don't know what you are doing.

>Find out where that $PATH statement is and change it.
This is what I have been trying to do, but none of the files being called at bash launch seem to contain the line.

Thanks for the help so far.

Code:

~.bashrc: --------------------------------

# ~/.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 -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
source /opt/ros/electric/setup.bash

export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/home


suicidaleggroll 09-04-2012 09:49 PM

Could you post the contents of "/opt/ros/electric/setup.bash"? And please use code tags.

Russell91 09-04-2012 09:53 PM

Quote:

Originally Posted by suicidaleggroll (Post 4772839)
Could you post the contents of "/opt/ros/electric/setup.bash"? And please use code tags.

Code:

#!/bin/bash
# IT IS UNLIKELY YOU WANT TO EDIT THIS FILE BY HAND
# IF YOU WANT TO CHANGE THE ROS ENVIRONMENT VARIABLES
# EDIT "setup.sh" IN THIS DIRECTORY.

# Load the path of this particular setup.bash                                                                                                                 

SCRIPT_PATH="${BASH_SOURCE[0]}";
if([ -h "${SCRIPT_PATH}" ]) then
  while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done
fi
pushd . > /dev/null
cd `dirname ${SCRIPT_PATH}` > /dev/null
SCRIPT_PATH=`pwd`;
popd  > /dev/null


. $SCRIPT_PATH/setup.sh

if [ -e ${ROS_ROOT}/tools/rosbash/rosbash ]; then
  . ${ROS_ROOT}/tools/rosbash/rosbash
fi


suicidaleggroll 09-04-2012 10:03 PM

Hm, not there either. Maybe just grep for "PKG_CONFIG_PATH" in all hidden files in your home directory:

Code:

grep PKG_CONFIG_PATH ~/.*

Russell91 09-04-2012 10:10 PM

Quote:

Originally Posted by suicidaleggroll (Post 4772854)
Hm, not there either. Maybe just grep for "PKG_CONFIG_PATH" in all hidden files in your home directory:

Code:

grep PKG_CONFIG_PATH ~/.*

So this returns a list of files from my ./bash_history. It seems like the following line might have caused the problem:

Code:

/home/russellstewart/.bash_history:PKG_CONFIG_PATH=:/usr/local/lib/pkgconfig
/home/russellstewart/.bash_history:export PKG_CONFIG_PATH=:/usr/local/lib/pkgconfig

However, I am not sure how this would cause the "/" in "/PKG_CONFIG_PATH" to appear.

Also, upon restarting again, the error on the bash has lost the $/bin: path, so it seems that the problem is in the /usr/local/lib/pkgconfig directory. When I first ran into this problem, that folder contained an opencv.pc file. I have since removed that file along with most of the cv installation to no avail.

kaotikzen 09-05-2012 06:11 PM

Did you, by chance, check the contents of that .profile file you found?

UPDATE:
Reread your reply. You did check that file. I'm high on cold meds apparently.

Which distribution are you using? Maybe I can setup a VM and break it on purpose and share in your pain some. Oh, is there a a .bash_login file in your home directory, if yes check that too!


All times are GMT -5. The time now is 06:16 PM.