LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-05-2008, 03:21 PM   #1
tarahmarie
Member
 
Registered: Jan 2006
Distribution: Kubuntu 8.04 Hardy Heron with KDE 4.1.1
Posts: 36

Rep: Reputation: 15
Problem setting PATH with X11


Hi, all:

Here's my problem: X11 is not set in the PATH. I believe that this is the reason I am getting "no protocol specified, cannot open display" error messages in my terminal when using bash. As a result, I cannot open the /.bashrc or /.bash_profile (not that I have figured out yet what I'm supposed to put in there) in either root or username (trying to use gedit with "&" to open in a separate window). When I try to set the PATH, here's what I do:

PATH=$PATH:/usr/bin/X11
export PATH

I've tried this as root and as username, and what happens is that as soon as I exit the terminal or exit root status is this:

root@tarahmarie-desktop:/home/tarahmarie# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/bin/X11
root@tarahmarie-desktop:/home/tarahmarie# exit
exit
tarahmarie@tarahmarie-desktop:~$ su
Password:
root@tarahmarie-desktop:/home/tarahmarie# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

The same thing happens when I try to add /usr/lib/kde4/bin to my path in either root or username. What do I do?
 
Old 09-05-2008, 04:27 PM   #2
tarahmarie
Member
 
Registered: Jan 2006
Distribution: Kubuntu 8.04 Hardy Heron with KDE 4.1.1
Posts: 36

Original Poster
Rep: Reputation: 15
I have found two solutions, could someone please explain to me the difference between editing /.bash_profile and /.bashrc? What's the diff?
 
Old 09-05-2008, 04:50 PM   #3
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
IIRC ~/.bash_profile gets read at login and ~/.bashrc every time you open a shell. Of the two you should set the path in ~/.bash_profile. That said, I would use ~/.profile for that, or edit /etc/profile and include /usr/X11R6/bin in its PATH line.
 
Old 09-05-2008, 04:54 PM   #4
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,812
Blog Entries: 1

Rep: Reputation: 259Reputation: 259Reputation: 259
man bash, read the section entitle Invocation.
 
Old 09-05-2008, 05:40 PM   #5
tarahmarie
Member
 
Registered: Jan 2006
Distribution: Kubuntu 8.04 Hardy Heron with KDE 4.1.1
Posts: 36

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by makuyl View Post
IIRC ~/.bash_profile gets read at login and ~/.bashrc every time you open a shell. Of the two you should set the path in ~/.bash_profile. That said, I would use ~/.profile for that, or edit /etc/profile and include /usr/X11R6/bin in its PATH line.
Thanks; editing the /etc/profile worked perfectly.
 
Old 09-05-2008, 07:48 PM   #6
Hewson
Member
 
Registered: Feb 2007
Location: /home
Distribution: Kubuntu and CentOS
Posts: 214

Rep: Reputation: 32
Quote:
Originally Posted by makuyl View Post
IIRC ~/.bash_profile gets read at login and ~/.bashrc every time you open a shell. Of the two you should set the path in ~/.bash_profile. That said, I would use ~/.profile for that, or edit /etc/profile and include /usr/X11R6/bin in its PATH line.
It should also be be noted that /etc/profile is system wide (I.E. all users use it, while your ~/.profile is user specific)
 
Old 09-06-2008, 01:55 PM   #7
tarahmarie
Member
 
Registered: Jan 2006
Distribution: Kubuntu 8.04 Hardy Heron with KDE 4.1.1
Posts: 36

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Hewson View Post
It should also be be noted that /etc/profile is system wide (I.E. all users use it, while your ~/.profile is user specific)
By editing the /etc/profile's PATH, I have no problem now using all the bash commands as username. I still seem to have problems using the bash commands as root. When you say that the /etc/profile's PATH is system-wide, why doesn't root get access to the PATH in it?
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Path Problem Raakh Linux - Newbie 4 03-15-2008 02:02 PM
Setting up X11 For Flatron Neo-Leper Linux - Hardware 4 07-19-2007 02:25 PM
X11 program setting transparency for xcompmgr frogb Programming 0 11-01-2004 07:17 PM
Setting PATH martint Linux - Newbie 2 11-15-2003 05:27 PM
setting the default x11 font k4zau Linux - Software 5 05-05-2003 01:02 AM


All times are GMT -5. The time now is 08:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration