Rover12421's Blog

The End.

Ubuntu 12.04关于libgl1-mesa-glx:i386安装的问题

        打算封装一个集成Android开发环境的Ubuntu 12.04的LiveCD.在安装Android源码环境的时候遇到了其他人一样的问题, libgl1-mesa-glx:i386 装不上.我用的是12.04.2的iso.下面是安装信息:

shaka@Shaka:~$ sudo apt-get install libgl1-mesa-glx:i386
Reading package lists… Done
Building dependency tree       
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
 libgl1-mesa-glx:i386 : Depends: libglapi-mesa:i386 (= 8.0.4-0ubuntu0.6)
                        Recommends: libgl1-mesa-dri:i386 (>= 7.2)
E: Unable to correct problems, you have held broken packages.
shaka@Shaka:~$ sudo apt-get install libgl1-mesa-dri:i386
Reading package lists… Done
Building dependency tree       
Reading state information… Done
The following packages were automatically installed and are no longer required:
  x11-apps x11-session-utils x11-xfs-utils xinit
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
  libdrm-nouveau1a:i386 libllvm3.0:i386
Suggested packages:
  libglide3:i386
The following packages will be REMOVED:
  libgl1-mesa-dri-lts-quantal libgl1-mesa-dri-lts-quantal:i386 libxatracker1-lts-quantal ubuntu-desktop xorg xserver-xorg-lts-quantal
  xserver-xorg-video-all-lts-quantal xserver-xorg-video-vmware-lts-quantal
The following NEW packages will be installed:
  libdrm-nouveau1a:i386 libgl1-mesa-dri:i386 libllvm3.0:i386
0 upgraded, 3 newly installed, 8 to remove and 0 not upgraded.
Need to get 10.5 MB of archives.
After this operation, 12.4 MB of additional disk space will be used.
Do you want to continue [Y/n]? 

        当我们安装libgl1-mesa-glx:i386的时候,他提示依赖 libgl1-mesa-dri:i386, 那我们就先装这个 libgl1-mesa-dri:i386.等等.这里先别着急,看看REMOVED选项,他要把带quantal的对应包全部卸载?
看到quantal我就想到了quantal内核,12.10已经使用改内核,而ubuntu 12.04.2之后的iso(好像12.04.2的有两个镜像,前期的一个是没升级到 quantal内核的)镜像也升级到这个内核了.这个内核的很多包有个特点,都是加quantal后缀的.如果看过Ubunt 12.04内核升级到3.5.0-23的文章就会有所了解. How can I upgrade the Ubuntu 12.04.2 kernel to 3.5.0-23?
        既然知道了这些,那说明我们要安装的并不是 libgl1-mesa-glx:i386,而是要安装对应的quantal版本,查了下,对应的名字是:libgl1-mesa-glx-lts-quantal:i386.
        然后看看/usr/lib32/mesa/libGL.so.1是否存在,存在说明已经安装好了,按照Android官方说明,加一个软链接就行了:

sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so

        -–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–-–

        2013-12-30:
        发现我机器上没的 /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so 这两个文件,编译android压根就没问题.看来这个软链接不是必要的
sudo find /usr/ -name libGL.so*
/usr/NX/scripts/vgl/libGL.so
/usr/lib/fglrx/libGL.so.1.2
/usr/lib/fglrx/libGL.so
/usr/lib/fglrx/libGL.so.1
/usr/lib/i386-linux-gnu/libGL.so
/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2
/usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/libGL.so
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2
/usr/lib/x86_64-linux-gnu/mesa/libGL.so
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib32/fglrx/libGL.so.1.2
/usr/lib32/fglrx/libGL.so.1

        周末折腾,把内核升级到3.5了,发现已经不是quantal的内核了,安装的mesa又是 libgl1-mesa-glx:i386 了.所以具体安装那个得看内核,装对了就行了.用apt-get安装有提示卸载的时候要特别注意了.

Comments