startx error when setting up X server on archlinux

54,327

Solution 1

Here's what I'd do: Run ldd /usr/bin/Xorg

You should get a line that looks like this:

libz.so.1 => /usr/lib/libz.so.1 (0xb7357000)

If ldd claims that it can't resolve what file libz.so.1 is in, then uninstall and reinstall zlib:

pacman -R -f zlib 
pacman -S zlib

If ldd can find a specific libz.so.1, then check to see if that file constitutes a broken symbolic link:

ls -l /usr/lib/libz.so.1

(Or whatever ldd told you that libz.so.1 resolves to).

On my Arch boxes, /usr/lib/libz.so.1 is a symbolic link of libz.so.1.2.6. If /usr/lib/libz.so.1 links to some weird place, like a home directory, track down why - that shouldn't happen.

Ensure that whatever file that ldd resolves libz.so.1 to actually exists, and has contents. I get this:

% file libz.so.1.2.6
libz.so.1.2.6: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=0xb32fb568a025a99ed67220243b487b93ae8ef948, stripped

If the link exists, but the linked-to libz.so.1.2.6 doesn't exist, perhaps you can do the two pacman command sequence above and get everything back. I guess I'd advise against just doing the two pacman commands, until you understand what's going on. Something must have changed, unless this is a new installation, and somehow the zlib package didn't get installed.

Solution 2

Upon executing startx in the terminal, I got an identical error message. I fixed it bypacman -Sy zlib, which updated the zlib package. That fixed it for me. I'm very new to arch however, so this may not be the best solution.

Share:
54,327

Related videos on Youtube

Aby James
Author by

Aby James

Updated on September 18, 2022

Comments

  • Aby James
    Aby James over 1 year

    I am trying to install X on my archlinux home desktop. I get this error when trying to start it (startx/xinit):

    [root@computer ~]# startx
    xauth: file /root/.Xauthority does not exist
    xauth: file /root/.Xauthority does not exist
    
    /usr/bin/X: /usr/lib/libz.so.1: version 'ZLIB_1.2.5.2' not found (required by /usr/lib/libfontenc.so.1)
    xinit: giving up
    xinit: unable to connect to X server: Connection refused
    xinit: server error
    

    I googled around and asked in #archlinux irc, but couldn't resolve the issue.

    • Admin
      Admin about 12 years
      useradd -m -g users -G audio,lp,optical,storage,video,wheel,games,power,scanner -s /bin/bash username cp /etc/skel/.xinitrc ~/.xinitrc create a user and add that user to the default groups and do a startx. don't start x with root. Try if that works.
  • G-Man Says 'Reinstate Monica'
    G-Man Says 'Reinstate Monica' over 8 years
    How does an echo command help?  Did you mean to say >> ~/.xinitrc?