≡ Menu

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

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:

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 11 comments… add one }

  • Borys Marcelo January 4, 2008, 2:27 pm


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

    • Darkxnes April 26, 2011, 10:53 pm

      Delete /etc/X11/xorg and done

  • Olivia Cond January 5, 2008, 5:16 am

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

    • Hamed February 4, 2011, 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?

  • Matthew Lye March 24, 2009, 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).

  • Héctor Mamani March 29, 2009, 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…

  • Nima December 22, 2010, 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.

  • Ejendra kumar February 27, 2012, 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.

  • Surajit Bhakta April 24, 2012, 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.

  • Matias Colli January 31, 2014, 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

  • L Pingel April 22, 2014, 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.

Leave a Comment