There can be various reasons why the .bashrc file is not loaded at Ubuntu startup. Here are some possible causes and their solutions:
-
The
.bashrcfile does not exist or has been accidentally renamed: Check that the.bashrcfile exists in the user's home directory and that the file name is correct. If the file has been accidentally renamed, rename it back to.bashrc. -
The
.bashrcfile does not have the correct permissions: Check that the.bashrcfile has the correct permissions to be executed. Use the commandls -l ~/.bashrcto display the file's permissions and make sure that the current user has read and execute permissions on the file. -
The
.bashrcfile contains syntax errors: Check that the.bashrcfile does not contain syntax errors. You can use the commandbash -n ~/.bashrcto check the file's syntax and detect any errors. -
The
.bashrcfile has not been loaded in the Bash configuration file: Check that the.bashrcfile has been added to the Bash configuration file (~/.bash_profileor~/.bash_login). If the Bash configuration file does not exist, create a new file and add the following line:bashsource ~/.bashrcAlternatively, you can add this line to the
.profilefile in the user's home directory. -
The Bash configuration file has been modified: Check that the Bash configuration file (
~/.bash_profileor~/.bash_login) does not contain any other instructions that prevent the.bashrcfile from being loaded. For example, there might be a line in the configuration file that exits the script without loading the.bashrcfile.
In my case it was sufficient to delete .profile in the user's directory.