LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   terminal (https://www.linuxquestions.org/questions/linux-newbie-8/terminal-655301/)

delshere 07-12-2008 09:06 AM

terminal
 
I have fedora 7 installed and I tried a ubuntu live cd and now my terminal says bill@ubuntu instead of bill@fedora and it is driving me nuts. I even tried reinstalling fedora and no luck still says ubuntu. Thanks in advance.

alan_ri 07-12-2008 09:28 AM

Welcome to LQ!
I wonder how did that happend.
Anyway,change a name in /etc/hostname file or similar(I'm not using Fedora)and that should do it.You may also want to change your hostname like this;
Code:

$hostname fedora
but that will only work untill you restart your machine.

rikijpn 07-12-2008 10:09 AM

shell
 
Hey.
Yes, that sounds strange enough. What a appears in your terminal as your "prompt" is what a variable called PS1 gives (a variable in your shell, bash right?). If you only want to change your prompt, then just changing this variable would be enough. You could try:
Code:

PS1=I_M_SO_COOL$
which would give you a new I_M_SO_COOL$ prompt (of course you can change this to whatever you like).

But of course, it is strange enough to have your prompt changed in the way you are saying.
You could try
Code:

echo $PS1
to check if your hostname is really being used (which probably will...).
and/or check
Code:

echo $HOSTNAME
which will return the name of your host. If this was changed for whatever reason, you should change it back, as alan_ri says, by changing your host's name again. You should search for whatever file sets that variable, and change it. According to your distribution, the file where this file will be differs a bit, but I think it should be in /etc directory. So if the file is not /etc/hostname, you might
Code:

cd /etc; search -name "host*"
to search related files, and if you find somewhere written ubuntu, just change it to fedora or whatever name you like.

mrrangerman 07-12-2008 11:52 AM

What did you do to make this happen? It didn't just happen on its own, did you happen to click on the little icon that says something like Install Ubuntu? Did you happen to check the Ubuntu cd to make sure it wasn't altered when downloading it, before you burned an image?

delshere 07-12-2008 12:04 PM

rikijpn
 
I did want you said the echo $hostname returned /u@/h/W/$ so ubuntu is still in there. Checked in hosts and fedora is in there so its not in hosts. When I echo PS1 it only works till I reboot. Then its back to Ubuntu. Any other thing you can think of let me know. Thanks

rikijpn 07-12-2008 12:27 PM

search the web/forums first
 
/u@/h/W/$ on PS1 means it will put your /u = username, h = hostname, W = working directory, and of course the familiar $.
So yes, effectively your hostname is the problem.

As says here
http://www.linuxquestions.org/questi...core-2-268786/ (I recommend you search the web/forums everytime you get a clue of how to fix stuffs)
apparently in fedora core 2 there is a file called /etc/sysconfig/network in which the HOSTNAME is set(changing this would "fix" the problem). I don't know whether it's the same in your version or not, but you should check if the file exists or what. If it does, then problem fixed.
If it doesn't, then you could google around searching for something like "fedora 7 hostname", which will probably give you some good answer.

If you still get problems with this, then you could just put HOSTNAME=name_i_like in your .bashrc or .bash_profile file, which would fix it... but it's kind of an ugly solution.

mrrangerman 07-12-2008 02:00 PM

Can you tell us what you did! If there is a bug in this it would be good to know about, and report if need be.
I have never seen a live-cd of anykind kind do what you say has happened. You say you reinstalled fedora, did you do a fresh install or just a system restore?

delshere 07-12-2008 02:33 PM

mrrangerman
 
Quote:

Originally Posted by mrrangerman (Post 3212453)
Can you tell us what you did! If there is a bug in this it would be good to know about, and report if need be.
I have never seen a live-cd of anykind kind do what you say has happened. You say you reinstalled fedora, did you do a fresh install or just a system restore?


What I did is run a live kde cd of Ubuntu after I ran it from the cd. I booted back to hard drive where Fedora 7 is and now the host name say bill@ubuntu instead of bill@fedora at the prompt. I tried reinstalling Fedora 7 and even ran fedora format and ubuntu is still there. It just driving me nuts seeing it. Any help, Thanks


All times are GMT -5. The time now is 09:00 PM.