0

I was trying to install flutter on my Linux Mint last night and in the process of adding it to my eviroment variable I think I messed up things: this morning, while trying to login to my desktop, it seems like am stuck at the login screen even though I provided the right password to my PC.

This got me browsing through the internet and was directed to use the login shell terminal, but while trying some of their help tips I discovered that I can't access sudo, nano, rm because my /usr/bin/ is not included in my PATH enviroment variable ... Please I urgently need you gucies help. Thank you.

7
  • 1
    Regardless of your PATH, you should be able to use absolute paths to programs ex. /usr/bin/sudo, /bin/rm and so on Feb 29 '20 at 14:04
  • Steeldriver thanks for responding to my issue, but please using the command you provided to me what should I do next after running the command....?
    – Gabriel J
    Mar 2 '20 at 7:19
  • Unless you can be more specific than "in the procss of adding it to my eviroment variable i think i messed up" t's hard to be more specific than "revert the changes you made" Mar 2 '20 at 12:08
  • Ok! Then please how can I revert the change I made while trying to add flutter to my enviroment variable...Thank you sir!
    – Gabriel J
    Mar 2 '20 at 14:56
  • We don't know what "change you made" or which file(s) you edited - only you know that Mar 2 '20 at 15:26
1

Your problem could definitely be the PATH variable.

Temporarily setting the path variable for the current shell session:

export PATH=/usr/sbin:/usr/bin:/sbin:/bin

After that you should be able to access all commands and move on with recovering your PATH.

The problem is, we don't know which changes you have made. But in general the path is defined in all of the following files (sourced in descending order):

Globally:

  • /etc/environment
  • /etc/profile

Per user:

  • ~/pam_environment (if you are using pam)
  • ~/.profile
  • something shell specific like ~/.bash_profile or application specific ~/.xinitrc

Because you lightdm is affected it seems you changed the path globally. Does something of the files sounds familiar? If yes, revert your changes there. Otherwise you could check each on of those files if you overwrite the path variable.

Maybe you did something like PATH=/opt/flutter. Always do PATH=${PATH}:/opt/flutter to include the rest of the path instead.

If you made changes you can check your path variable and environment with printenv and echo $PATH after a new login.

3
  • Thanks sir for your help, but I have fixed the issue deploying other methods.
    – Gabriel J
    Mar 3 '20 at 8:49
  • Okay. the problem you described in your answer is the exact same which is described here. Just the method of fixing is different. The describe method in this answer will work too. Nevertheless you should mark your question as solved.
    – Maze
    Mar 3 '20 at 11:22
  • OK! Thanks I will do that right away!
    – Gabriel J
    Mar 3 '20 at 11:32
0

If you tried installing a software on your Linux mint 19.2 and during the process of adding it to your environment variable you messed up the environment, you're now unable to login to your desktop due to your previous activity on the .profile file. This results in an invalid PATH and you havn't access to sudo, rm etc.

Then you can simply follow this four(4) steps in fix the Linux mint 19.2 login loop.

  1. Restart your operating system and press and hold down the Shift key(button on your keyboard) open Grup ui.

  2. Select the second option provided to you with the bracket content (recovery mode).

  3. Select the root option provided to you in the recovery mode ui.

  4. In terminal provided to you at the bottom of the recovery mode, you can enlarge the terminal by running clear. Then run the following command: sudo edit /etc/profile This command should display or open the .profile content to you, all you need do is to remove the content you added to the file before this login loop issue prompted and save the file by pressing Ctrl+x and hitting the enter button on the keyboard and exit the terminal by typing exit. This command will return you back to the recovery mode ui. Select the resume option among the provided and enter your password on the login screen. Hopefully this should fix your Linux mint login loop issue.

Not the answer you're looking for? Browse other questions tagged or ask your own question.