[SOLVED] how can I fix my .profile file when I login
Linux - Laptop and NetbookHaving a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
Distribution: Ubuntu based stuff for the most part
Posts: 1,176
Rep:
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.