Which missing library results in the message '/usr/bin/ld: cannot find -lglib-2.0'? - ld

I am cross compiling a Lazarus program, creating a 32bit program on a 64bit Ubuntu 14.04 Trusty Tahr system, and everything apparently compiles to the very end when I get this messsage
/usr/bin/ld: cannot find -lglib-2.0
What is the full name of the library whose absence results in this error mesage?
libc6-dev:i386 appears to be the most likely library, but when I try to install it with apt indicates build-essential g++ gcc gcc-multilib will be removed so I abort it.
sudo apt-get install libc6-dev:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
linux-libc-dev linux-libc-dev:i386
Suggested packages:
glibc-doc:i386 manpages-dev:i386
Recommended packages:
gcc:i386 c-compiler:i386
The following packages will be REMOVED
build-essential g++ gcc gcc-multilib
The following NEW packages will be installed
libc6-dev:i386 linux-libc-dev:i386
The following packages will be upgraded:
linux-libc-dev
1 to upgrade, 2 to newly install, 4 to remove and 18 not to upgrade.
Need to get 3,126 kB of archives.
After this operation, 12.6 MB of additional disk space will be used.
Do you want to continue? [Y/n]

It turns out it was the libglib2.0-0:i386 package. It was already installed earlier, but it had not been fully configured.
It was present in the /lib/i386-linux directory and I had to create a symlink to it include it to the fpc.cfg configuration file used by Free Pascal.
locate libglib | grep ^/lib produced:
/lib/i386-linux-gnu/libglib-2.0.so.0
/lib/i386-linux-gnu/libglib-2.0.so.0.4002.0
/lib/x86_64-linux-gnu/libglib-2.0.so.0
/lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0
I symlinked it with the expected name:
ln -s /lib/i386-linux-gnu/libglib-2.0.so.0 /lib/i386-linux-gnu/libglib-2.0.so
then added to the Lazarus installations fpc.cfg file
#ifdef cpui386
-Fl/usr/lib32
-Fl/lib/i386-linux-gnu
#endif

Related

Showing a list of software with LGPL during boot

I remember seeing a list of software components with LGPL licenses during the start up of Linux root file system built with Yocto Project. I can't seem to figure out what enables this, even after going through the Mega Manual.
NOTICE: This file system contains the following GPLv3 packages:
autoconf
bash-dev
bash
binutils
cifs-utils
cpio
cpp-symlinks
cpp
dosfstools
elfutils
g++-symlinks
g++
gawk-dev
gawk
gcc-symlinks
gcc
gdb
gdbc6x
gdbserver
gettext-dev
gettext
gzip
libbfd
libcairo-dbg
libcairo-perf-utils
libdw1
libelf1
libgdbm-compat4
libgdbm-dev
libgdbm4
libgettextlib
libgettextsrc
libgmp-dev
libgmp10
libgmpxx4
libidn11
libmpc3
libmpfr4
libreadline-dev
libreadline7
libunistring2
m4-dev
m4
make
nettle-dev
nettle
parted
python3-pycairo-dev
python3-pycairo
which
If you do not wish to distribute GPLv3 components please remove
the above packages prior to distribution. This can be done using
the opkg remove command. i.e.:
opkg remove <package>
Where <package> is the name printed in the list above
NOTE: If the package is a dependency of another package you
will be notified of the dependent packages. You should
use the --force-removal-of-dependent-packages option to
also remove the dependent packages as well
Found my answer - it's from arago-gpl-notice from meta-arago. It only displays GPLv3 also.

Can't install jdk on Fedora with yum nor with rpm

Help! I can't figure out how to install a jdk!
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk-devel"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.7.0-openjdk-devel available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.7.0-openjdk available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.6.0-openjdk-devel"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.6.0-openjdk-devel available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.6.0-openjdk"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.6.0-openjdk available.
Error: Nothing to do
Here I've manually downloaded some rpm's, the last one from oracle's website:
[~]$ rpm -ivh java-1.7.0-openjdk-devel-1.7.0.19-2.3.9.3.fc20.x86_64.rpm
error: Failed dependencies:
java-1.7.0-openjdk = 1:1.7.0.19-2.3.9.3.fc20 is needed by java-1.7.0-openjdk-devel-1:1.7.0.19-2.3.9.3.fc20.x86_64
[~]$ sudo rpm -ivh java-1.7.0-openjdk-1.7.0.19-2.3.9.3.fc20.x86_64.rpm
Preparing... ################################# [100%]
file /usr/lib/jvm-exports/jre-1.7.0-openjdk.x86_64 from install of java-1.7.0-openjdk-1:1.7.0.19-2.3.9.3.fc20.x86_64 conflicts with file from package java-1.7.0-openjdk-1:1.7.0.9-2.3.7.0.fc18.x86_64
file /usr/lib/jvm/jre-1.7.0-openjdk.x86_64 from install of java-1.7.0-openjdk-1:1.7.0.19-2.3.9.3.fc20.x86_64 conflicts with file from package java-1.7.0-openjdk-1:1.7.0.9-2.3.7.0.fc18.x86_64
[~]$ sudo rpm -ivh jdk-7u21-linux-x64.rpm
Preparing... ################################# [100%]
file /etc/init.d/jexec from install of jdk-2000:1.7.0_21-fcs.x86_64 conflicts with file from package jdk-2000:1.6.0_38-fcs.x86_64
Debug
Here's some debug information:
[/usr/lib/jvm]$ yum search jdk
Loaded plugins: langpacks, presto, refresh-packagekit
=========================================================== N/S Matched: jdk ============================================================
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
jdk.x86_64 : Java(TM) Platform Standard Edition Development Kit
ldapjdk.noarch : The Mozilla LDAP Java SDK
Name and summary matches only, use "search all" for everything.
.
[/usr/lib/jvm]$ yum list java*
Loaded plugins: langpacks, presto, refresh-packagekit
Installed Packages
java-1.5.0-gcj.x86_64
.
[/usr/lib/jvm]$ cat /etc/fedora-release
Fedora release 18 (Spherical Cow)
Requirements
I must have "jni.h", "libjava.so", "libhpi.so", "lipverify.so" and "libjvm.so" included.
So far I've found out that these DO NOT have what I need:
Undesired Versions (for sure):
jdk1.7.0_06 <-- I'm surprised about this one, but it doesn't have libjvm nor libhpi
java-1.7.0
java-openjdk
java-1.7.0-openjdk-1.7.0.9.x86_64
java-1.5.0-gcj-4.4
java-1.6.0-openjdk
java-1.7.0-openjdk.x86_64
jre-1.5.0-gcj
jre-1.7.0-openjdk.x86_64
jre-openjdk
jre-1.7.0
jre-7u11-linux-x64.rpm java-1.5.0-gcj-1.5.0.0
jre-1.5.0
jre1.7.0_11
jre-gcj
And these do:
Desired Versions (that I know of, there could be more):
jdk1.6.0_34-x86
jdk1.5.0_22-x86
java-6-openjdk
Can someone help me install jdk1.6 or java-6-openjdk please?
The problem here is that you cannot use the Oracle rpm to install JDK 7 when you already have the Oracle JDK 6 as it tries to install the /etc/init.d/jexec script which is already installed and required for JDK 6.
I would advise sticking to the tarball or self extracting *.bin and using JAVA_HOME if you are going to use the Oracle distribution as it does not have this problem and you will probably not need jexec anyway.
In general I would suggest that you install the Oracle JDK not the OpenJDK. Otherwise you might risk running into some issues. I always found problems of all sorts and sizes with OpenJDK that I don't even bother trying it any more.
Download the JDK RPM from here and follow the usual instructions. Its usually very straightforward and without problems.
Full detailed instructions including how to install it here.
Make sure you choose the right version you need (JDK 1.7 or JDK 1.6, dont mix) because from your question you seem to have a confusion of library versions from 1.5 to 1.7.
And another thing, uninstall whatever you have installed already before installing a fresh one to avoid conflicts.
Check my answer here Transaction check error when installing Sun JDK 7
Basically you may use rpm --force to install one JDK on top of the other. This scenario is completely valid specially when you have to develop for different JAVA versions.
Just faced the same issue. I was not comfortable using --force command; did not want to risk messing-up the existing Java that came installed at system setup.
I ended up doing the following and running the app server with a different version of Java under a different user ID.
downloaded the Java tar.gz version and uncompressed:
tar -zxvf jdk-7u45-linux-x64.gz
Created the directory:
mkdir /usr/java/jdk1.7.0_45
Copied the contents to the new directory manually:
cp -r /.../jdk1.7.0_45/* /usr/java/jdk1.7.0_45
Set the java_home under the user ID home directory in .bashrc and .bash_profile files:
export JAVA_HOME=/usr/java/jdk1.7.0_45
export PATH=$JAVA_HOME/bin:$PATH
export PATH=$PATH:/usr/sfw/lib/gcc:/usr/sfw/bin
sudo rpm -i jdk-11.0.9_linux-x64_bin.rpm
or whatever package you are trying to install

installing ruby 1.9.3 in michael hartl's ruby on rails tutorial

I'm working on Michael Hartl's ruby on rails tutorial http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec-development_tools.
I installed Git, updated my OS to 10.8.2 and downloaded XCode 4.5.2.
when I type in
rvm install 1.9.3
this long thing comes up...
Ruby (and needed base gems) for your selection will be installed shortly.
Before it happens, please read and execute the instructions below.
Please use a separate terminal to execute any additional commands.
Notes for Mac OS X 10.8.2, Xcode 4.5.2.
For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26"
For IronRuby: Install Mono >= 2.6
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba'
For Opal: Install Nodejs with NPM. See http://nodejs.org/download/
To use an RVM installed Ruby as default, instead of the system ruby:
rvm install 1.8.7 # installs patch 357: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems
rvm alias create default 1.8.7
And reopen your terminal windows.
Xcode and gcc:
Right now Ruby requires gcc to compile, but Xcode 4.2 and later no longer ship with gcc. Instead they ship with llvm-gcc (to which gcc is a symlink) and clang, neither of which are supported for building Ruby. Xcode 4.1 was the last version to ship gcc, which was /usr/bin/gcc-4.2.
Xcode 4.1 and earlier:
- Ruby will build fine.
Xcode 4.2 and later (including Command Line Tools for Xcode):
- If you have gcc-4.2 (and friends) from an earlier Xcode version, Ruby will build fine.
- If you don't have gcc-4.2, you have two options to get it:
* Install apple-gcc42 from Homebrew
* Install osx-gcc-installer
Homebrew:
If you are using Homebrew, you can install the apple-gcc42 and required libraries from homebrew/dupes:
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
Xcode 4.2+ install or/and Command Line Tools for Xcode is required to provide make and other tools.
osx-gcc-installer:
If you don't use Homebrew, you can download and install osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer.
Warning: Installing osx-gcc-installer on top of a recent Xcode is known to cause problems, so you must uninstall Xcode before installing osx-gcc-installer. Afterwards you may install Xcode 4.2+ or Command Line Tools for Xcode if you desire.
** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer.
Press 'q' to continue.
~
(END)
Originally I had to get homebrew and
brew install libksba
but I did that already and it works. That leads to "Xcode and gcc:" and everything below it.
So, I have homebrew, and the following three commands work:
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
But when I try
rvm pkg install openssl
this is what happens
Fetching openssl-1.0.1c.tar.gz to /Users/adamzerner/.rvm/archives
Extracting openssl to /Users/adamzerner/.rvm/src/openssl-1.0.1c
Configuring openssl in /Users/adamzerner/.rvm/src/openssl-1.0.1c.
Compiling openssl in /Users/adamzerner/.rvm/src/openssl-1.0.1c.
Error running 'make', please read /Users/adamzerner/.rvm/log/openssl/make.log
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
Updating openssl certificates
Error running 'update_openssl_certs', please read /Users/adamzerner/.rvm/log/openssl.certs.log
And this is what happens when I try what it says...
Adam-Zerners-MacBook-Pro:~ adamzerner$ rvm reinstall all --force
Adam-Zerners-MacBook-Pro:~ adamzerner$
some other information...
I don't see a .rvm folder under adamzerner, so I can't read what it tells me to (not that I would understand what I'd be reading anyway).
It seems that I have 1.8.7 installed:
Adam-Zerners-MacBook-Pro:~ adamzerner$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
So... to summarize... when I try to run
rvm install 1.9.3
I get the gcc/Xcode problem. To fix that it says to download apple-gcc42 from Homebrew. When I do that, I get a problem after doing
rvm pkg install openssl
The problem being that I need to reinstall all rubies. When I do that:
rvm reinstall all --force
it seems that nothing happens.
Thanks in advance to anyone willing to help me with this problem!
EDIT: I forgot to say this before. For the "long thing" up above, when I press q to continue, this is what happens...
Searching for binary rubies, this might take some time.
https://rvm.io/binaries/osx/10.8/x86_64/ruby-1.9.3-p327.tar.bz2 - #configure
ruby-1.9.3-p327 - #download
ruby-1.9.3-p327 - #extract
ruby-1.9.3-p327 - #validate
Libraries missing for ruby-1.9.3-p327: env. Refer to your system manual for installing libraries
Mounting remote ruby failed, trying to compile.
Fetching yaml-0.1.4.tar.gz to /Users/adamzerner/.rvm/archives
Extracting yaml to /Users/adamzerner/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/adamzerner/.rvm/src/yaml-0.1.4.
Error running './configure --prefix=/Users/adamzerner/.rvm/usr', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/yaml/configure.log
Compiling yaml in /Users/adamzerner/.rvm/src/yaml-0.1.4.
Error running 'make', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/yaml/make.log
Installing Ruby from source to: /Users/adamzerner/.rvm/rubies/ruby-1.9.3-p327, this may take a while depending on your cpu(s)...
ruby-1.9.3-p327 - #downloading ruby-1.9.3-p327, this may take a while depending on your connection...
ruby-1.9.3-p327 - #extracted to /Users/adamzerner/.rvm/src/ruby-1.9.3-p327 (already extracted)
ruby-1.9.3-p327 - #configuring
Error running './configure --enable-shared --disable-install-doc --prefix=/Users/adamzerner/.rvm/rubies/ruby-1.9.3-p327 --with-opt-dir=/Users/adamzerner/.rvm/usr', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/configure.log
There has been an error while running configure. Halting the installation.
EDIT: What happens when I follow the github link OliverAtkinson posted
Last login: Wed Dec 26 15:55:12 on ttys000
Adam-Zerners-MacBook-Pro:~ adamzerner$ brew update
Updated Homebrew from 751a0d6e to c67c126c.
==> New Formulae
ume
==> Updated Formulae
akka global markdown ruby slrn
basex gnuplot mu ruby-build ttytter
casperjs gradle qt shiboken vice
cassandra groonga qt5 shocco wine
discount jenkins rakudo-star signing-party xvid
Adam-Zerners-MacBook-Pro:~ adamzerner$ brew tap homebrew/dupes
Error: Already tapped!
Adam-Zerners-MacBook-Pro:~ adamzerner$ brew install autoconf automake apple-gcc42
Error: autoconf-2.69 already installed
Error: automake-1.12.6 already installed
Error: apple-gcc42-4.2.1-5666.3 already installed
Adam-Zerners-MacBook-Pro:~ adamzerner$ brew remove autoconf automake apple-gcc42
Uninstalling /usr/local/Cellar/autoconf/2.69...
Uninstalling /usr/local/Cellar/automake/1.12.6...
Uninstalling /usr/local/Cellar/apple-gcc42/4.2.1-5666.3...
Adam-Zerners-MacBook-Pro:~ adamzerner$ brew install autoconf automake apple-gcc42
==> Downloading http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
Already downloaded: /Library/Caches/Homebrew/autoconf-2.69.tar.gz
==> Patching
patching file bin/autoreconf.in
==> ./configure --prefix=/usr/local/Cellar/autoconf/2.69
==> make install
/usr/local/Cellar/autoconf/2.69: 69 files, 2.0M, built in 13 seconds
==> Downloading http://ftpmirror.gnu.org/automake/automake-1.12.6.tar.gz
Already downloaded: /Library/Caches/Homebrew/automake-1.12.6.tar.gz
==> ./configure --prefix=/usr/local/Cellar/automake/1.12.6
==> make install
/usr/local/Cellar/automake/1.12.6: 130 files, 2.1M, built in 16 seconds
==> Downloading http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg
Already downloaded: /Library/Caches/Homebrew/apple-gcc42-4.2.1-5666.3.pkg
==> Caveats
NOTE:
This formula provides components that were removed from XCode in the 4.2
release. There is no reason to install this formula if you are using a
version of XCode prior to 4.2.
This formula contains compilers built from Apple's GCC sources, build
5666.3, available from:
http://opensource.apple.com/tarballs/gcc
All compilers have a `-4.2` suffix. A GFortran compiler is also included.
==> Summary
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3: 104 files, 75M, built in 5 seconds
Adam-Zerners-MacBook-Pro:~ adamzerner$ rvm pkg install openssl
Fetching openssl-1.0.1c.tar.gz to /Users/adamzerner/.rvm/archives
Extracting openssl to /Users/adamzerner/.rvm/src/openssl-1.0.1c
Configuring openssl in /Users/adamzerner/.rvm/src/openssl-1.0.1c.
Compiling openssl in /Users/adamzerner/.rvm/src/openssl-1.0.1c.
Error running 'make', please read /Users/adamzerner/.rvm/log/openssl/make.log
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
Updating openssl certificates
Error running 'update_openssl_certs', please read /Users/adamzerner/.rvm/log/openssl.certs.log
Adam-Zerners-MacBook-Pro:~ adamzerner$ CC=/usr/local/bin/gcc-4.2 rvm reinstall 1.9.3 --patch falcon --force-autoconf -j 3
Removing /Users/adamzerner/.rvm/src/ruby-1.9.3-p327...
/Users/adamzerner/.rvm/rubies/ruby-1.9.3-p327 has already been removed.
Fetching yaml-0.1.4.tar.gz to /Users/adamzerner/.rvm/archives
Extracting yaml to /Users/adamzerner/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/adamzerner/.rvm/src/yaml-0.1.4.
Error running './configure --prefix=/Users/adamzerner/.rvm/usr', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/yaml/configure.log
Compiling yaml in /Users/adamzerner/.rvm/src/yaml-0.1.4.
Error running 'make -j3', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/yaml/make.log
Installing Ruby from source to: /Users/adamzerner/.rvm/rubies/ruby-1.9.3-p327, this may take a while depending on your cpu(s)...
ruby-1.9.3-p327 - #downloading ruby-1.9.3-p327, this may take a while depending on your connection...
ruby-1.9.3-p327 - #extracting ruby-1.9.3-p327 to /Users/adamzerner/.rvm/src/ruby-1.9.3-p327
ruby-1.9.3-p327 - #extracted to /Users/adamzerner/.rvm/src/ruby-1.9.3-p327
Applying patch /Users/adamzerner/.rvm/patches/ruby/1.9.3/p327/falcon.diff
ruby-1.9.3-p327 - #autoreconf-f
ruby-1.9.3-p327 - #configuring
Error running './configure --enable-shared --disable-install-doc --prefix=/Users/adamzerner/.rvm/rubies/ruby-1.9.3-p327 --with-opt-dir=/Users/adamzerner/.rvm/usr', please read /Users/adamzerner/.rvm/log/ruby-1.9.3-p327/configure.log
There has been an error while running configure. Halting the installation.
Adam-Zerners-MacBook-Pro:~ adamzerner$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
Adam-Zerners-MacBook-Pro:~ adamzerner$
I've successfully downloaded Ruby 1.9.3 now!
I think the problem was that I hadn't downloaded Command Line Tools from XCode. See http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion
note that for whoami, it's using the backtick key, which is right above the tab key. It is NOT using quotes.
After I downloaded Command Line Tools, I then typed in rvm install 1.9.3. I got the same "long thing" as before, but at that point I had everything I needed, so I just pressed q to continue, and ruby 1.9.3 was successfully installed!
note: although it was successfully installed, when I typed ruby -v, it still said it was 1.8.7 even though it wasn't. However, after closing and reopening the terminal, it then said that the version was indeed 1.9.3.

How can I install XML::LibXML on Ubuntu

Here is the stdout for install:
$sudo cpanm XML::LibXML
--> Working on XML::LibXML
Fetching http://www.cpan.org/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0014.tar.gz ... OK
Configuring XML-LibXML-2.0014 ... N/A
! Configure failed for XML-LibXML-2.0014. See /home/kahmed/.cpanm/build.log for details.
details:
Unpacking XML-LibXML-2.0014.tar.gz
Entering XML-LibXML-2.0014
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.55_02)
Configuring XML-LibXML-2.0014
Running Makefile.PL
enable native perl UTF8
running xml2-config...ok (2.9.0)
Checking for ability to link against xml2...no
Checking for ability to link against libxml2...libxml2, zlib, and/or the Math library (-lm) have not been found.
Try setting LIBS and INC values on the command line
Or get libxml2 from
http://xmlsoft.org/
If you install via RPMs, make sure you also install the -devel
RPMs, as this is where the headers (.h files) are.
Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter
to see the exact reason why the detection of libxml2 installation
failed or why Makefile.PL was not able to compile a test program.
-> N/A
-> FAIL Configure failed for XML-LibXML-2.0014. See /home/kahmed/.cpanm/build.log for details.
i tried installing libxml2 manually, but still getting the same issue.
also, i checked for libxml2-dev:
sudo apt-get install libxml2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libxml2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 78 not upgraded.
here is the system info:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.04
Release: 11.04
Codename: natty
uname -a
Linux autobot 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
I think the relevant line is:
Checking for ability to link against libxml2...libxml2, zlib, and/or the Math library (-lm) have not been found.
So, you've covered off libxml. Have you installed the appropriate zlib package? Try:
sudo apt-get install zlib1g-dev
Then try installing XML::LibXML again.
Why do you want to use CPAN for this anyway? It is typically very bad idea to install CPAN packages if you have native packages provided by standard operating system installer.
Ubuntu provides a lot of Perl packages natively, with following naming convention: package name always starts with lib, then Perl package name like XML::LibXML is converted to lower case and :: replaced to dash - (XML::LibXML => xml-libxml), and finally -perl suffix is added. In other words, native package name for XML::LibXML would be libxml-libxml-perl.
So, in your case, you simply run this command and it will pull all necessary dependencies automatically:
sudo apt-get install libxml-libxml-perl
If you don't like this package for any reason you can uninstall it with sudo apt-get remove. If you use CPAN, it is very difficult to uninstall it reliably.
Overlooked the obvious:
sudo apt-get install --reinstall zlibc zlib1g zlib1g-dev
then:
sudo cpanm XML::LibXML
works!
Maybe this is new version. I did:
sudo apt-get install libxml2-dev
After this module builded and installed successfully

Check a list of packages to install with apt-get

I am writing a post-install script for Ubuntu in Perl (same script as seen here). One of the steps is to install a list of packages. The problem is that if apt-get install fails in some of many different ways for any one of the packages the script dies badly. I would like to prevent that from happening.
This happens because of the ways that apt-get install fails for packages that it doesn't like. For example when I try to install a nonsense word (i.e. typed in the wrong package name)
$ sudo apt-get install oblihbyvl
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package oblihbyvl
but if instead the package name has been obsoleted (installing handbrake from ppa)
$ sudo apt-get install handbrake
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package handbrake is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'handbrake' has no installation candidate
$ apt-cache search handbrake
handbrake-cli - versatile DVD ripper and video transcoder - command line
handbrake-gtk - versatile DVD ripper and video transcoder - GTK GUI
etc, etc ...
I have tried parsing the results of apt-cache and apt-get -s install to try to catch all possibilities before doing the install, but I seem to keep finding new ways to allow failures to continue to the actual install system command.
My question is, is there some facility either in Perl (e.g. a module, though I would like to avoid installing modules if possible as this is supposed to be the first thing run after a new install of Ubuntu) or apt-* or dpkg that would let me be sure that the packages are all available to be installed before installing and if not fail gracefully in some way that lets the user decide what to do?
N.B. I am doing something along the lines of:
my #list_of_install_candidates = (...);
my #to_install = grep { my $output = qx{ apt-get -s install $_ }; parse_output($output); } #list_of_install_candidates;
system('apt-get', 'install', #to_install);
You might try apt-cache policy. examples:
$ apt-cache policy handbrake
handbrake:
Installed: (none)
Candidate: (none)
Version table:
$ apt-cache policy foo
N: Unable to locate package foo
$ apt-cache policy openbox
openbox:
Installed: 3.4.11.1-1
Candidate: 3.4.11.1-1
Version table:
*** 3.4.11.1-1 0
500 http://mirrors.xmission.com/ubuntu/ maverick/universe i386 Packages
100 /var/lib/dpkg/status
Anything with a non-blank version table should be installable.