16 December 2012

293. Running GIMP 2.8 in a chroot on debian stable/squeeze (ugly)

Update: because I had copied and pasted some of the instructions from one of my earlier attempts at building gimp under stable, there were some minor discrepancies. Those are fixed now.

Original post:
Here's the least elegant and functional way of running GIMP 2.8 on stable/squeeze other than running it in a virtual machine.
 I've previously tried
 * creating a statically linked binary of gimp 2.8 under testing, then using it under stable (didn't work --
 * compiling gimp + all dependencies from scratch -- ballooned out of control
 * compiling the bare minimum needed for gimp from scratch, but had issues with libglib2.0-dev -- the dev files are obviously taken care of when you compile glib, but the -dev package is required by a lot of libraries needed for graphics support, and I wanted to replace the libglib2.0-0 package.

Long story short, I gave up. If you don't mind the overhead in terms of space, you can run it in a chrooted environment. It's not pretty, but it works.


We first set up a chrooted environment

sudo apt-get install debootstrap coreutils
mkdir -p $HOME/tmp/architectures/testing
cd $HOME/tmp/architectures
sudo debootstrap --arch amd64 testing $HOME/tmp/architectures/testing/ http://ftp.au.debian.org/debian/
sudo chroot testing/

Cosmetic
Sort out locales to avoid annoying error messages
apt-get install locales
echo 'export LC_ALL="C"'>>/etc/bash.bashrc
echo 'export LANG="C"'>>/etc/bash.bashrc
source /etc/bash.bashrc

Also, add your hostname (=beryllium) to /etc/hosts by putting your hostname at the end of the 127.0.0.1 line:
127.0.0.1 localhost beryllium

to avoid constant warnings about unresolved hostname like the one below
sudo: unable to resolve host beryllium

Continue
I don't like working as root even in a chrooted environment, so create a new user, 'build' and give it superuser powers:
adduser gimp

And edit /etc/sudoers to add
gimp ALL=ALL:ALL
Defaults !tty_tickets

The reason we add the !tty_tickets is that otherwise you will have to type the password each time you use sudo i.e. it will time out instantaneously.

Run the echo command below and exit your chroot:
echo "export DISPLAY=:0.0">>/etc/bash.bashrc
exit
And put this in a file, e.g. gimp.sh
xhost + sudo mount -o bind /proc $HOME/tmp/architectures/testing/proc sudo cp /etc/resolv.conf $HOME/tmp/architectures/testing/etc/resolv.conf sudo chroot $HOME/tmp/architectures/testing
Run
sh gimp.sh

Now inside the chrooted shell that you just started, do
su gimp
cd ~

Time to install gimp
sudo apt-get install gimp

And you're done!

You can now run GIMP 2.8 in the chrooted environment. It is NOT elegant though.
Gimp running in a chrooted Wheezy on a Squeeze virtual machine (LXDE) on a Wheezy physical machine (gnome 3).
Moving files in and out of the jail:
There are a few options -- you can obviously always move files from your host system to the chroot jail. A major point of a chroot jail is that you can't access the host system though, but we've set up our gimp.sh so that we can connect via ssh or sftp as well

In your chroot, as the user gimp, do e.g.
sudo apt-get install openssh-client
sftp me@host:shared/

I warned you that it wasn't elegant...

15 December 2012

292. seahorse -- what happened?

There's been a lot of talk about how nautilus will be simplified/dumbed-down/crippled/improved -- but I didn't know seahorse was going to undergo such a radical makeover. Don't know if it's for better, worse or if it changes nothing, but at the moment I'm having trouble finding my way around.

seahorse 3.4.1-2

14 December 2012

291. Another nautilus-open-terminal related bug

We recently had issues with nautilus-open-terminal opening the terminal in $HOME no matter from which directory it was called: http://verahill.blogspot.com.au/2012/11/fix-for-nautilus-open-terminal-opens-in.html

In that post the fix was to do
gsettings set org.gnome.desktop.default-applications.terminal exec gnome-terminal

Which worked fine as long as the exec-arg remained '-x'. It seems to have changed to '-e' now, so during the past few days (since nautilus 3.4.2) 'open terminal here' doesn't open a terminal at all.

Diagnosis:
Looking at this: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=693894


gsettings get org.gnome.desktop.default-applications.terminal exec
'gnome-terminal'
gsettings get org.gnome.desktop.default-applications.terminal exec-arg
'-e'
Fix:
gsettings set org.gnome.desktop.default-applications.terminal exec x-terminal-emulator

It should now work normally.