I can’t log in after updating. Now when I start my laptop and try to log in, it loops back to the log in screen with an “authentication error”, with some components of the log in screen frozen.
The guide talks about adding lines to a file called “.profile”. I didn’t have such a file so I created one and added the required lines. I also added the lines to “.bash_profile” just in case, since apparently some systems default to reading that instead? Anyway, I got adb working, so I didn’t think much of it after that, but apparently these files might have something to do with the login process?
On the login screen I pressed crtl+alt+f3 to get to tty and logged in as root. Then I tried to find both “.profile” and “.bash_profile” with the “ls -a” command but neither were there. Then I tried to log in with my user in the tty and do the same thing, but it threw an error something like “bash: ls: command not found”.
In TTY2/3/4 when you log in with your user id, give the following command
$ /usr/bin/printenv.
Look for the value of PATH. It should have the following values /usr/local/sbin:/usr/local/bin:/usr/bin
If it has more than this, i.e. there are entries apart from the ones mentioned above, then also it is fine. But if the entries mentioned above are not there then you have an issue. You might have to look at file /etc/profileand files inside the directory /etc/profile.d. Do not modify any of the files present in /etc/ by hand unless you know what you are doing.
It is not clear what command that you used to find the .profile file but see if the following command helps you turn up something.
$ sudo find / -name “*profile” -type f -print
If you are not using sudo but something else like doas or something else, then use that. If your user does not have sudo capability or is not part of the wheel group, then log into TTY with root user and then try out the above command.
Do not delete the .profile file or delete the contents of .profile file that you find but rename it to say .profile.old or something else. Then reboot and see if it solves the problem. Before rebooting copy the path of the .profile file that you have renamed. Use a pen and paper or another device like your phone or whatever you have. Do not do this for all the .profile files in a single go but do it for one file, reboot and see if resolves the issue. If not then repeat. It will be tedious but will help. Again do not touch anything inside /etc directory unless you know what you are doing.
If you log in as root, you’ll have a different home directory. You’ll need to go to your home cd /home/<Your User Name> before looking for them. If you already did that, then ignore me.
So I renamed “.profile” to something else, and also edited “.bash_profile” to remove the changes I made (I saved the old/broken “.bash_profile” with a different name). After editing “.bash_profile” I was able to log back in.
Also here are the contents of my old “.profile” and “.bash_profile” files (also to be clear, I didn’t have a “.profile” file originally, I created one when setting up adb. I origianlly only had “.bash_profile”)
.bash_profile
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
if [ -d "$HOME/adb-fastboot/platform-tools-latest-linux/platform-tools" ] ; then
export PATH="$HOME/adb-fastboot/platform-tools-latest-linux/platform-tools"
fi
.profile
if [ -d "$HOME/adb-fastboot/platform-tools-latest-linux/platform-tools" ] ; then
export PATH="$HOME/adb-fastboot/platform-tools-latest-linux/platform-tools"
fi
Not sure what I did to break my login, also I’m not sure what the Lineage os and/or adb devs want the user to do if they don’t originally have a “.profile” file? I guess editing “.bash_profile” at least is a bad idea. Also I did get adb to work so I guess I did something “right” XD
@BendTheKnee Thanks yeah that’s probably a better idea.