How to easily exclude packages from apt-get upgrades

Once you’ve got the hang of Debian/Ubuntu’s package management system and have had a fine time smoothly upgrading your system periodically, at some point the inevitable will happen: while upgrading a package something will get installed that will break something else.

It could be, as happened to me recently, a version of Google Chrome that won’t play nice with some element of Gnome or the GTK toolkit – any button on a webpage that should launch a dialogue box took minutes to do so. Several minutes. So we need to reverse this, by downgrading the package to the previous version, and then prevent it from being reinstalled automatically. How?

The most common Debian package manager frontend is apt-get. There are a number of different options, from powerful but complex dpkg, it’s more user-friendly brother aptitude, to the full blown X-windows GUI of synaptic. But apt-get is most people’s first choice, the most straightforward, and the one which comes with no obvious switch or option included – the following demonstrates how.


1) Remove and downgrade the problem package

This is straightforward. First find the problematic package version:

$ sudo cat /var/log/apt/term.log | grep google-chrome-stable
Setting up google-chrome-stable (32.0.1700.77-1) ...
Preparing to replace google-chrome-stable 32.0.1700.77-1 (using .../google-chrome-stable_32.0.1700.102-1_amd64.deb) ...
Unpacking replacement google-chrome-stable ...
Setting up google-chrome-stable (32.0.1700.102-1) ...

There in the apt logfile is the output of the apt-get command that installed the package we want to replace, version 32.0.1700.102-1. Now we find the packages in the apt package cache:

$ ls -l /var/cache/apt/archives/google-chrome-stable*

There’s the last few versions. It’s simple enough to replace the most recent with the previous version using dpkg.

$ dpkg -i /var/cache/apt/archives/google-chrome-stable_32.0.1700.77-1_amd64.deb


2) Prevent the next apt-get update or dist-update from upgrading the package

The package manager records packages as flagged in one or more of various states, such as installed (or set to be installed), not installed (or set to be removed) or held. For this purpose we need to hold the package. There are two ways of doing this.

One is to use dpkg again, using –set-selections to set the package flags.

$ echo "google-chrome-stable hold" | sudo dpkg --set-selections

(note it’s dpkg that requires root privileges, not echo)

We can check this has worked:

$ dpkg --list | grep google-chrome-stable
hi google-chrome-stable 32.0.1700.77-1 amd64 The web browser from Google

Where the “hi” at the beginning of the line stands for “hold” and “installed”. You can read up more about the different package statuses, how to check them and what they mean in the dpkg-query manpage.

Now when we run an upgrade using apt-get, the held package will be ignored:

$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
The following packages will be upgraded:
curl libcurl3 libcurl3-gnutls
3 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 1,258 kB of archives.
After this operation, 39.9 kB of additional disk space will be used.
Do you want to continue [Y/n]?

You can easily check which version of the held package installed and the package offered from the repo by running apt-get install on the package with the -s (“simulate”) switch, which reports the package versions:

$ sudo apt-get install google-chrome-stable -s
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following held packages will be changed:
The following packages will be upgraded:
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Inst google-chrome-stable [32.0.1700.77-1] (32.0.1700.107-1 Google:1.0/stable [amd64])
Conf google-chrome-stable (32.0.1700.107-1 Google:1.0/stable [amd64])

At some point we’ll want to reverse this decision, as bugs will have been fixed and versions incremented. So we can unhold the package by setting it to install, where the “ii” refers to “set for installation” and “installed”:

$ echo "google-chrome-stable install" | sudo dpkg --set-selections
$ dpkg --list | grep google-chrome-stable
ii google-chrome-stable 32.0.1700.77-1 amd64 The web browser from Google


The alternative is to use apt-mark. This is chiefly for marking packages as either automatically or manually installed, which affects how they respond to being installed, upgraded or removed as dependencies to other packages. For example, a package set to auto will be automatically installed as a dependency to another package if required, and automatically removed if not required; those set to manual will not.

But it also can be used to hold packages – in fact, it is a wrapper around dpkg --set-selections, and works in exactly the same way albeit in a slightly simpler fashion.

$ apt-mark hold google-chrome-stable
$ apt-mark showhold
$ sudo apt-mark unhold google-chrome-stable
$ apt-mark showhold

And there you are. More straightforward than pinning using apt’s preferences file (with less margin for disaster), and easily reversible.

Social media’s war on image metadata

An interesting trial carried out by the Embedded Metadata Manifesto shows that most social media sites are pretty terrible at maintaining creator, copyright, credit or caption Exif and IPTC image metadata – despite the fact that posting and sharing is essentially what social media is founded on.

Facebook performs predictably badly, stripping all Exif and IPTC data from uploaded and downloaded images. This is doubly ridiculous because Facebook’s image processor already reads that same information and displays it as image captions and titles. Why not just leave it there?

Flickr fairs just as badly – outrageous considering it’s supposed photographer-friendly stance, but probably no surprise to long-time users who have watched dejectedly as Flickr’s star has faded over the years, with zero investment of either money or ideas since Yahoo bought it.

At least Tumblr and Pinterest leave metadata intact, but don’t show it, as with common Twitter image hosts Yfrog and

Google Plus is the surprise winner, respecting all uploaded metadata, showing it on the interface, and preserving it in downloaded images. Shame nobody uses it – not even Googlebosses.

Food blogging for Zagat

I’ve been filling in for friends at the Zagat London food blog these last weeks, which means the opportunity to research some interesting restaurant and bar openings, and get paid for it, rather than just fall into the usual suspects (and get carried out).

In the process I managed to swing a visit to the opening night of fancy-pants contemporary Japanese restaurant Wabi in Holborn, and last night we even managed a visit to the hallowed members-only clubrooms of Electric House on Portobello Road in order to road-test the new Electric Diner’s Chicago-inspired meat, eggs and booze-heavy menu.

More to see over at the Zagat blog. There are, on reflection, worse ways to make a living.

Independent Record Market at Spitalfields

Among the interesting items on display was this ghettoblaster that plays 12″ records.
You’d struggle to carry it though, it weighs a ton – small child to scale.

Yesterday I wandered down to Spitalfields Market to visit the Independent Record Market, an occasional gathering of indies big and small (but mostly small) that meet there several times a year, last in August. At the were labels like Bella Union, Big Dada, Fierce Panda, Fire, Full Time Hobby, !K7, Laissez Faire Club, Monotreme, Moshi Moshi and Play It Again Sam alongside bigger indies like Ninja Tune, R&S, Planet Mu, One Little Indian and Peacefrog – with more labels setting up on the Sunday.

There was a large amount of vinyl on display, perhaps unsurprisingly as that’s what the sort of buyer-collectors that haunt record markets are looking for, and they would have been overjoyed by the selection of interesting items up for grabs rarities dragged from the vaults and special releases. And branded T-shirts, badges and mugs, of course. I’m now kicking myself for not picking up a nice R&S tee when I had the chance, to replace my veteran Joey Beltram Novamute t-shirt that was well loved but disappeared years ago (If any of my friends have that, but I’ve forgotten, I want it back by the way).

I interviewed a few of the stallholders and label bosses for Clashmusic to talk about how business was faring through 2012 and what prospects for the indies looked like for next year. Among them were Moshi Moshi’s Michael McClatchey, Bill Brewster of independent publishers (which released the hilarious Raving ’89 photostory of one man’s early days of acid house), Andy Bibey from One Little Indian, and Nigel Adams of Full Time Hobby.

You can hear the results at Clashmusic’s Soundcloud page.

On adventure upon the high seas, part 5

Sunday 30th September, Mar Cantábrico near A Coruna.
NE force 4, 1020 mbar.

The boat cuts through the quiet sea, as it has continuously for the last four nights. By 3am we’ve reached the Spanish coast at Cape Ortega, heading west on the last leg. To port lies the dark mass of Galician hills, black against a bright, moonlit sky, with lights picked along roads and great lighthouses semaphoring their unique messages out to those watching for them. Trawlermen rumble past along the coast, nets out in the waters. Ahead of us I can see the glow on the clouds from the lights of Ferrol – Franco’s birthplace – miles away, still hidden behind the headland. As our phone signal has reappeared on reaching inshore waters, I text Carmen, my friend from A Coruna who is celebrating her birthday back in London.
“I can see your house from here”, I say.

Light thickens as the clarity of night is discoloured by dawn, still hidden behind the mountains. We round the last cape at Covas, where the echoes of great gun emplacements lie quiet alongside the lighthouses. We pass within a few hundred yards of the rocks, close enough that I can see the white spray surging up the cliff.

The proximity alarm goes off as we pass the waypoint, our computerised chart plotting our route as we turn south towards A Coruna’s old town on the headland, and the harbour further into the bay. I wake up Michael, now that the journey involves decisions. And rocks.

Welcoming us is The Tower of Hercules, a Roman lighthouse built by the Romans around 1900 years ago to protect their Mediterranean fleets as they passed up the coast towards Brittany and the vital tin ports of southwest England. It is the oldest continually-operating lighthouse in the world. Renovated sympathetically in 1791, it still even retains – mocked up in the masonry cladding around the original tower – the impression of the sloped external ramp on which barrels of lamp oil were wheeled to the top. As we arrive at around 7am, the moon, my companion these last few nights, slips quietly towards the Atlantic for the last time.

Sailing up the marina there are plenty of ribs rushing around, all carrying youngsters, it seems. Perhaps there is some kind of sea school, or competition taking place. The Guardia Civil eye us a they pass by on a launch, and a couple of middle-age fishermen. Towering over the marina is the strange modernist Port Authority building, two stark white pillars that trap two glass-jewelled office platforms surveying the harbour from above. It looks very odd, but I warm to it.

Mooring up to the wooden jetties that criss-cross the marina, Michael and the others disembark for the harbourmaster’s office. Technically I have arrived in Spain, but can’t get off until the others have wandered around a bit and no one will notice a surprise fourth crewman. After a while they return, freshly clean and glowing from the showers. I take a key to the gates and wander past racing yachts, fifty-footers like Salamander, power boats, and a couple of pretty impressive motor cruisers – though not quite in the megayacht range.

In a blissfully scalding shower, I close my eyes and my vision swims and sways as my legs struggle to adjust to surroundings that for once are not moving underneath me.

On adventure upon the high seas, part 4

Saturday 29th September, Bay of Biscay.
NNE force 4, 1009 mbar.

The rocking and rolling of the boat, the incessant creaking of the cabin walls, and being occasionally flung across my bunk do not make for a restful night’s sleep. The watch rota is three hours on, six hours off, so when given the opportunity to sleep at night it’s foolish to turn it down – even if actual sleep is harder to come by.

Back on deck for 9am to relieve Martin. A third day of waking up to nothing but the ocean on all sides. The sun is up already, it’s bright and warm, and the northerly-blown swell still rolls us around on its back, but we’re losing speed. In an effort to pick up more wind without changing direction, we all get ready to do some actual sailing under Michael’s guidance. Turning into the wind, we reef the mainsail down to just a duvet-sized sheet, and unfurl the genoa to it’s maximum extent. With the wind from behind us we hope that without the mainsail literally taking the wind out of it we will be pulled along faster. We’re not. The huge acreage of sail empties and fills as the wind gusts one way or another, whipping to and fro with a loud crack. We put everything back as it was, ropes flying around capstans and through our hands. While it was all for nothing in the end, it feels good to be playing a part in rigging the ship and trimming the sails – reminding us that it’s not all autopilot in these days of GPS and electronic terrain-following charts.

The race is on to get Charlotte to the airport in A Coruna in time for her 3pm flight on Sunday. Midway through the Bay of Biscay with just under 24 hours to go we’re looking good for distance but poor on speed. There’s nothing for it but to use the engine.

The day creeps by, the sun sweeps across the bow, and the crew graze their way through the provisions. Without a great deal of sailing to do – no tacking, no making ropes or mending sails or swabbing decks – I feel an tinge of cabin fever, the four of us in a cockpit perhaps 10 feet square. I read Breakfast at Tiffany’s and eat cereal bars and sip whisky to pass the time.

I also make a discovery – I’ve forgotten my passport, which means I will be illegally immigrating into Spain – sounds like fun. It’s impossible for every port to rigorously check every boat, so all borders are porous to a degree. But Michael and Salamander are heading south for Lisbon, Morocco, the Canaries and then St Lucia, so it’s getting back home that presents a more pressing problem.

I cook a final curry – Indian and brown rather than Thai and green this time – and we settle in for the final night at sea. On watch at 3am, the night is once again clear and the moon is finally full and wears a halo behind each passing cloud. It’s certainly a humbling experience to be out at sea, in more than 4,000 metres of the North Atlantic, on a little boat tossed around by the wind and waves. There’s plenty of time and space to think, listen to the waves. Too much, even.

On adventure upon the high seas, part 3

Friday 28th September, Bay of Biscay.
SW force 3, 1050 mbar.

I sleep uneasily. The ship rattles, the wooden partitions of the cabin creaking with the pressure of the waves on the hull. Everything creaks and groans. The ship rolls and pitches strongly, and I am tossed from one side of the bunk to the other, and resort to trying to brace myself against each wall with my feet. But the motion is not because the weather is rough outside. In fact, sometime around 3am I awake to almost total stillness, only the gurgle of water under the keel. It feels like we’ve slowed almost to a stop. I can hear Michael and Martin talking on deck, and a barking sound as the engine is started, sending reverberations through the ship. The wind has dropped and changed direction, and we need the engines to keep our speed up in order to get to A Coruna in time for Charlotte’s flight back for work in London on Monday.


Around 6am I climb up to the cockpit to take watch. It’s dawn, and the sun still lurks behind the horizon, although its light has set low clouds on fire with pinks and oranges, announcing its arrival. After a few minutes on deck, I see the first of them – incredibly quick, incredibly close, just a metre or two from the boat, grey, glistening, smooth, and streamlined: dolphins. Three or four of them ride alongside our bow-wave in the near darkness, leaping clear of the water in pairs, in perfect unison. After a while they drop behind us, perhaps put off by the sound of the engine.


The sun rises behind the clouds, and the rest of the crew join us. Rigging the genoa and letting out the full sail, we pick up speed to reach an impressive 7.5 knots and kill the engine. Realising the game is back on and with no diesel engine to distract them, the dolphins return – the full pod of perhaps 20 or more. They dance about, dodging in and out under the boat, leaping up in pairs and threes, racing each other through the bow-wave. Just them and us in the empty ocean.

To see them is to smile. They’re enchanting, effortless. And very hard to photograph.

A lot of gulls appear around us too, assuming if there’s dolphins then there might be fish to spare. The bay turns out to be quite different from its reputation – and very different from my experience of the Channel. It’s calm outside, sunny, with sparse clouds. Time passes.

That evening, another Thai curry, another long night watch under a near-full moon on a glassy sea. The wind turns around to the north, blowing from behind us. My efforts to let out the genoa to pick up more of the changing wind do not go according to plan when I fail to notice that the hank of the rope was left on the winch; the ropes are tangled. I admit defeat and wake up the captain to sort out the sails. It turns out I did the right thing but badly, and with genoa and mainsail trimmed, we pick up speed on our way due south.

The tailwind causes the boat to pitch and roll as the waves overtake us, blown from behind. It makes the simplest of tasks difficult: do not attempt to piss standing up, while pouring tea successfully requires synchronising kettle and cup, as both are now moving. By the time I head below at 4am, the warm front has arrived and swamped us in cloud. The air is suddenly damp, chilled. The bright moonlight has gone and the glassy sea is darker, more menacing, the white caps of the waves now a snarl of teeth in the darkness.

On adventure upon the high seas, part 2

Thursday 27th September, Western English Channel.
SW force 4, 1020 mbar.

I emerge groggily from below decks to find the dark clouds have dispersed, the sun is shining and the wind has dropped. After last night’s experience I had secretly hoped we were nearly there, so I am pretty disappointed to discover that I can still see the English coast. My god, sailing is slow. Having had to tack a bit through the night because the wind was against us, we’ve not even reached as far as Plymouth in 18 hours of sailing. However, my stomach is relieved to find it is a calmer sea through which Salamander cuts a brisk pace, and when cups of tea and oatcakes go down and stay down, it seems I have found my sealegs and am declared fit for duty.

We pass by several tankers, big enough to still loom large even from half a mile away. Otherwise the horizon is empty. The sun’s reflections give the sea a strange, glassy appearance. It could almost be ice – like a glacier, but moving in fast-forward instead of at a eponymously glacial pace.

We trim the genoa, and soon clear eight knots. I doze off on the cockpit bench, the creaking of the sails, gurgle of water under the bow, gentle rocking and lack of sleep is too much not to. A bit like a London night bus, in that respect. By the afternoon the English coast has disappeared and we are sailing down the channel midway between England and France. The occasional yacht passes by, signature triangles of white sail in the distance.


As the light falls, I go below to make myself useful by cooking a meal, the first substantial thing that’s passed my lips since I got onboard. Green chillies, galangal, ginger, lemongrass, garlic, more chillies and green curry paste – the provisions aboard leave little room for manoeuvre for those that can’t take the heat. Thai green curry all round, and we dine washed down with two bottles of white under a rising moon. As darkness smothers the boat, the lights of Roscoff and Portsall appear in the distance. We have left England behind, and Brittany lies ahead of us.


On night watch at midnight under the light from a nearly full moon that sears through thin clouds, I follow the French mainland as we pass the headlands beyond Brest, tucked out of sight at the end of the estuary, while the many lighthouses and beacons of the Breton coast score through the night. From the control panel in the cabin, I can monitor our progress on the computerised navigation map as we pass the Isle d’Ouessant, and a proximity alarm sounds as we pass the programmed waypoint. I head upstairs and adjust the autopilot’s heading for our new course south. We have entered the Bay of Biscay.

On adventure upon the high seas

Wednesday 26th September, Poole Marina.
S force 5, 990 mbar.

The plan was to leave last night, but there were still too many unticked items on the list of things to do, the wind was against us and Michael, the captain, was happy to have a vegan shepherd’s pie and a final sleep on (or at least docked beside) British soil before we left. He had waited 12 years for this, after all, so another night would cost nothing.

And so we’re up at 7am for breakfast and final preparations – filling water tanks, stowing everything for getting underway. Every square foot of cabin floorboard seems to hide endless cavities, and each is packed with tools and spares – hardly surprising for a boat that is about to embark on a journey around the world.

Soon enough we let slip the lines and the 47ft yacht Salamander coasts out of the marina under power. First stop is at Poole town quay for diesel, and to the chandlers for navigation charts of our route: across the Channel, around the coast of Brittany, across the Bay of Biscay to A Coruna on Spain’s northwestern tip.

At midday, despite ominous clouds in the distance, the going is good. Cruising out into the channel we cross the chain-link ferry that runs the three hundred yards between the Isle of Purbeck and Sandbanks, and pass Brownsea Island and its tourist boats adorned with images of England’s last surviving red squirrels. As we approach the Jurassic Coast’s immediately recognisable Old Harry Rocks I take the helm and turn her into the wind, deadening the breeze enough that Michael and Martin can untie the bands holding the mainsail in place. Unbound, we haul out the sail to second reef, unfurl the genoa, and, tacking back into the wind, find ourselves under sail at six knots – enough to kill the engine.


Out in the Channel, the swell rises with the wind and the boat surges up and down. I have often travelled on the large, cross-channel ferries to France or Holland, and on smaller hydroplane ferries linking the islands of the Adriatic. But being chucked about at sea on a considerably smaller craft is, if you’ll excuse the pun, a very different boat. The sky darkens to a grim slate, a squall of rain comes and I can feel bile rising in my throat.

Between retching over the side, I can pause long enough to consider how peculiar seasickness is. The nausea, caused by the disorientation of differently moving horizon and boat, brings with it a woozy, druggy feeling that pulls upon the eyelids and urges you to unconsciousness. Even taking the helm for a while to force me to focus on my surroundings isn’t enough. My eyes are closing as I stand. Struggling down to my cabin, I barely make it to the loo (or ‘head’ in mariner’s terminology) in time – somewhere I will be spending much of the next 12 hours.

Later that afternoon I try eating a bit of ham, which reappears in seconds – surely a world record. With night falling, I head to my bunk. Slipping in and out of consciousness I am plagued by weird, hallucinogenic thoughts and dreams. Sometimes hot flushed, sometimes shivering cold, it’s like a psychological fever. Outside the wind and waves grow steadily more fierce – the logbook shows force 5, force 6, rough seas. I am thrown around and frequently woken by the ship’s pitching and rolling, the fleeting feeling of weightlessness as she teeters on the peak of a wave before plunging with a crash into the trough behind. Through the hatch from the main cabin I can see the others illuminated by the red glow of the gyrocompasses, against a backdrop that alternates between the grey night sky and a black wall of water as the ship pitches on the waves. Feeling terrible and conspicuously useless, I head back to my bunk, try and brace myself in such a way as I won’t be chucked about, and wait for morning.

End of an era at 26 Maples Street

Rummaging through my virtual filing cabinet the other day I came across this. I must have written it in about 2000 or 2001, not that long before I too was on my way somewhere else. I quite like it, for all the 23-year-old I was when I wrote it, and all the things that were happening then. So here it is, exactly as it has been lying around all this time, gathering only electronic dust.


Maples Street

End of an era at 26 Maples Street

To catch a fleeting glimpse of Julie James you must be as quick as she is… 48 hours in the country and the lists have been written, neatly pencilled with occasional spelling errors, belongings have been piled in easier to reach locations. Father is to be arriving with moustache and van at some point soon, laden with the responsibility of transporting the slower moving pieces of Julie James back to Wales, the old country, back to where they will sit like attic-bound remnants of a dead relative, gathering more dust than Julie James, far slower than her shadow that even now is winging its way to Asda, then London, then China, the world.

The sun still rises on Maples Street, and bathes our side in light so that the pale Victorian brickwork has a venerable feel; not worn and broken, as it is at the height of the kids where they can scratch and carve, but of that which has seen many things and many people pass twist and turn through time as if flashing by a moving car; world wars whose lying pied pipes walked so many young men off to war and death in a far flung field; coronation parties where red, white and blue streamers fluttered where now hangs telephone cable and gutter; or our summer exodus of revellers in vehicles, of lying on tarmac facing the darkness of an old coach’s guts, tap-tapping on corroded steel and avoiding flakes of rust and grit that fall in your eye, before piling equipment, functional, broken, objects of uses known and unknown, all stacked and inventoried and then away… over the concrete blocks that create the cul-de-sac that is our street, turn left onto Radford road and then on into town, or another country, one of our own choosing… or one of our own making.

There’s still time for things to change on Maples Street, where the coal lorry still drives around on Thursdays, still time for life here to be perhaps as it was in times of bunting and war. Now there is only black chisel markers, Laura woz ere, who’s 4 Speckie and who isn’t, burnt out cars and the war that exists in the backyards of a street in a city in a country like this. Always travelling uphill, with kids in tow, and poverty and the DSS whispering failure in their ears. Always a fractured community eking out their fragments of life so that they go further between them all. Always wrapping a Nova 1.3 GT in racing green around the lamppost at the bottom, because there’s nowt else for them to do, not in reality nor in their heads neither.

But Julie James is already gone – floating through on her way to another sketch, one this time on the other side of the world, in a place too dissimilar to conjure straight images, only ones that stem from the propaganda we absorb, fed as we are on a cathode ray nipple from birth till death. Send me a picture of men in blue boiler suits and flatcaps, I say, let me see that there is some element of China there, that the world over has not become the slave to capital that it seems. There’ll be no more of her glorious returns from abroad with brown legs sticking strident from mini skirt, nor Welsh lilting laughter from downstairs. Only a coffee table remains to remark upon her three years here with me, three years in a street that causes raised eyebrows and consternation in those that knew only the postcode, not the reality. But to Julie James and I it was a time of sunshine on redbrick and Special Brew on the wall, street furniture for our street people. Doors always open like an old world your grandma tells stories of, dogs wrestling with each other, always music from somewhere, litter rustling up and down the gutter in the summer breeze.

But this is in the past and the van that has pulled up is firmly in the present. Father (and moustache) and mother, back in number 26 for the first time in three years, calling by this time not to bring but to sweep away the traces of Julie James. Three years of artwork adorning the walls leave the faintest outlines. Three years of furniture acquisition and the hoarding of items with uses actual and imagined, all flushed through the narrow hall and into the waiting van. A civil cup of tea, a chat about our futures, and Shawn the rat, Julie James and the Jameses are gone forever.

Proper British language tools in Libreoffice

UPDATE March 2013: It seems something has broken this way of setting up the British English dictionaries. Skip to the bottom for my suggestion.

An annoying and apparently long-standing bug in OO/OOo/Libreoffice is that a British English dictionary and thesaurus are absent, and won’t appear even after trying all the usual, obvious routes.

The option under Tools -> Language Tools -> Thesaurus stays greyed out regardless of what packages you install, and crucially all the packages you’d expect to install to solve the problem – hunspell-en-gb, hyphen-en-gb, mythes-en-gb, for example – don’t exist, even though other anglophone alternatives such as en-au, en-ca, and even en-za, do. Installing British English dictionary/thesaurus from the Libreoffice Extension Manager website doesn’t help either. Installing the libreoffice-l10n-en-gb localisation package only fixes the Libreoffice interface and suggests the obsolete en-gb versions of language tools above that don’t exist, which only adds to the confusion.

The answer is that the en-gb dictionary and thesaurus is included within the en-us versions, something made clear absolutely nowhere, although it is alluded to obliquely, for example:

$ sudo apt-get install mythes-en-gb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mythes-en-us' instead of 'mythes-en-gb'
mythes-en-us is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

This is explained at the bottom of this bug report, which also details a handy, albeit dirty, fix.

1. Ensure you have the guts of the programs you need to use spellchecking and thesaurus at all:

$ sudo apt-get install libmythes-1.2-0 hunspell

2. Next you’ll need to install the en-us versions, as they contain the en-gb versions (you could do this all in one apt-get install command, I’m just making it clear):

$ sudo apt-get install mythes-en-us hunspell-en-us

3. Finally, create symbolic links between the en-us and non-existent en-gb versions so that Libreoffice sees them.

$ cd /usr/share/mythes/
$ sudo ln -s th_en_US_v2.idx th_en_GB_v2.idx
$ sudo ln -s th_en_US_v2.dat th_en_GB_v2.dat

And that should do it. Restart Libreoffice, and check in Tools -> Options -> Language Settings -> Writing Tools that by clicking Edit you can see ‘OpenOffice New Thesaurus’ has appeared under the Thesaurus category. The Thesaurus option should now have reappeared, so you can press CTRL+F7 to bring up the dialog, make sure you select English UK from the Language box on the right (otherwise it displays results from both languages) and look for a Britishism like ‘grey’ or ‘colour’. It’s all there, apart from “a lot of the British swear words“, apparently – but then Americans never did have a clue what bollocks were anyway.

(thanks to Tom Brossman for spotting a stray hyphen typo in the package names)

UPDATE: I’ve tried playing with the Libreoffice dictionary extensions again and still can’t get them to recognise the difference between UK/US spelling, as they unhelpfully accept both. For sanity’s sake I’ve elected to start over with a package that actually does what it says it will (as mentioned in the comments). So:

1) Remove the US dictionary hunspell-en-us (but not the core hunspell spellchecker):
$ sudo apt-get remove hunspell-en-us

2) Install a GB dictionary – hunspell is backwards compatible with myspell, they use the same format:
$ sudo apt-get install myspell-en-gb

Notice that it actually installs the dictionary in /usr/share/hunspell, not /usr/share/myspell/dict – presumably because it recognises that we’re using hunspell (it’s installed) not myspell (it isn’t) as the spellcheck engine. Instead it puts links into the myspell directory for compatibility.

3) That’s it. Keep mythes-en-us (or install it if necessary: $ sudo apt-get install mythes-en-us) because it does actually include GB spellings (you can grep the files for colour, theatre, specialise, etc), and as long as the symbolic links to the non-existent GB thesaurus files (as in step 3 above) are in the directory, Libreoffice will recognise it, and will show Hunspell (UK) and Thesaurus (UK) modules enabled in Tools -> Options -> Language settings -> Writing aids.

Avoiding package meltdown with APT source pinning

Debian’s release cycle is pretty sedate, which means the distribution you have installed will be solid and stable, but there will undoubtedly be more recent versions of programs available than you have installed. The safest and most easily reversed way of locating and installing the latest or at least more recent versions of software is to point the apt-get package manager to the Debian repositories that contain the upcoming Debian distribution releases, using apt’s sources.list file. This is how to do that.

This is done by editing the /etc/apt/sources.list file, from which apt-get reads the locations of .deb package repositories to check for updates. Typically the primary repository would be the version installed. For example:

deb squeeze main contrib non-free

deb squeeze/updates main

The Debian release cycle is made up of three distributions:

  • the current, stable release (currently squeeze, but referred to as stable)
  • the next release undergoing testing (currently wheezy, but referred to as testing)
  • the experimental release being actively developed (known as sid, but referred to as unstable).

Additionally, some more recent versions of applications from testing and unstable are repackaged for the current release, known as backports and made available from the backports repository. We can add these to sources.list, for example:

## DEBIAN TESTING (wheezy)
deb testing main contrib non-free

deb squeeze-backports main contrib non-free

Running apt-get update will send apt-get off to prepare a new list of packages that can be upgraded or installed. But running apt-get upgrade with the sources.list looking like this would result in installing an unholy mix of possibly conflicting packages from different repositories. To safely use this technique, we need to also edit the /etc/apt/preferences file. It looks like this:

Package: *
Pin: release n=squeeze
Pin-Priority: 100

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

Package: *
Pin: release a=squeeze-backports
Pin-Priority: 10

See the manpage for apt_preferences for chapter and verse on how this works, but the key part is the pin-priority. Sources pinned with a higher priority will be selected over lower priorities. Sources pinned with a number below zero – such as the testing repository above – will never be used except when specifically called with apt-get -t . So to install the latest version of a popular music player from the testing repository to replace the version in the current, stable branch, you’d use:

sudo apt-get -t testing install audacious audacious-plugins

This method means you can have multiple repository sources lined up on the system, to be called upon when required. Running apt-get dist-upgrade will still only use the default repos (squeeze, in this case), whereas apt-get -t squeeze-backports dist-upgrade will upgrade every package available from the backports repo, and apt-get -t testing dist-upgrade will attempt to effectively replace the current stable distribution with that of the testing release.

A good addition to note is the --no-act switch – Not only does it prevent apt-get from actually making any changes, but it also verbosely states for each package it suggests changing which repository the upgrade will come from, allowing you to track which version is coming from where. The end result is a system whose package structure is much more easy to upgrade or manipulate than if we had downloaded the most recent version and compiled from source.

Extract from a 23 hour travelogue courtesy of Greyhound


With visibility at barely 100 yards I couldn’t tell you a great deal about Ohio. It looks pretty flat, snowy and windy from here. Waking up creased and uncomfortable, Cleveland has a lot of work to do to ward off my rising rage, and the bizarre glut of heavy steel cantilevered bridges, as if they were a fad everyone wanted to be part of when they were built, aren’t cutting it. There are US flags on everything, from bus stations to bulldozers.

Outside downtown Cleveland, modern highrise become timber houses with pointed roofs swooping at a steep incline to persuade the snow to slip down, or bungalows squatting among the trees as if stooped like gleaners against the wind.

The road is lined with alder, birch, spruce and pine. Gusts of wind tear the powdery snow from roofs and trees and cars, creating wispy gauze phantasms that thicken and haunt for an instant and are gone. The storm covers everything in a flat whiteness, and the only contrasting colours come from the gaudy logos of fast food joints at the motoway turnpikes.

A pretty town with a pretty name, Elyria’s street is lined with well kept classic timber homes that exude turn of the century Americana. It also boasts JR’s Gospel Gift shop.

Beyond the towns is… nothing. The odd barn, grain silo, farmstead. But, even when the clouds lift to reveal the landscape miles away, all that can be seen is the vast expanse of the plains; barely any more, you feel, than would have been seen by the Sioux or Algonquians Chippewas and Sauk tribes who walked these routes between the lakes centuries before.


see Ohio.

New York


Night becomes day while I slip in and out of a truly uncomfortable sleep despite Greyhound’s claims of extra legroom and comfort, for which they congratulate themselves heartily whenever possible. Outside is a bland cityscape – a hinterland-scape – of turnpikes, roadside diners and McDonalds, nondescript housing and brown inbetween-land somewhere in New Jersey. But my heart skips a beat when I turn to see, stretched across a window of bright skyline carved out against the barely lit foreground, the crests of Manhattan’s spike-topped tower blocks and domes.

A sharp turn flings the bus into the Lincoln Tunnel, an entrance that shares the great square brownstones and muscular turn-of-the-century style as the city’s tenements, while inside its honeycomb white-tiled surface feels barely high enough to hold a modern supersized bus. The yellow sodium lights flicker flicker hypnotizing orange as we advance through the tunnel, and I awake with a start only minutes later at the base of a giant tower block at the Port Authority Bus station in the heart of Manhattan island and the middle of the madness of the city.

“Welcome to New York City”, says our driver Jarrold, a south Asian Montrealaise. “Sorry for the delays. Because of those officers at the border, we’ve been together almost 11 hours,” he chirps irrepressibly. “If they do that again, we will fire the lot of them.”

“Goodbye, have fun, enjoy Detroit”, says one of the group from Montreal who has come down for New Year’s Eve, as I have. She laughs at her own words, thinking on my travel plans to the motor city. “You know when you just can’t believe what came out of your mouth?”

One bag, two bags, three bags, coat. I struggle out of the surreal underground car park that is the bus terminal, built over several floors with road exits emerging at several different heights above ground level. I have no idea how that plugs into the rest of the city. New York City planners have clearly been hitting the meth pretty hard. I see a sign that says 8th Street and head towards it, only to be faced with turnstiles. An automatic gate opens from the other side and I walk through it. “Excuse me sir,” comes a firm voice, and I turn to see a sturdy female member of NYPD’s finest beckoning me. “You have to pay to come in here.” “Where’s here?” I ask, wide-eyed. Her eyes smile even if she doesn’t as she redirects me out of the subway and up to street level, another first timer inhaled into the city and sneezed out onto the streets.

The first thing I see at street level is the New York Post building, a modern skyscraper wrapped in fine steel gauze thrusting up with journalistic integrity from among lesser buildings. Modern towers and stone and brick buildings from two centuries ago jostle for space along the streets, where the height of adjacent buildings careens wildly up and down depending on, apparently, nothing.

I am heading to 6th and 31st Street. I am at 8th and 46th. I stride off. Wearing one bag and carrying two others I am a wide vehicle from whose bow-wave pedestrians have to move. In combat jacket and bags as far removed from Louis Vuitton as can be imagined, I feel like a human White Van – battered and in the way, but would you argue with it when moving aside is easier? I eye up street stands selling pastries and coffee, but the weight on my back demands to be dealt with first.

Cars are everywhere, but go nowhere. Having a horn is a sufficient reason to use it. At 8 degrees it is a full 15 or even 20 degrees warmer than the snowy Montreal I left behind almost 12 hours ago. Snatched conversation slips past my hood, American, Spanish, city speak. “An’ did your driver give you directions? Nawh, he did nawht”, someone behind me says rhetorically, loudly. A middle-aged businessman in a suit strides past in earmuffs. Three streets later I see a young, pale, wiry latino with gaunt cheeks and sunken eyes rocking a very different look but wearing the same utilitarian black ear muffs. For two so completely different styles, either one of them must be doing it wrong or earmuffs have a broader appeal in this city than I’d imagined.

40th, 38th. The streets tick down. But which way is 6th from 8th? I stop and ask. “6th Street? Well this is 36th Street. Do you mean 6th Avenue?” My first lesson: Streets run east/west, Avenues run north/south. Off I lurch, a greenhorn again, with a pocket full of Canadian funny money and too many bags.

I cross streets at traffic lights, walking in front of hordes of yellow cabs that are corralled behind the zebra stripes like a Red Sea held temporarily in check. I fight the urge to turn to complete strangers and say: “Hi there! I’m Mick Dundee, noice to meetchya.”

Where 6th Street should be instead I find Broadway, which feels strange to see that actual signage of such a remote and yet familiar name. But it doesn’t look like Theatreland at this end. I turn into a crowd of people and find myself next to a bold brass plaque and imposing doors bearing the name Macey’s, the department store. Shoppers are looking at fantastical mechanical window displays, steam-punk creations of ice blue and white and glitter, with pale, huge-eyed marionettes playing instruments, riding rockets, dancing on strange clockwork devices. On the other side of the street, Giselle’s already preternaturally long and slender legs are elongated to biblical proportions across the length of a 50ft advertising hoarding around the Victoria’s Secret store. All bee-stung lips and smokey eyes, propped on her shoulders her legs stretch up like a ladder to Babylon; or perhaps Babel, effortlessly compressing the distance between different spoken languages into an unspoken one.

I can see the apartment building now, as a siren screams the passing of a NY fire department tender. Only a few minutes wrestling with the door locks stands between me and whatever I feel like doing after 11 hours on a bus. But the view pretty much just brings me to a halt.

Nothing says New York like the Empire State Building, and it stands close enough from this apartment’s floor-to-ceiling windows for me to see the texture of the marble fascia and the art-deco fan motifs on the window casements, close enough to see the flash guns going off from the black specks looking down from the observation deck, far above me. Just beyond that is the instantly recognisable sunburst arches of the Chrysler building peeking above its nieghbours, and to my right a tower capped with a golden spire as if it were a cathedral, but the effect makes it look like something from Ghostbusters and I suddenly think of angry Sumerian gods and marshmallows. Beyond that, resembling two giant oil well pump heads on some super-sized oil field, are the supports for one end of the Brooklyn Bridge. And in the distance, an impossibly long way away visible only because I am 35 floors up already, is more and more and more New York disappearing into smoke and haze.

Everyone in New York was once in New York for the first time. And now me.

Goodbye Montreal


Three months has gone by quickly, quick enough to remind me how quickly time passes even when you’re not having fun, and actually doing really mundane things.

Just walking around this city makes me realise how much I like it, even while realising how little I’ve scratched the surface of Montreal, or the huge expanse of Quebec – Canada’s largest state – outside the city limits. The broad streets lined with bare-branched winter trees, improbably wide North American cars, and the brick triplexes that are unique to this city (a housebuilding split into three flats with a presumably lethal-when-iced stairway to each); the alleyways between streets one can look down that keep going for miles through block after block; the cafes and bars whose names I don’t know and never visited, and all those I did; the 1960s metro, filled with modern art and stained glass, with trains running inexplicably on rubber tyres instead of rails; the easy beauty of your womenfolk, and they way they can veer from restrained European chic to dancing drunkenly on tables and bars in the blink of an eye, the tip of a cocktail.

Histoire de la Musqiue à Montréal, by Frédèric Back, 1967
Downtown Montréal as seen from the mountain.

I’ve loved the view from your mountain, la montagne, paths of crunchy russet leaves opening onto views of the steel towers of Montreal’s once important but now eclipsed business district, and behind it Buckminster Fuller’s dome for Expo ’67, the Habitat 67 housing blocks beyond the port, like a jumble of Lego blocks fallen mismatched, overlapping each other, and beyond that the vast expanse of the St Lawrence valley.

Habitat 67, designed by Israeli-Canadian architect Moshe Safdie for the Montréal's Expo '67.

I was startled by the Olympic Stadium from 1976 – a year before I was born, it’s scandalous sweeping concrete curves and towers still conjuring the optimism of a future that was imagined decades before, still hoped for despite wars in Vietnam, the oil crisis, hyperinflation, economic and environmental decay.

Le stade olympique never got its opening roof to work properly, and took the city 30 years to pay back the $1.47bn it cost lending "the Big O" the new nickname "The Big Owe".

I loved your powdery snow, snow so fine it clung to everything yet still failed to infiltrate my shoddy footwear, and I loved your crisp, wintry days – such a change from overcast Britain – where a cold winter’s day could still bring sun and blue skies and send the ladies who lunch from Outrement scuttling out to bask around coffee at café tables. I loved speaking your names in your language, like “Mo’rey’el” and “Aray-anne”, and just speaking your language in general, or hearing it percolated through a slew of different dialects and regions; Lebanon, Algeria, Morocco, Haiti, Côte d’Ivoire.

He wasn't busking. He just comes to impersonate Hendrix for fun.

I met local lunatics dressed as Jimmy Hendrix, dancing jerkily like they were plugged into the mains; Frenchmen by the score looking for work; Anglophone students from Alberta exhausted from defending themselves just because they hailed from the oil-rich west; and endless folk espousing the excellence of the Montréal bagel over the New York bagel, or viande fumée over pastrami.

But in the final analysis you wouldn’t give me a job, you bastards, and if I can’t work I can’t stay. I feel I can blame the government in part – Canada is the world’s second largest country, but has a population of 30 million. There are more people in London than in Quebec and all the Maritime provinces put together, so it seems to me there’s room to spare. Schoolboy French, a glass ceiling and a culture of jobs-through-contacts didn’t help either.

(The “working holiday” visa that would have made this process much easier is only available up until age 30 – unless you’re French or, curiously, Irish. Perhaps it’s because they’re Catholic.)

Montréal bagels: more bready, less cakey and dense as those from NYC

And so I shall see in 2012 in New York City, returning only to Toronto for a couple of weeks before heading west to Detroit and Chicago. I won’t “see the real winter” as Montrealais keep reminding me, although I’m sure that continental Illinois and Michigan are not going to be exactly tropical by comparison.

Now that's some snow.

My French has improved, for sure, but not enough, and not well enough to cope with the local dialect spoken at speed and against the backdrop of pub noise. I bought some dresses for my niece and chatted to the shopkeeper for some minutes before the question of where I was from came up, and she explained she’d only been in Montreal for about as long as I – she was Parisienne. This made perfect sense as I could actually understand her, instead of just looking increasingly baffled until the inevitable switch to English, as with the locals.

I never found my groove, my niche, my social security number nor job to get up for in the morning. Which made for a funny sort of visit, neither touristy nor living and working. The most I had to show was a morning spent doing psychological clinical trials for $100 and three days of painting and decorating.

So I leave not a penny, nary a sous, richer. But richer for the experience.

Linux on the move with acpi

Linux has good support for all sorts of varied and interesting hardware these days, right across the spectrum from esoteric mainframes to the common desktop PC. But configuring a computer such as a laptop or netbook to be energy efficient to save battery power can still be a source of frustration for linux users. Or at least it was to this linux user.

ACPI, the standard for power management, is capable of switching off or disabling devices to save power, such as shutting down wireless or bluetooth transmitters, ethernet ports, dimming monitor screens, spinning down idle hard drives and putting processors in to sleep states. This replaces the previous standard, APM. Older computers from before about 2000 support only apm, the newest computers support only acpi, with those built around the changeover supporting acpm and an incomplete acpi specification. It’s a good idea to have one or the other, and not to run both at the same time.

It has improved greatly, but power management support in linux is, as much as anything, a work in progress. Using Debian-based Crunchbang, my Samsung Q320 did not respond to acpi events at all – removing the power cable and switching to battery power did not dim the screen or scale down the processor frequency, for example. On a mission to squeeze more than 1hr 50min from my battery, I embarked on the following odyssey.

Install Acpi support

It may seem obvious, but as acpi is not a system essential, it is quite possible to run linux without any acpi layer at all. Kernel support for acpi has been included since kernel versions 2.4, and newer 2.6 kernels provide better support for more features and hardware. But you’ll still need to install the rest.

$ sudo apt-get install acpid acpi-fakekey pm-utils

This will set up the acpi daemon (acpid) to listen for acpi system events and run scripts in /etc/acpi to trigger system sleep, suspend, hibernate, and resume events.

acpi-fakekey generates fake key-press events to represent those keys providing acpi functions that are not recognised by the kernel. Getting dead keys recognised is in fact another complication in the process.

pm-utils is a distribution-neutral standardised set of hooks that can be called to trigger or resume from a sleep, suspend or hibernate acpi call, configured by placing scripts in /etc/pm/.

Add to that some utilities:

$ sudo apt-get install acpi acpitool acpi_listen

acpi is a very simple command line utility that will return information about the battery, AC adaptor, thermal trip points and CPU states, and I include it here really only because it comes with most distributions and some scripts may depend on it.

acpitool is a much more substantial acpi command line client that can query and manipulate acpi information and trigger acpi events. Some functions such as changing backlight settings are limited to Toshiba, Asus and IBM hardware.

acpi_listen runs in a terminal and intercepts and prints acpi requests as they appear, in the same way xev does for key-presses.

Hardware-specific acpi layer

With the essentials installed, we need to fill the gaps between the generic linux acpi drivers and the various function key combinations, hotkeys and extra buttons that are particular to each laptop model or manufacturer.

For those with IBM, Toshiba, Acer or Asus models, installing acpi-support may be enough: $ sudo apt-get install acpi-support, but this package has been deprecated, in Ubuntu at least. It includes a command line tool and more scripts that run in response to the non-standard buttons most laptops use to set low-power modes, hibernation, brightness settings, etc. It is configured from /etc/default/acpi-support and controlled by /etc/init.d/acpi-support. But it’s not much use for my Samsung, for example.

It turns out that Samsung laptops have a somewhat rocky history in terms of bulletproof linux compatibility. But developer Fortunato Ventre of the Linux On My Samsung project has made excellent progress carving out a functioning acpi implementation for Samsung netbooks, which by extension (mostly) works with other Samsung machines.

Add the project Launchpad PPA repository at to /etc/apt/sources.list (how to). There are several tools for different purposes, you might not need all of them. The easy-slow-down-manager lets you set the fan speed between fast, normal and silent (slow). samsung_backlight and nvidia-bl-dkms are two LCD screen backlight drivers that replace the standard and incompatible video.ko acpi driver. This will allow programs to change the screen brightness directly. samsung-tools includes a command line tool and graphic interface (samsung-tools-preferences) that can manually set up what function key combinations trigger which actions. More usefully it also provides a gui for powersaving measures, as we’ll see.

The updated udev and linux packages provide no-hacks-required support for different Samsung models by providing udev with the identifier strings for the hardware, but as mine wasn’t included I didn’t bother, and it seems to (mostly) work anyway. See if you’re model is listed in this thread.

I tried the nvidia_bl module but my Q320 didn’t like it; trying to change the brightness would blank the screen and it would refuse to come back again, forcing a reboot. So I used the samsung_backlight module, loaded automatically as the package installer compiles support into the kernel, and prevented the standard acpi video driver from loading by adding:

blacklist video

to /etc/modprobe.d/fbdev-blacklist.conf

Finally, the kernel must be told to use the new driver by editing a line in /etc/default/grub:


Followed by:

$ sudo update-grub
$ sudo update-initramfs -u

And finally, add a line to the Section “Device” clause of /etc/x11/xorg.conf:

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce G 105M"
# add line below to get brightness keys working
Option "RegistryDwords" "EnableBrightnessControl=1"

After which (on restarting X) my brightness keys worked, and the screen dimmed when I pulled out the power cord. Now that’s progress.

Power saving tools

Last of all, we need to install scripts and tools that will take advantage of this new power-saving framework by shutting down power-hungry devices that are not being used.

$ sudo apt-get install laptop-mode-tools cpufrequtils powertop

The laptop-mode-tools will add a directory /etc/laptop-mode where scripts can be placed which when triggered by acpi events will run other programs such as hdparm, sdparm and ethtool (all dependencies installed at the same time) to configure disk drive and other PCI device’s power-down timeouts or set some level of power-saving. It is configured from /etc/laptop-mode/laptop-mode.conf. It does other clever things too, such as restarting syslogd with alternate settings so that logfiles are not constantly being written to when the disk is trying idling. It is worth noting that the laptop-mode in the Ubuntu repositories is a crippled version, which the developer recommends replacing with the full Debian package.

cpufrequtils installs programs that can manage processor states, switch up or down the CPU speed according to load, and place it sleep states when idle. It also provides a means to set the CPU demand governor, which controls how aggressive or passive the CPU will be in trying to sleep.

powertop is from the official LessWatts linux acpi project from Intel developers. Like top, it shows what processes are calling interrupts and waking the CPU so you can hunt them down and shut them off to save power. Better still it provides a simple interface that identifies these programs and offers an on/off toggle to do it for you.

And with that, you should have all you need.

Tweaking and debugging

One thing to watch out for is the rate at which hard disks idle, spindown and then restart. Some drives assume a very aggressive power management mode, but if there is a lot of disk activity then the drive will be spinning down and up again every minute or less, which is going to have a serious impact on the lifespan of your drive. It is easy enough to set a less aggressive timing, the tricky bit comes in locating which program and which config file controls the setting. In this case, hdparm (/etc/hdparm.conf), laptop-mode (/etc/laptop-mode/laptop-mode.conf) and samsung-tools (/etc/samsung-tools/scripts) could all be the culprit.

$ sudo hdparm -B[1...255] /dev/sda

This will set the the power management feature of the drive, where 1 is the most aggressive power management, 254 is top performance, and 255 disables power management. Settings between 1 and 127 will allow spin-down and head parking, 128 and above will not. If the sound (and slight delay) of the drives spinning up irritates or worries you, set this to 128 or higher.

$ sudo hdparm -S[1...255] /dev/sda

This controls the idle time-out setting of the drive, ie., how long the drive will wait since the last read or write before switching to lower-power idle mode, and also how long to wait before timing out and sleeping, as in -B above. Note -s (lowercase s) puts the drive to sleep, so don’t mistype.

Esoterically, this figure represents the following: 0 disables time-out/idle mode; 1 to 240 represents multiples of five seconds, from 5 secs to 20 minutes; 241 to 251 represent multiples of 30 minutes, from 30 mins to 5.5 hours; 252 represents 21 minutes, 253 is a vendor-defined period in the region of hours, and 254 is reserved; 255 represents, bizarrely, 21 minutes and 15 seconds. Suck on that.

If laptop mode has been enabled to control all devices, check its config file for the same settings:

# Set to 0 to disable
# Idle timeout values. (hdparm -S)
# Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 20 seconds
# for battery and for AC with laptop mode on.
# Should laptop mode tools control the hard drive power management settings?
# Set to 0 to disable
# Power management for HD (hdparm -B values)

Running samsung-tools-preferences should reflect the values from laptop-mode.conf in the laptop-mode-tools dialog, with the appropriate boxes selected or blank.

For everything else there’s powertop. Run it as root and switch to the wonderfully named Tunables tab using cursors – it will show a list of devices that can be low-powered or disabled, including (on Intel-based chipsets) most PCI/PCIe and USB bus devices and host controllers, ATA/SATA chipsets and drives. Use the cursors to select those marked “Bad” and change them to “Good”. That’s it. You’ll notice the difference between running powertop on mains power or battery – there’s little point in turning powersaving on for every device when plugged into the mains, unless you really want to help save the planet by a couple of watts.

There’s a lot of very fragmented and, by its nature, very hardware-specific information about acpi around the internet. Some informative pages can be found at the Arch wiki (pm-utils, cpufrequtils, laptop-mode, Acpi hotkeys), the Ubuntu wiki (power management and troubleshooting) and an exhaustive page at IBM thinkwiki.

And what was the result of this struggle? Well, battery life of 1hr 50min rose to somewhere around 2hr 20min, and peaked at 3hr 1min, but swayed wildly between the three depending on whether I was just looking at the battery meter, or actually using the computer. What have we learned? Well, battery life estimations are largely worthless. Oh, and it turned out my battery was down to 50% of it’s original capacity, after just two and a half years. Looks like I’m staying within sprinting pace of the mains for now…

Wine, a cruel mistress – updating Debian’s ancient wine

Wine can indeed be a cruel mistress; the morning after the night before, after the sudo apt-get install has faded away and left you nothing but a jiggered system that won’t even run notepad.

I speak of course not of the mighty grape and what she gives us, but of wine (Wine Is Not an Emulator), the Win32 translation layer for Unix/Linux that does an excellent job of allowing Windows programs to run natively on Linux, often at great speed and without problems.

And sometimes with problems. If you run Ubuntu or Fedora, you’ll be blessed with recent updates from the 1.3 beta versions of wine, while the official stable version has languished at 1.2 for what seems like an eon. If you use Debian, then apt-get will only provide you with the even more Jurassic 1.0.3 version from the current stable (squeeze) repositories, there’s nothing in debian-backports, and even the upcoming releases in testing (wheezy) and unstable (sid) are only minor 1.x version bumps. You can do a full search of Debian distribution package list to see the tale of woe.

The reasoning behind Debian’s exceptionally cautious nature and glacial pace of rolling out updates is well known and well founded, and wine is hardly a core package. But that doesn’t help in the slightest when you really, simply, absolutely have to install and run Deathspank right now, and older versions aren’t cutting it.

Naturally, there are ways and means. Linux is more complex; but with complexity comes flexibility.

There are a couple of options for Debian users that offer a relatively pain-free way of using updated wine binaries and libraries without the risk of doing something terrible to the system.


Debian, winehq-approved packages

Debian packages created from the latest wine builds by Kai Wasserbäch can be found on his page at These are the latest builds, currently 1.3.33 for i386 or amd64 architectures, released today, and officially sanctioned by winehq.

Rather than setting up an apt repository (as he points out, “I don’t want to encourage people to install binary packages from third parties without thinking about what they’re doing”), the individual files are listed for download. You could just click each one, but it’s nice to get the computer to do the work for us. While wget won’t accept wildcards when downloading using http, so we can’t use a regexp like *wine*[your_arch_here], we can use a different method.

First highlight and copy the text list of packages from the webpage for whichever architecture you need and paste it into a text file. Using gedit or vi will neatly remove the bullet points leaving one package name per line, just as we want it. Name the file something memorable and recognisable, such as say, zig. Then type into a shell:

# wget --base= --input-file=zig -P libwine

This gives wget the base URL to work from, the list of files to download, and –P tells it create or use the directory libwine to store the files. Add the full path to zig if required, and you can substitute -B for --base and --i for --input-file.

Once you have a neat directory of .deb packages, you have to install them. apt-get is for querying and installing packages from the main Debian repositories (or other repositories you have added to /etc/apt/sources.list). For manual installation use dpkg, which usefully can be pointed at a directory and told to get on with installing a bunch of files at once:

# dpkg -R -i libwine/
# dpkg -i libwine/*

achieve much the same, where -i selects for install and -R tells dpkg that -i refers to a directory, not a file, which is why in the second example the asterisk wildcard (*) is needed to refer to ‘all files’.

But dpkg doesn’t provide hands-free dependency handling like apt-get, so it may be that some of the wine packages will fail to install due to unmet dependencies or version clashes. It’s easy enough to work out what it wants from the output given on screen, search the Debian package list for the updated version, download and use dpkg to install as before – but if you’re unlucky, that process that could potentially continue ad infinitum, ad nauseam. For what it’s worth, running Debian squeeze I needed only two: lib32ncurses5_5.9-4 and lib32tinfo5_5.9-4, both available from the testing repository (change the distribution drop down box to ‘any’, and search). It’s worth using the --no-act switch while using apt-get and dpkg
to dry-run without installing, giving you not only a chance to review what is happening but also precise details of what file version is being pulled from which repo.


Ubuntu Wine Team PPA packages

So far so easy. It’s certainly preferable to use packages built for the version of Debian you’re using, or at least a version of Debian, but if that doesn’t bring the results hoped for there’s always Ubuntu to turn to. With a large installed user base, more resources and a quicker release schedule than the Debian team, Ubuntu packages are mostly interoperable and tend to be packaged with the less-expert user in mind. For example, the Debian packages above weighed in at 59 Mb, while apt-get install issued at the Ubuntu wine PPA tried to pull in over 200 Mb of dependencies and support packages to make sure things work smoothly, including the very useful winetricks. Too much, I hear you say? Well it (wine 1.3.26) worked for me while the Debian packages (wine 1.3.33) didn’t, so the proof is in the pudding.

I’ve explained how to use Ubuntu Launchpad PPA repositories with Debian here, and the same applies. Briefly:

1.    Go to the Ubuntu wine PPA archive.

2.    Click on the green ‘Technical details’ tab, select an Ubuntu version and copy/paste the deb and deb-src lines into your /etc/apt/sources.list file. I’ve used the last long term support version, Lucid.

3.    Copy the GPG key (the part after the 1024R/) and add it using apt-key, then use apt-get update and apt-get install wine1.2 or apt-get install wine1.3 to install wine, depending on how wild, up-to-date and un-Debian you’re feeling.

Finally, run winecfg to prompt wine to autoconfigure, use the GUI to make any further changes and then see what works, using winetricks to install Microsoft packages such as msxml3, msxml4, msvc60, gdiplus, etc. if needed. There’s a lot of information on what works and what doesn’t, tips and tricks at

Note: it’s worth mentioning that there is another repository of updated Debian packages including wine at, which appear to be different builds of equally up-to-date versions. And another is the Mepis Linux distribution, based on Ubuntu/Debian, for which repos can be found at You’re mileage may vary as I’ve not tried either of them.

Things what I have seen in Montreal, #3

Cuisine edition: Quebec of course, being French-ish, has a long and glorious history of fine cuisine, masterfully prepared dishes of exquisite beauty and a general cultural appreciation of fine food that surpasses other, lesser nations. Here, then, are some of said cultural gastronomic treasures.

The first, go-to constituent of traditional cuisine quebecoise is equal to anything the French can muster:


Poutine, as you can perhaps tell, is in fact chips and gravy. You know, like you get in fish and chip shops in the Midlands. The difference is that this is served with cheese curds. I’m not wholly sure what cheese curds are, though I have in mind to ask one of my friends who no doubt makes her own cheese in her spare time. But they taste pretty good, and the alternating feeling of jostling a hot chip around your mouth and occasionally biting onto a cold curd is quite interesting. It’s still chips, cheese and gravy though, whichever way you look at it, but like a Royal with Cheese, poutine is sufficiently popular for the big boys to want to cash in on the action:

Chez BK, indeed.

Another speciality local to Montreal is viande fumée. In the same smoked, boiled, kosher, Jewish-style beef tradition as from the mighty Brick Lane Bagel Bake, this is essentially the New York-style, thin-sliced pastrami. Even describing it as such is enough to have the viande fumée SWAT team kicking my door in, so I must clarify that it is not the same as New York pastrami, but is of the same tradition, and so a bit different from the vast slabs of thick cut smoked beef served up 24-hours a day in Spitalfields. It’s pretty good; hot, meaty, not greasy (because it’s boiled) but deliciously unctuous, and while technically served as a “sandwich” it arrives as a huge plate of meat with a light dressing of bread. Loads of mustard and a cornichon are essential extras.

Montreal's viande fumée

This is from Lester’s, a quite up-scale place at the end of my road (everything is quite upscale in Outrement, even the cornershops. It’s full of children’s clothing shops and hasidic Jews too, talk about leaving home to arrive at the same place, but that’s for another post). However, the place to get your smoked meat sandwich is Schwarz’s on St Laurent, which is always packed, often has a queue of 30 or more people lining up down the street, and is so famous it even has a biography:

You bought the meat, now read the book

At lunchtime after college, I like nothing more than to pop into one of the local restaurants where standing is the norm to pick up that great North American staple, the hamburger:

Bun's - bringing you quality cheap eats

Served with a six-inch-long gherkin, which they call a cornichon – despite not being the delicious, crisp, crunchy, French-style cornichons available in England, that I spend hours searching for fruitlessly in Turkish supermarkets. This restaurant is called Buns, the burgers are $5, delicious, and – read it and weep people – the cheese is free. There’s a girl who works in the Rue St Laurent branch (“Halifax girl”, because she told me she’s from Halifax) who I talk to at the end of every Friday night and who looks more and more miserable each time. I assume this is because summer is over and this means she’ll be going back to Halifax, rather than it being the cumulative effects of talking to me.

From the supermarket:

The horror.

Everything you heard is true.


Italophiles among you, get your head around this:

I'm sure this wouldn't be allowed in Italy. Am suppressing the urge to say 'zoinks'.

Not a pasta style I am familiar with.


And I saw this on St Catherine’s Street, the main drag through down, where office workers need to be fed and fed quickly. Sometimes you just need to eat quicker than the style of food you feel like eating will allow. For these occasions, there is KONOPIZZA:

Konopizza - for when you really need to hold a small, conical pizza
in one hand while doing something else

Cone? Pizza? Konopizza! Simples.


Finally, cliché though it is, I have to mention the tea situation. I walked around the old port a few weeks back on a sunny Friday and stopped off after hours of photographing churches and looking at ruins and bones and stuff for a cup of tea and a sit down. Everyone seemed to be ordering coffees with long and complicated sounding names, but my heart soared when I saw “pot of Earl Grey” on offer. It arrived looking like this:

Not what I had in mind.

A bowl. I am expected to drink out of a fucking bowl, and a tiny one at that. Canadians, bless them, have mistaken tea for some kind of romantic or pre-harakiri ritual to be solemnly observed, rather than the life-affirming, loin-strengthening, massive-mug-draining, utterly commonplace and without faff quotidian thing Brits know it to be. Needless to say, it didn’t come with milk either.

The situation in the supermarket is no better:

Not impressed.

See how much tea there is? Wrong. NONE OF IT IS TEA. It is all blueberry extract with ylang ylang and bullshit like that. Shelf after shelf of the crap. The only things I could find that remotely looked like tea were the bizarrely named Orange Pekoe Tea (Tetley and Salada), or the equally bizarre Twinings Irish Tea:

I feel Twinings have reneged on their Englishness for commercial reasons.

So here I am, in the Francophone side of town in a deeply Francophone state, and lo and behold, manufacturers have twigged that perhaps marketing your product as English Breakfast Tea might not be a moneyspinner. But everyone likes the Irish, right? Job done. A mere $4.50 for 20 bags, the swines.

Of course, with one of the highest numbers of restaurants per capita of any city in the world, Montreal also has a boatload of world class, internationally-renowned eateries. None of which I shall be visiting.

The storm before the calm


There is a moment of doubt before taking your first pill, your first line of something, your first tightly wound rizla bomb or acid tab. There is, at least the first time, a fractional moment when the possibilities of what may or will happen swim up to the forefront of your mind, suddenly thick with doubt as you lift the narcotic to your lips, the pipe to your mouth, the note to your nostril, whatever. Do you jump? Will it ever be the same?

That moment passes, but is replaced by another soon after. The woozy feeling of the drug’s fingers reaching up through each artery, from the pit of your stomach, driving a flutter to the heart, before reaching your mind: vision swoons and sparks, colours phosphoresce, perceived distance expands and contracts. Before mind and body are taken hostage completely, before you submit to the experience willingly or not, there is a moment again of doubt – tinged this time with panic, or fear. Because now it is in you, and no matter what your poison, you must run the course.

There are other times, other occasions that recall these moments. Moving to a foreign country with nothing but the clothes on your back and a sense of – potentially misplaced – optimism is one of them.

The prospect is exciting from sufficient distance, but looms larger and more real as the date approaches. Practicalities to be ticked-off preclude too much thought. The elation of arriving somewhere new or unusual carries you so far, but after the tourist sights have been seen, after days wandering town drinking small beers and coffees, taking photos of buildings, looking in windows at things you won’t buy, looking at people you won’t – or can’t – talk to, coming back each night to a hotel room, there is an emptiness that quickly grows to fill your days in lieu of anything else.

As adults, we don’t often have the experience of being alone, without friends or contacts. The first day of a new school, first day in a new town – these are experienced usually long ago as children, and at the time come with the support of family and friends from other places. So it was with some surprise that I realised the last time I was in this position, I was nine years old. Of course there’s Skype and email and Facebook, but it’s not the same. It’s at times like these that you realise what social animals we are.

Without purpose, without a social network to hand, with a language barrier and with the days growing shorter, it’s easy to focus only on what isn’t working. And it would be easy to succumb to that, to jack it in and take a route back to easier, familiar ground. But that would serve no purpose. I don’t want the feeling of safety; I’m looking to ride out the need for it, landing the other side. There either will be buried reserves of strength, stamina and optimism that can be tapped, new skills and discoveries that will alter the way I approach the world in the future, or there won’t.

I’ve taken the jump, swallowed the pill. I’m over the wave of panic, and I’m looking up. And I absolutely, categorically, hope everything will never be the same again.

Things what I have seen in Montreal, #2

This beast was just left on the pavement outside my hotel, along with piles of other detritus that had been tossed out of a flat that was being gutted. A lot more interesting than old saucepans and mattresses though.


It still seemed in pretty good nick too, complete with ancient 1970s (?) circuit boards inside that looked like some kind of 6th form electronics project to modern eyes. But looking closely revealed this:



So there you have it. I am going to rename this blog, Leslie on Reverb. Actually Bass Swing Bass Walk also has a certain ring to it.