This can occur if your DISPLAY variable is not properly set, or the user who is running the installation is not completely authorized to open the X window. For example, if you use the su command to change from the user who is authorized to open the X window to the user account which is not authorized to open the X window on your display.
To resolve this issue, you need to run the below command:
To make sure that your display variable is properly set to a correct visual or to a correct host. If your display variable is set correctly then either make sure that you are logged in as a user authorized to open the X window, or use xhost + to allow any user to open the X window.