1

Every time I opened my terminal in Ubuntu 18.04, it shows that y: command not found, like this:

Terminal

What to do to solve this problem?

  • 1
    you likely have a shell init script in place that tries to run a command "y". what shell are you running? you should by running bash. – Skaperen Jul 11 '18 at 4:21
  • 2
    Welcome to AskUbuntu! Can you please copy the contents of your .bashrc into the question? It sounds like you may have added an incomplete command. – tu-Reinstate Monica-dor duh Jul 11 '18 at 4:21
  • 1
    did you try to edit any files? – Skaperen Jul 11 '18 at 4:29
  • Please don't post images of text. Instead, paste the text directly into your question and use the formatting tools. – dessert Jul 11 '18 at 5:39
7

This could be caused by a line on the your .bashrc file that says y.

You could remove the offending line by editing the file by using:

gedit ~/.bashrc

Or if you have not modified the file yourself, you could restore the default .bashrcafter taking a backup by running:

cp ~/.bashrc ~/bak.bashrc && cp /etc/skel/.bashrc ~/
| improve this answer | |
  • 2
    or it could have "y " and other stuff that won't matter – Skaperen Jul 11 '18 at 4:24
0

I see this isn't a very recent thread, in my case it was caused by a wrong setting in /etc/environment. The file had been modified during the install of the Oracle DB client libraries (but it might be any other package)...

My problematic /etc/environment was this:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
PATH=/usr/lib/oracle/19.3/client64/lib:$PATH
LD_LIBRARY_PATH=/usr/lib/oracle/19.3/client64:$LD_LIBRARY_PATH

Since we didn't need the Oracle client anymore, for us it was just a matter of deleting the last two lines, reverting it to the original content (after having uninstalled the Oracle client):

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.