Nick's Tech Blog: fedora

Pages

Showing posts with label fedora. Show all posts
Showing posts with label fedora. Show all posts

Monday, September 26, 2011

Fedora > libfontconfig.so.1: cannot open shared object file: No such file or directory

Problem

Received the following exceptions (seperately) when attempting to run a java program on Fedora 15 amd64.

/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
...
libstdc++.so.5: cannot open shared object file: No such file or directory
...
Exception in thread "main" java.lang.UnsatisfiedLinkError: /some/directory/libmawt.so: libXext.so.6: cannot open shared object file: No such file or directory
...
libfontconfig.so.1: cannot open shared object file: No such file or directory


and so on.

Solution

Obviously a couple of dependencies were missing. To find out which package/s you need to install to fix a missing dependency, use "yum provides <missing_file>".
e.g.
# yum provides libfontconfig.so.1
fedora/metalink |  21 kB     00:00    
jenkins |  951 B     00:00    
updates/metalink |  12 kB     00:00    
fontconfig-2.8.0-3.fc15.i686 : Font configuration and customization library
Repo        : fedora
Matched from:
Other       : libfontconfig.so.1

Then install the packages...
e.g.
# yum install fontconfig

Repeat for all missing files.

Thursday, September 22, 2011

Fedora > java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment

Problem 

The following exception was encountered when running a java program on Fedora:
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment

Assumptions: you know what an xserver is.

Solution

Basically, the java program is trying to access the xserver, and can't.

If it should be accessing the xserver, make sure the xserver is started/running:
  • e.g. ps -ef | grep Xvfb
If it shouldn't be accessing an xserver, make sure the "DISPLAY" environment variable is unset:
  • unset DISPLAY

See also:
Fedora > install Xvfb as a service

Fedora > install Xvfb as a service

Problem

I required Xvfb to be installed, and running as a service on a server.

Assumptions: you know how to use chkconfig, yum, vi and chmod.

Solution
  1. yum install xorg-x11-server-Xvfb
  2. vi /etc/init.d/xvfbd (copy contents below into the file, and save it)
  3. chmod 755 /etc/init.d/xvfbd (now we have a service)
  4. chkconfig --add xvfbd
  5. chkconfig --level 2345 xvfbd on

You can now start your service with:
sudo service xvfbd start

Check it's running:
ps -ef | grep Xvfb

Check it's listed to startup automatically for runlevels 2,3,4,5:
chkconfig --list


/etc/init.d/xvfbd

#!/bin/bash
#
# description: Xvfb server
#


# Get function from functions library
. /etc/init.d/functions


# Start the service Xvfb
start() {
        echo -n "Starting Xvfb server: "
        /usr/bin/Xvfb &
        ### Create the lock file ###
        touch /var/lock/subsys/Xvfb
        success $"Xvfb server startup"
        echo
}


# Restart the service Xvfb
stop() {
        echo -n "Stopping Xvfb server: "
        killproc Xvfb
        ### Now, delete the lock file ###
        rm -f /var/lock/subsys/Xvfb
        echo
}


### main logic ###
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status Xvfb
        ;;
  restart|reload|condrestart)
        stop
        start
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|reload|status}"
        exit 1
esac


exit 0

See also:
http://www.cyberciti.biz/tips/linux-write-sys-v-init-script-to-start-stop-service.html

Sunday, September 11, 2011

Fedora > WARNING: / partition has insufficient space to install the items selected

Problem

I received the following error, when installing an application on Fedora 15 (Tibco TRA as it happens).

WARNING: / partition has insufficient space to install the items selected.
XXX MB additional space would be needed to install the selected items.


Solution

Create a temp directory that can hold the amount of space required to install the application (e.g. /root/tmp).

Then append the following parameter on to your installation command.
-is:tempdir /root/tmp

See also:
http://publib.boulder.ibm.com/infocenter/iisinfsv/v8r1/index.jsp?topic=/com.ibm.swg.im.iis.productization.iisinfsv.install.doc/topics/iisri_verify_disk_space.html

Friday, September 9, 2011

Fedora > /bin/sh: bad interpreter: Permission denied

Problem

Received the following error message when attempting to install an application, in Fedora 15, where the current working directory is /tmp/somedir.
/bin/sh: bad interpreter: Permission denied

Solution

Security on Fedora/RHEL blocks executing scripts from /tmp. The solution/workaround is to move the directory to my homedrive, and run it from there instead.

http://www.velocityreviews.com/forums/t9645-bash-firefox-installer-bin-sh-bad-interpreter-permission-denied.html