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 go this post,
Unfortunately, you doesn’t able to run your terminal then only follow this post.
You need to delete that laggy temporary files in tmp directory for running your system. So make any bootable live usb and insert it in your system. I am using Linux mint for doing this. Right now you able access the terminal.
- Make Bootable Linux Mint USB
- Run Linux Mint
- Delete tmp files
- Reboot your system
Make Bootable Linux Mint USB:
Am already posted a video about How to boot Linux mint in USB in YouTube.
See this video and make a bootable lLinux mint USB.
Run Linux Mint:
Now insert the USB in your system. And run mint in Live mood.
Delete tmp Files:
Right now, you able to open a terminal. So run the following commands for deleting temporary files.
First check the storage usage of 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.
Run the following command for removing tmp files.
mk007@linuxlia:~$ sudo rm -rf /tmp/*
Also remove the files in var/tmp directory. Change the location to /var/tmp in terminal.
mk007@linuxlia:~@ cd /var/tmp mk007@linuxlia: /var/tmp$ ls
Run the following command for removing this files.
mk007@linuxlia:~$ sudo rm -rf /var/tmp/*
Alright, now all the lagy temporary files are removed successfully. Once again check your storage usage.
mk007@linuxlia:~$ df -H
Reboot the system:
Finally reboot your system. In my system the login screen was opened.
If you have any doubts about this post please leave a comment otherwise ping me in Instagram. Am ready to solve your doubts.