.bashrc: shopt: not found

Solution 1:

The output you just posted indicates that you aren't actually running bash. This is why you are getting errors sourcing .bashrc.

To fix this problem, you need to check your login shell to make sure it's actually set to bash:

chsh -l

will list the available shells, and

chsh -s /path/to/bash

will change your login shell to bash.

Then logout and log back in.

Solution 2:

shopt is a bash builtin, not a standalone executable, so source won't work. That's why you're getting that error. What are you trying to accomplish?

Solution 3:

This problem occurs when you source your bashrc file from other shells (like zsh). Make sure this line is not present in your current shell's rc file

source ~/.bashrc

To check current shell, execute:

echo $SHELL