0

Every time I open terminal, I got this. How to close the first two lines?

bash: /home/qinlong/.bashrc: line 2: syntax error near unexpected token `('
bash: /home/qinlong/.bashrc: line 2: `export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}# ~/.bashrc: executed by bash(1) for non-login shells.'
qinlong@qinlong-Precision-7820-Tower:~$ 
qinlong
  • 103
  • 4
  • Could you please explain why you have CUDA (assuming this is NVIDIA's GPU programming toolkit) under /usr/local/ instead of in a normal library directory? Or is this a different library with the same name that you are developing? – Tsundoku Mar 28 '19 at 16:12
  • See also setting LD_LIBRARY_PATH for CUDA; look especially at using /etc/ld.so.conf.d/ instead of setting the variable LD_LIBRARY_PATH. – Tsundoku Mar 28 '19 at 16:42

1 Answers1

0

edit your .bashrc with the following :

gedit .bashrc

the line 2 export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} looks like it is wrong.

if you wish to use this line you'll need to correct the shell syntax error. (if you cannot fix the syntax error on your own you can add lines 1-5 of your .bashrc to your original question).

If you cannot see why it is there or do no remember installing CUDA, you can simply remove the line.

save the file and run :

source .bashrc

this will fix it.

the messages you were getting were quite explicit, they are telling you what file has an error and where.

the reason why this is happening everytime you open a new terminal window/tab is because the .bashrc file, located in your home folder, is the "settings for this session's bash" file.

It is what bash loads as it's current configuration when you open a terminal. (files that start with a "." are hidden files. When in a folder, if you want to enable viewing hidden files, press CtrlH, the same combination will hide them again)

tatsu
  • 3,107