I upgraded Ubuntu to 21.04.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 21.04
Release: 21.04
Codename: hirsuteNow when I open a terminal from the file explorer and open a new tab using Ctrl+shift+t I get the following message in the terminal:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.After this, if I try to use "cd" I get the following error:
$ cd
bash: cd: HOME not setHas anyone had similar problems or know why this is happening? I have never had issues like this before.
Solution:Bug in gnome-terminal 3.38.1, should be fixed in 3.38.2 See vanadium's answer.
Suggestions tried:
$ env | grep HOMEWorking tab:
HOME=/home/vackraetraedFailing tab:
$ grep vackraetraed /etc/passwdWorking tab:
vackraetraed:x:1000:1000:My name,,,:/home/vackraetraed:/bin/bashFailing tab:vackraetraed:x:1000:1000:My name,,,:/home/vackraetraed:/bin/bash$ whoamiWorking tab:
vackraetraedFailing tab:
vackraetraedCopy system default files to user:
$ cp -r /etc/skel/.bashrc ~ ; cp -r /etc/skel/.profile ~- Issue persists
Try the issue with a new temp user login
- No instructions on how to run as root when tab opens
- 'cd' still does not work
1 Answer
You may be facing a bug: Env vars differ in first and second terminal of which this (in second tab, err happend when run cd: bash: cd: HOME not set) is a duplicate. It is a design issue with the systemd --user / d-bus activation environment. In Gnome Terminal 3.38.2, that issue should be "fixed" with a patch that copies over the environment of the first tab. Unfortunately, as of today (2021-09-08), gnome-terminal is still at 3.38.1.
For other users observing strange issues with terminal output, it may be due to a misconfiguration with the .profile or .bashrc configuration files. Take a look at them and correct them. Else you may want to revert to the system default files over to your user configuration. Copy the original files to a backup copy in case you want to revert to them:
cp ~/.bashrc ~/.bashrc_bak ; cp ~/.profile ~/.profile_bakand then copy the system default files to your profile:
cp -r /etc/skel/.bashrc ~ ; cp -r /etc/skel/.profile ~Log out then back in before testing if the issue is resolved.
11