While installing Oracle database I was getting this error. I searched various blogs and forums and found out many solutions but lastly I got one solution which worked for me.
But well I will post all the possible ways which you can try (as per my knowledge) to overcome this issue.
Specify the display protocol by logging into the user account you are getting the error
Solution 3 (which worked for me)
Login to the user account where you are getting the above error
The best way to check whether your Xlib display protocol is working or not is by using xclock command
After running this command you should see a small clock on your screen.
In case the above solution does not work
Login as root
Now copy the above output and su to the user you are facing issue
Now test if your DISPLAY is working
You should get a small clock output on the screen