Showing posts with label debian stable. Show all posts
Showing posts with label debian stable. Show all posts

23 December 2012

301. Building Mosquitto 1.0.5 on debian stable

Here's what I did in a chrooted Stable while writing up a reply for this post:

I've changed the commands a little bit from to be more faithful to my own style. Edit your /etc/apt/sources.list so that it has both stable and testing e.g.

deb stable main
deb testing main

and edit /etc/apt/preferences
Package: *
Pin: release a=stable
Pin-Priority: 990

Package: *
Pin: release a=testing
Pin-Priority: 800

Followed by

sudo apt-get update
sudo apt-get install build-essential python quilt libwrap0-dev libssl-dev devscripts python-setuptools
sudo apt-get install libssl-dev=1.0.1c-4 python3


mkdir ~/tmp
cd ~/tmp
wget -O mosquitto_1.0.5.orig.tar.gz
tar xvf mosquitto-1.0.5.orig.tar.gz
cd mosquitto-1.0.5/
tar xvf mosquitto_1.0.5-1.debian.tar.gz
debuild -us -uc
sudo dpgk -i ../*mosquitto*.deb

and you'll find the .debs in the parent folder.

Links to this page:

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/
sudo chroot testing/

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 line: localhost beryllium

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

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
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
And put this in a file, e.g.
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

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 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...

17 February 2012

70. Bug in Debian version of Gnuplot 4.4.0

The symptom:

Gnuplot 4.4.0-1.1 (the current Debian version) can't handle numbers smaller than 10**(-9) properly
me@beryllium:~/Dropbox$ gnuplot
Version 4.4 patchlevel 0
last modified March 2010
System: Linux 3.2.0-1-amd64
Copyright (C) 1986-1993, 1998, 2004, 2007-2010
Thomas Williams, Colin Kelley and many others
gnuplot home:
faq, bugs, etc:   type "help seeking-assistance"
immediate help:   type "help"
plot window:      hit 'h'
Terminal type set to 'wxt'
gnuplot> print 10**(-9)
gnuplot> print 10**(-10)
gnuplot> print 10**(-11)

It's not related to set zero.

gnuplot> set zero 1e-20
gnuplot> print 10**(-11)
gnuplot> print 10**(-10)
gnuplot> print 10**(-9)

Currently, I'm using version 4.4.0-1.1 -- which is used in all versions of Debian.

me@beryllium:~$ apt-cache showpkg gnuplot
Package: gnuplot
4.4.0-1.1 (/var/lib/apt/lists/ (/var/lib/apt/lists/ (/var/lib/apt/lists/ (/var/lib/dpkg/status)
4.4.0-1.1 - gnuplot-nox (2 4.4.0-1.1) gnuplot-x11 (2 4.4.0-1.1) gnuplot-doc (2 4.4.0-1.1)
4.4.0-1.1 -
Reverse Provides: 

The bug affects the output from the print statement as well as the internal handling of numbers:

gnuplot> plot 10**(-11)
Warning: empty y range [8.22536e-10:8.22536e-10], adjusting to [8.14311e-10:8.30761e-10]

gnuplot> plot 10**(-12)
Warning: empty y range [-1.3748e-09:-1.3748e-09], adjusting to [-1.36105e-09:-1.38855e-09]
gnuplot> plot 10**(-12)/10**(-10)
Warning: empty y range [-1.93855:-1.93855], adjusting to [-1.91917:-1.95794]

gnuplot> set xrange [10**(-9):10**(-12)]
gnuplot> plot x 

The bug is similar to this:

Integer overflows are not reported. A hint could be printed that real
(float) numbers should (could) be used to avaid this problem.
gnuplot> print 1000000*100000
gnuplot> print 1000000**2
gnuplot> print 100000**2
gnuplot> a=2000000**2
gnuplot> print a
gnuplot> print 10000**2 # OK
which ended up with "Added tag(s) wontfix. "
Ergo, if you're using debian and you are using gnuplot for serious purposes (research, work), compile your own version of gnuplot as per below.

ANNOYING: there are packages such as maxima which depend on gnuplot. Remove the debian version of gnuplot using apt-get and you lose maxima too. Octave, which one would think would be a heavier user of gnuplot, does not depend on gnuplot but merely recommends it.

Package: maxima                        
State: not installed
Version: 5.26.0-3
Priority: optional
Section: math
Maintainer: Camm Maguire <>
Uncompressed Size: 47.8 M
Depends: libc6 (>= 2.3), libgmp10, libreadline6 (>= 6.0), libx11-6, gnuplot-x11
Maybe time to build your own maxima.deb? In the end you will end up with a very inelegant system with mixed packages.

I've compiled and checked the current upstreams version:

me@beryllium:~$ sudo apt-get autoremove gnuplot gnuplot-nox
cd ~/temp
 mv gnuplot-4.4.4.tar.gz\?r\=http\ gnuplot-4.4.4.tar.gz
tar -xvf gnuplot-4.4.4.tar.gz
sudo checkinstall

me@beryllium:~/temp/gnuplot-4.4.4$ sudo dpkg -i gnuplot_4.4.4-1_amd64.deb
(Reading database ... 446323 files and directories currently installed.)
Preparing to replace gnuplot 4.4.4-1 (using gnuplot_4.4.4-1_amd64.deb) ...
Unpacking replacement gnuplot ...
Setting up gnuplot (4.4.4-1) ...
Processing triggers for man-db ...
me@beryllium:~/temp/gnuplot-4.4.4$ gnuplot
Version 4.4 patchlevel 4
last modified November 2011
System: Linux 3.2.0-1-amd64
Copyright (C) 1986-1993, 1998, 2004, 2007-2011
Thomas Williams, Colin Kelley and many others
gnuplot home:
faq, bugs, etc:   type "help seeking-assistance"
immediate help:   type "help"
plot window:      hit 'h'
Terminal type set to 'x11'
gnuplot> print 10**(-9)
gnuplot> print 10**(-10)
gnuplot> print 10**(-11)
gnuplot> print 3.14*10**(-10)
gnuplot> print 3.14*10**(-20)
gnuplot> print 3.14*10**(-21)
gnuplot> print 3*10**(-12)/(4*10**(-14))

Ergo, upstreams v 4.4.4 works.

Update: Here's my bug report: