I rebooted recently, and now terminal fails to work. If I click the terminal shortcut or use Guake or ctrl-alt-T, the terminal opens briefly with no prompt, then immediately closes again. I installed xterm as well and the same thing happens.
If I use ctrl-alt-F1 to get to a command line session and type gnome-terminal I get the error message:
Failed to parse arguments: Cannot open displayHow can I diagnose and fix this?
EDIT TO ADD .bashrc
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
alias zf=/home/julio/ZendFramework-1.12.3/bin/zf.shEDIT 2-- adding .profile:
# if running bash
if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH"
fi
export SCALA_HOME=/usr/share/scala
export PATH=$PATH:$SCALA_HOME/bin
source ~/.profile 11 2 Answers
This has nothing to do with gnome-terminal, when you hit Ctrl Alt F1, logged in from the virtual console and tried running bash, you got a segmentation fault core dumped which means that bash itself crashes.
Anyway, what's happening is that your bash is entering an infinite loop. When bash first starts, it reads ~/.bashrc (actually, this is a simplification, see here for more details). In your case (and in most if not all Ubuntu versions), the default .bashrc, for reasons that have never been clear to me, sources (reads) ~/.profile as well. Now, your ~/.profile includes this line:
source ~/.profileThe result of that is that bash reads ~/.bashrc => reads ~/.profile => reads ~/.profile => reads ~/.profile => reads ~/.profile etc. This is called an endless loop. Eventually, it freaks out and crashes.
Removing the source ~/.profile line from your ~/.profile should set everything back to normal.
For mayank
"Removing the source ~/.profile line from your ~/.profile" means just searching for the files ~/.bash_profile, ~/.profile, ~./bashrc, ~/bash_login, /etc/bash.bashrc and /etc/profile (as mentioned in comment), opening them and removing the line:
source ~/.profileor
#[[ -s "$HOME/.profile" ]] && source "$HOME/.profile FYI: '~' is not a strange symbol, it just means your home directory. so its basically the path of .profile file.
Its HOME_DIRECTORY/.profile.