Ubuntu Linux: How to reconfigure X windows system (X.org server)

by on June 22, 2006 · 12 comments· LAST UPDATED May 15, 2007

in , ,

Q. I had messed up my Ubuntu Linux X windows configuration by editing files. Now all I want is my default settings back to previous state. How do I reconfigure X.org windows system?

A. You need to use dpkg-reconfigure command which reconfigures packages after they have already been installed. Pass it the names of a package or packages to reconfigure. It will ask configuration questions, much like when the package was first installed.

Ubuntu reconfigure xorg

Type any one of the following command to reconfigure X.org windows system:
As the root user:
# dpkg-reconfigure xserver-xorg
OR as a normal user:
$ sudo dpkg-reconfigure xserver-xorg
Just follow on screen questions and you should able to restore or reconfigure to previous state.

See also:

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 11 comments… read them below or add one }

1 Borys Marcelo January 4, 2008 at 2:27 pm

Thanks!

I put this also in my blog so that more users can find a solution faster.

Reply

2 Darkxnes April 26, 2011 at 10:53 pm

Delete /etc/X11/xorg and done

Reply

3 Olivia Cond January 5, 2008 at 5:16 am

sudo dpkg-reconfigure -phigh xserver-xorg
for automatic configuration

Reply

4 Hamed February 4, 2011 at 11:56 am

I have a problem with the w window, when I power on my PC, and after progressing ubuntu logo, there will appear a blue screen with the gray screen in it(SYSTEM CONFIGURATION,select language).
I lost my X window. I use the sudo dpkg-reconfigure -phigh xserver-xorg but it did not work and got me this
debconf: DbDriver “config”: /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable

what should I do?
Hamed

Reply

5 Matthew Lye March 24, 2009 at 11:44 pm

I would avoid using the -phigh setting as it can cause problems. The autodetect is no good if you originally did anything other than click next next next on the configuration part of the Ubuntu install (other than the partitioning).

Reply

6 Héctor Mamani March 29, 2009 at 4:08 pm

Hi, in my case sudo dpkg-reconfigure -phigh xserver-xorg was sucessfull I have puppy linux runnig as frugal, My sin was to try to set the audio controls from Puppy…

Reply

7 Nima December 22, 2010 at 7:13 pm

Just wanted to say thanks for this great share… It really saved my day, i was about to renistall my OS because of xorg problem.

Reply

8 Ejendra kumar February 27, 2012 at 11:00 am

Hi, in my case with BOSS Linux ver. 3 sudo dpkg-reconfigure xserver-xorg then sudo startx was sucessfull I have BOSS linux running smoothly but I have to do it on every startup, how can I set it permanently anyone plz help, My sin was to set the Display card setting which I have to do by above sudo in command line mode. now plzzzzzzzzzz help to do it fix permanently to avoid again and again.

Reply

9 Surajit Bhakta April 24, 2012 at 2:02 pm

I can not login into my graphical interface. Whenever I hit login after giving password, it goes blank for a few second and returns me the same screen again with no error. I’m using ubuntu 11.04 64bit. My system is running fine on tele-terminal, but can not get into the graphical terminal.
I don’t know what I did to my system. I have a ATI HD 6770 gpu in my desktop and perhaps I tried to use xbmc from their repository. I have now uninstalled xbmc from my system fully, but it didn’t solve my problem. I tried to reconfigure the xserver, gdm; but nothing works.
Please help me, otherwise I have to make a fresh install of my system.

Reply

10 Matias Colli January 31, 2014 at 5:48 pm

Another solution is:
# X -configure
and then copy the new configuration into /etc/X11/xorg.conf (replacing this file)
__
Matias Colli
Perito Informático Forense
M.N A-128 COPITEC

Reply

11 L Pingel April 22, 2014 at 3:06 am

Thankyou for this solution. I have a laptop that has bios administrator password set. The prevents booting from flash or DVD for traditional install. I cloned a hard drive on another Ubuntu system then used dpkg-reconfigure to get it to work properly.

Reply

Leave a Comment

Tagged as:

Previous Faq:

Next Faq: