Xsession: warning: unable to write to /tmp; exit with an error code
Xsession: warning: unable to write to /tmp; X session may exit with an error.
In this post I give the solution for the xsession warning error in Linux. The steps followed in this post is same to all Linux distributions.
Why this error occurs ?
This error occurs when your tmp directory have not enough space to run the system. In Linux, when you turn on your machine, some important packages are running automatically and creating some temporary files in tmp directory for running.
This files are automatically removed when you close your system. But sometimes it lags because of any malfunction you did in packages. So tmp directory was not able to run the files when you open a system.
So the following error was occurred, when you open your system.
Xsession: warning: unable to write to /tmp: Xsession may exit with an error
After clicking OK I get thrown back to the login screen. Logging in through the console and trying ‘startx’ gives the same thing, only I don’t get a cursor to click the okay button and have to press the power button to reboot.
This error making hyper tension for every Linux users. Because this error was occurred in login screen, so you doesn’t able to access your terminal. This is the only reason to making this error complicated.
Fortunately, you will able to access your terminal then only follow this post.
Unfortunately, doesn’t able to access a terminal then go this blog post,
- Delete tmp files
- Reboot your system
Delete tmp files:
First check the storage usage in your system.
Open a terminal and run the following command.
mk007@linuxlia:~$ df -H
You will notice, in my system tmp directory was full. First of all clear this.
Open a terminal and type the following commend for deleting temporary files in your system.
mk007@linuxlia:~$ sudo mount mk007@linuxlia:~$ df / mk007@linuxlia:~$ sudo tune2fs -c 1 /dev/sdb1
Alright now all the laggy temporary files are removed.
Reboot your system:
Finally reboot your system. In my system the login screen was opened.
Finally Inner peace.
If you have any doubts about this post please leave a comment otherwise ping me in Instagram. Am ready to solve your doubts.