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

Posted on in Categories , , , last updated May 15, 2007

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:

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Share this on (or read 12 comments/add one below):

12 comment

    1. 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

  1. 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).

  2. 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…

  3. 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.

  4. 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.

  5. 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

  6. 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