I am facing a problem with my terminal (Ubuntu 12.04 LTS) . I was making some changes in the /bin/bash , but I have keeped a backup of .bashrc in case of something went wrong. Anyway today I have tried to open my Terminal and the following message appeared:

There was an error creating the child process for this terminal Failed to execute child process "/bin/bash" (Too many levels of symbolic links)

What can I do in order to fix this problem or how can I reset my Terminal to defaults ??

Thanks In advance

Recommended Answers

All 5 Replies

I think you should use following script like:

!/bin/bash

XLIB_SKIP_ARGB_VISUALS=1 /opt/softwaresname/abaqus cae
You can also create the launcher using the following command:

bash -c 'XLIB_SKIP_ARGB_VISUALS=1 /opt/softwaresname/abaqus cae'
Setting environment variables before the executable file name in a command line is a feature of CLI (Command Line Interface) shells. If you put VARIABLE=value /path/to/executable in a launcher, the program that reads the launcher (and effectively launch the executable) will try to find a file named "VARIABLE=value" and, of course, will fail.

That command launches bash, the default user shell in Ubuntu, and tell it to execute (the -c option) the string "XLIB_SKIP_ARGB_VISUALS=1 /opt/softwaresname/abaqus cae", so it will be interpreted like it is when you type that in the CLI.

If you only changed the file .bashrc, why don't you simply restore the backup to see if it works ?

If following Gribouillis's doesn't solve the problem:

If you can get to any terminal of any sort (chrooting's awesome for moments like these) then run ls -l /bin/bash to see if that's a symlink and what it's pointing to.

An error like "too many levels of symbolic links" means that you must have a recursive (i.e., circular) set of symlinks. In other words, you must have created a symlink (maybe for .bashrc or /bin/bash) which directly or indirectly refers back to itself. When that happens, the OS follows the symbolic links which go round and round in a circle, until the OS reaches a limit on how far it will keep doing that. The main reason for this limit to exist is for this particular situation (circular symlinks), because it could cause the kernel to hang indefinitely (infinite loop) if there was no limit.

Now that you understand what the problem is, there is a good chance you already know what you did wrong.

If not, try to investigate what symlinks you have created (intentionally or not) surrounding .bashrc and /bin/bash (two things that you should not mess with!).

If you have trouble reaching a usable terminal because of this, here are some tricks, off the top of my head:

1) Boot into the root shell. This shouldn't use your user account's .bashrc file. The disadvantage is that this environment kind of crude (no GUI at all).
2) You can install an alternative shell and use that one instead of bash. Most of them are nearly identical to bash, but shouldn't use the .bashrc file or the /bin/bash program.
3) Create a new user account (throught the Ubuntu system setting menus) with sudo-privileges. Log-in with that user-account and open a terminal. This should avoid using the "corrupt" .bashrc file.
4) Boot into a live CD/USB and use the terminal in there, which will use the original /bin/bash from the LiveCD and the default .bashrc (if any) from there as well. This will allow you to navigate and manipulate your installation's file system.

I'm not sure too many levels automatically means circular links. There are various limits for the number of levels.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.