Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was following the instructions on section 3.2 of this page.

Everything went well until step 8, which is to use sudo amdconfig --initial to create a new xorg.conf file, but I get the following error:

amdconfig: error while loading shared libraries: wrong ELF class: ELFCLASS32

I tried creating the file /etc/ with /usr/lib32 inside, as the second answer here suggested, and ran sudo ldconfig but nothing changed.

EDIT: Installed libgl1-mesa-glx:i386 and ran sudo ldconfig, and problem persisted even after rebooting.

EDIT2: Since step seven of the first link, after rebooting my top and side panels of unity and also the dash are missing, but I'm assuming this will be fixed when I finish the drivers installation.

EDIT3: Same error happens with fglrxinfo and glxinfo command (before following step 7 glx info was normal).

EDIT4: output of lspci -v | grep -A10 VGA (complete output)

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller])
    Subsystem: Dell Device 0572
    Flags: bus master, fast devsel, latency 0, IRQ 45
    Memory at c1000000 (64-bit, non-prefetchable) [size=4M]
    Memory at b0000000 (64-bit, prefetchable) [size=256M]
    I/O ports at 4000 [size=64]
    Expansion ROM at <unassigned> [disabled]
    Capabilities: <access denied>
    Kernel driver in use: i915
01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Chelsea LP [Radeon HD 7730M] (prog-if 00 [VGA controller])
    Subsystem: Dell Device 0572
    Flags: bus master, fast devsel, latency 0, IRQ 16
    Memory at a0000000 (64-bit, prefetchable) [size=256M]
    Memory at c0000000 (64-bit, non-prefetchable) [size=256K]
    I/O ports at 3000 [size=256]
    Expansion ROM at c0040000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: fglrx_pci

EDIT: output of dpkg -S

       libgl1-mesa-glx:amd64: /usr/lib/x86_64-linux-gnu/mesa/
       libgl1-mesa-glx:amd64: /usr/lib/x86_64-linux-gnu/mesa/
share|improve this question
up vote 9 down vote accepted

The problem that we solved by commenting was that you were using 32-bits libraries in a 64-bits system.

wrong ELF class: ELFCLASS32

The ending of the class should have been 64, hence producing this error. The way to go is purging the 32-bits libraries then reinstalling the 64-bits.

sudo apt-get purge libgl1-mesa-glx:i386
sudo apt-get --reinstall install libgl1-mesa-glx

And refreshing our GNU linker:

sudo ldconfig

Once everything is ok, ldconfig -p | grep should show: (libc6) => /usr/lib/x86_64-linux-gnu/mesa/ (libc6) => /usr/local/lib/

If you ever need the 32-bits libraries for running 32-bits applications, you could do so installing the libgl1-mesa-glx:i386 package. But in this case remember to setting your LD_LIBRARY_PATH temporally to where the 32bits libraries are, so it won't mess up your other programs.

 export LD_LIBRARY_PATH="/path/to/library/"
share|improve this answer

I was suffering all of a sudden the same problem after a kernel update. I was unable to login into the graphical interface. Running the "aticonfig" command I got this Error and I found it in the Xorg.0.log as well. I am running a Debian Jessie 64bit System with 32bit libraries for software like wine and skype. Removing the "libgl1-mesa-glx:i386" Package did uninstall skype and wine32 as well and it did not solve the issue.

I found that the AMD Driver Installer creates a wrong link to the 32bit library out of a misinterpretation of the System Architecture although it did apparently recognized the Architecture correctly within the Installer program.

Running the localization command for the library might give you the following information:

# find / -name*

But you will find that the Standard Libraries of the System in "/usr/lib" do link to library versions in "/usr/lib/i386-linux-gnu/" what makes the 32bit version of the library the default version. This link is created by the AMD Driver Installer out of a misinterpretation of the System Structure. This mistake comes from having a "/usr/lib64/" directory in the System. A 64bit System does not have a "/usr/lib64/" folder because all 64bit versions of the libraries are located in "/usr/lib/". So the Installer mistakes the System for a 32bit System and creates the link to the 32bit version of ""

How can you fix it? - First run the uninstaller of the driver in "/usr/share/ati"

# ls -lah /usr/share/ati
-rw-r--r--   1 root root 2,4K oct 19 20:51 fglrx-install.log
-rwxr--r--   1 root root  18K oct 19 20:51

This will remove all wrong links.

Even after this step I was already able to get a graphical login with a warning for not having the Propertary Driver.

  • Next you rename you "/usr/lib64/" directory to disable it.
    # cd /usr
    # ls -lah
    drwxr-xr-x 182 root root   40K oct 19 20:50 lib
    drwxr-xr-x   5 root root  4,0K oct 19 20:40 lib64
    # pwd
    # mv lib64 lib64_2015-10-19
    # ls -lah
    drwxr-xr-x 182 root root   40K oct 19 20:50 lib
    drwxr-xr-x   5 root root  4,0K oct 19 20:40 lib64_2015-10-19
  • Then you go back to you AMD Driver Installer and run it again.

Now you will find that correct link to the 64bit version of was created.

# ls -lah /usr/lib/
lrwxrwxrwx 1 root root 33 oct 19 20:50 /usr/lib/ -> /usr/lib/fglrx/

Now you might be able to get a Graphical Login again as normal.

share|improve this answer

Instead of editing the file directly, create a file called local.conf in the subdirectory /etc/ containing just the line /usr/local/lib. That is,

Contents of /etc/


Then run the ldconfig command. (This assumes that the file /etc/ contains the line include /etc/*.conf.)

You only have to do this once.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.