LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   how can I fix my .profile file when I login (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/how-can-i-fix-my-profile-file-when-i-login-4175672928/)

drawa54 04-10-2020 09:23 AM

how can I fix my .profile file when I login
 
I cannot login.

The last thing I did was to add a line of code to my .profile file.

On booting up I get the following message when I try to login, "Your session only lasted less than 10 seconds....Try logging in with one of the failsafe sessions to see if you can fix this problem."
I tried this and:

dpkg - Repair packages - none broken
grub - updated bootloader successfully
Then pressed resume but got very dark grey screen...waited for 5 minutes then forced shutdown.
On booting again the same problem. Not able to login.

The issue is with a laptop which is not the one I'm using now.
The laptop I'm asking help for is running Linux Mint 18.x The HD has about 100 GB of free space. There is no other OS installed. All packages are up to date.

sevendogsbsd 04-10-2020 09:29 AM

So you were able to login prior to adding something to your .profile? Can you login as root and remove the offending line then change file ownership back to your user and login? Not sure if Mint has root login: been years since I used it. Worse case, boot to a live CD/USB and mount your /home then edit the file that way.

uteck 04-10-2020 09:43 AM

If you are using something without a password for root, you can reboot and try the recovery boot option in grub to start a single user session as root. Once you change the file, make sure to set the owner back to yourself since it will get changed to root after you save the edit.

If there is no recovery option, you will need to edit grub to boot single user mode.

ondoho 04-11-2020 04:07 AM

Quote:

Originally Posted by drawa54 (Post 6109959)
The last thing I did was to add a line of code to my .profile file.

On booting up I get the following message when I try to login, "Your session only lasted less than 10 seconds....Try logging in with one of the failsafe sessions to see if you can fix this problem."

It's all very clear to me:
- login with a failsafe session
- fix your ~/.profile

drawa54 04-11-2020 09:56 PM

Solved
 
sevendogsbsd - Thank you. I tried your suggestion of using live USB first and it worked for me. I was able to delete the line of code in the .profile file. (I had added a path to my python ENV with an error.) Than you again.

And thanks to utech and ondoho for your replies.


All times are GMT -5. The time now is 03:57 AM.