Installing netbeans 6.5M1 on ubuntu error:/usr/share/themes/Human/gtk-2.0/gtkrc:43: error: lexical error or unexpected token, expected valid token

6 08 2008

problem:

I get the following error when trying to run the linux netbeans 6.5M1 installer (netbeans-6.5_m1-php-linux.sh) on ubuntu 8.04:

/usr/share/themes/Human/gtk-2.0/gtkrc:43: error: lexical error or unexpected token, expected valid token

and then the installer window shows a blank screen.

(I’m guessing this post may relate to other versions of netbeans and ubuntu)

solution:

the problem was the jvm 1.5 I was running under, updating to jvm 1.6 solves the problem… I installed the sun-java6-jdk and the jvm dependencies then when executing the installer I specified the java home as follows:

./netbeans-6.5_m1-php-linux.sh --javahome /usr/lib/jvm/java-6-sun





(X tunnelling) xhost: unable to open display

23 07 2008

I’m running ubuntu 8.04 and had a problem tunneling the X display from a solaris box to my local ubuntu test server.

when executing this command in my bash script:

DISPLAY=localhost:0
export DISPLAY
xhost +

i would get the following message

xhost: unable to open display “localhost:0″

The problem being the by default ubuntu restricts tcp listening with the following configuration default in:

/etc/gdm/gdm.conf

# If true this will basically append -nolisten tcp to every X command line, a
# good default to have (why is this a "negative" setting? because if it is
# false, you could still not allow it by setting command line of any particular
# server).  It's probably better to ship with this on since most users will not
# need this and it's more of a security risk then anything else.
# Note: Anytime we find a -query or -indirect on the command line we do not add
# a "-nolisten tcp", as then the query just wouldn't work, so this setting only
# affects truly attached sessions.
DisallowTCP=true

To fix the error message you can cgange the config option to:

DisallowTCP=false





broken sudo user on ubuntu

18 01 2008

Today I broke my sudo access in ubuntu by removing my user account from: System > Administration > Users and Groups > Properties (button) > User Privileges (tab) > Administer the system (tick box).

I found a very useful article here which explains how to recover from the situation. Just in case the link is broken in the future here is a brief description of what to do:

The two important files are: /etc/sudoers and /etc/group

The /etc/group file will look like this:
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:firstuser
tty:x:5:
disk:x:6:
lp:x:7:cupsys
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:firstuser,cupsys
fax:x:21:
voice:x:22:
cdrom:x:24:firstuser,haldaemon
floppy:x:25:firstuser,haldaemon
tape:x:26:
sudo:x:27:
audio:x:29:firstuser
dip:x:30:firstuser
www-data:x:33:
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:firstuser
sasl:x:45:
plugdev:x:46:firstuser,haldaemon
staff:x:50:
games:x:60:
users:x:100:
nogroup:x:65534:
dhcp:x:101:
syslog:x:102:
klog:x:103:
firstuser:x:1000:
lpadmin:x:104:firstuser
scanner:x:105:firstuser,cupsys
admin:x:106:firstuser
crontab:x:107:
ssh:x:108:
messagebus:x:109:
haldaemon:x:110:
slocate:x:111:

If your broken user is missing from the admin group /etc/group file then your sudo will be broken for this user because you have to be a member of this group in order to execute sudo commands.

Question:
But how do you edit this file if you can’t “sudo nano /etc/group” or “sudo vi /etc/group” ?
(because the file is owned by root)

Answer:
You must start ubuntu in “recovery” mode which will log you in as “root”.

Once logged in as root you will have permission to edit /etc/group or any other file on the system that has become corrupted.

Just add your username to the admin group (there is also a group called “adm”, but the “admin” group is the important one!) That’s it!








Follow

Get every new post delivered to your Inbox.