Kubuntu: Rolling back a package

Kubuntu is currently my desktop OS of choice for 40+ hours a week of paid eye strain. It’s a good OS, basically Ubuntu with KDE as the desktop environment, however over the three or four years I’ve been using it the quality of the package management GUI applications has been somewhat variable.  What we have at the moment (Kpackagekit) is nice and fast, but doesn’t seem to allow rolling back of updates (although it does have a greyed out button to do so… go figure).

However, we can drop back to the command line to roll back a package. I needed to do this recently when an update to Wine stopped Spotify from working properly (the window would load but the interface would not display properly).

When Kubuntu downloads updates these are stored in /var/cache/apt/archives If we’re lucky, this directory contains the previous version of the package you want to roll back.

Change into the directory

user@computer:$ cd /var/cache/apt/archives

If you know the package you want to roll back (like wine), list the directory contents using grep to search for this.

user@computer:$ ls -al | grep wine
-rw-r--r-- 1 root root 9163658 2010-01-09 01:16 wine1.2_1.1.36-0ubuntu1_amd64.deb
-rw-r--r-- 1 root root 9242342 2010-01-29 23:01 wine1.2_1.1.37-0ubuntu2_amd64.deb
-rw-r--r-- 1 root root 9303990 2010-02-06 09:21 wine1.2_1.1.38-0ubuntu1_amd64.deb

Issue the command to re-install the previous package

user@computer:$ sudo dpkg -i wine1.2_1.1.37-0ubuntu2_amd64.deb

One quick note, this isn’t necessarily suitable for complex rollbacks with dependency issues, however you should be fine using it to roll back a single package that you know has caused a problem.

Eclipse: new Android project. Can’t select Build Type / Target

This caused a good 30 mins head scratching. When creating a new Android project in Eclipse it is not possible to progress past the initial screen as it complains “an SDK target must be specified”.  In the window you will see “Build Target” but no box listing your installed Android Versions. The area of the window normally looks something like this.

But for unlucky you, it looks like this.

Providing you know Eclipse is aware of where your SDKs live, the solution is simply to change the font size in eclipse.

Window / Preferences / General / Appearance / Colours and Fonts

Change “Text Font” and “Dialog Font” to a smaller value, dropping from 10 to 8 helped me.

Now for the rant: The “New Android Test Project” dialogue does not suffer this problem, because there aren’t as many UI elements on screen. It wouldn’t surprise me if this is a simple code error somewhere, exacerbated by the fact that most developers aren’t working on “funny” resolutions, such as my widescreen 13″ XPS M1210 Laptop.

Simply put you’d hope the application would ensure all UI components were properly displayed. At the end of the day such schoolboy-error fiddly problems are what put people off IT and software development. There seem to be a fair few people moaning about this one, so whilst buuuuuuuuugs happen I hope someone somewhere is suitably embarrassed… ;)

‘The Road’ Short Book Review

I’d been wanting to get a hold of this for a couple of years but had never actually come across it in a local book shop. ‘The Road’ is possibly the bleakest fiction I’ve ever read.  The story follows a boy and his father struggling to survive in a journey south to the coast across the wastes of a post-apocalyptic landscape. If that doesn’t sound like your sort of thing don’t be put off, there is practically nothing  in the way of scinetific or political background in the novel leading you to infer from your own knowledge and the descriptions of a world carpeted in ash what has occurred. The image in your head will be as much your own as McCarthy’s.

Having read plenty of this sort of fiction the innovative aspect here is the air of total finality, destruction and loss that permeates the story.  There is little balancing of dark and light here. Much post-apocalyptic fiction depicts a ruined world, but in McCarthy’s you find yourself wondering how long the oxygen might last and if even the bacteria will survive. Some of the scenes are truly horrible but are never unbelieveable and there is no time given to the characters for hand wringing or moralising because the concepts have become irrelevant.

It is to the author’s skill that the never properly explained mantra of “carrying the fire” that father and son use to describe retaining their ‘humanity’ as they travel from day to day isn’t hopelessly at odds with their ability to survive, which is most often down to quick thinking and more often to luck. The novel is short, due to the lack of background, slimmed down character development and lack of participants for dialogue but also only as long as it has to be to portray the story. The prose is skilled all the way through, with the final paragraph (which is more poetic than anything else in the novel) fitting as a closing thought, reward to the reader and moral of the story all at the same time.

‘The White Tiger’ Short Book Review

An innovative cross between a Dickens novel and ‘Crime and Punishment’ (without the  moral / psychological quandry of the latter being at the forefront)  ‘The White Tiger’ is the black as coal and worryingly humourous story from childhood to success of a man from the Indian “darkness”. How true to life the story depicted is might be another matter (it is fiction after all) but the themes have  a familiar air from English novels of the growth of cities during the industrial revolution and the writing is always believeable, whether depicting down trodden small village life or the habits of call centre workers servicing our own convinience lifestyle.  The fact that practically no one in the book acts in anything but their own self interest may grate on the reader depending on their own world view but it hardly comes across as unrealistic.

The author achieves what few do and you are rarely if ever skim-reading passages waiting for a dull or annoying sub plot to be resolved.  You’ll most likely read to the conclusion as quickly as you can.

Slicehost CentOS 5.3 to 5.4 Upgrade (or not much to see here)

It was with a little trepidation that I kicked this one off. However, absolutely no problems what so ever. Nice :D

Does the DFS sale ever really “end tomorrow”?

One of the worst things about being a heavy web user when it comes to shopping is that you rarely just go out and buy something. Instead you waste a substantial portion of time trying to get a feel for if you’re getting a good price, whether the company will give good service etc etc. Sometimes this saves you quite a bit of money and gets you an excellent quality item. Other times you’re just pissing your life away into a big pot named “informed consumer”.

So, on to the point. Big high street chains that constantly have a sale on are confusing. Here’s my experience with DFS and their regular “hurry! our sale ends Sunday” in the interests of saving other nervous shoppers some time.

Continue reading Does the DFS sale ever really “end tomorrow”?

Mirror’s Edge Review

Mirror’s Edge is a new take on the first person shooter genre, set in a dystopian city which on the surface looks very clean, polished and ordered. As all electronic and traditional methods of communication are monitored by the city state, those who wish to stay off the record communicate via messages couried over the rooftops by “runners”, one of which, Faith, you control throughout the game.
Continue reading Mirror’s Edge Review

Terminal Syntax highligher plugin

I’ve been looking for something like this for a while now to make my quick solutions posts more readable. Only tested it on one post so far but seems to work on latest WP and Thematic.  The little plugin allows you to display  Linux terminal input / output in a “pretty” fashion in your posts, you can also customise the user@computer if you wish. Thanks :D

yum update – TypeError: unsubscriptable object

Odd error when running yum update on my slice. This appears to be a currently outstanding bug which can be worked around by issuing a

user@computer:$ yum clean metadata

or

user@computer:$ yum clean all

The former worked fine for me. Original error shown below.

user@computer:$ yum update
Setting up Update Process
Resolving Dependencies
--> Running transaction check
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 229, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 145, in main
(result, resultmsgs) = base.buildTransaction()
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 647, in buildTransaction
(rescode, restring) = self.resolveDeps()
File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 704, in resolveDeps
for po, dep in self._checkFileRequires():
File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 939, in _checkFileRequires
if not self.tsInfo.getOldProvides(filename) and not self.tsInfo.getNewProvides(filename):
File "/usr/lib/python2.4/site-packages/yum/transactioninfo.py", line 414, in getNewProvides
for pkg, hits in self.pkgSack.getProvides(name, flag, version).iteritems():
File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 300, in getProvides
return self._computeAggregateDictResult("getProvides", name, flags, version)
File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 470, in _computeAggregateDictResult
sackResult = apply(method, args)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 861, in getProvides
return self._search("provides", name, flags, version)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 43, in newFunc
return func(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 837, in _search
for pkg in self.searchFiles(name, strict=True):
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 43, in newFunc
return func(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 586, in searchFiles
self._sql_pkgKey2po(rep, cur, pkgs)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 470, in _sql_pkgKey2po
pkg = self._packageByKey(repo, ob['pkgKey'])
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 413, in _packageByKey
po = self.pc(repo, cur.fetchone())
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 68, in __init__
self._read_db_obj(db_obj)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 94, in _read_db_obj
setattr(self, item, _share_data(db_obj[item]))
TypeError: unsubscriptable object

It’s possible that this is the error reported fixed here in RHEL. The version on CentOS doesn’t seem to have caught up yet.

user@computer:$ rpm -q yum-metadata-parser
yum-metadata-parser-1.1.2-2.el5

Windows Vista fails to copy large files to network share

Encountered a rather odd error, two HP Vista laptops failing to copy large files to network shares, these would error out complaining about being able to access the source file on the local disk, which was a rather confusing way of reporting the error as there was no problem with the local disk.  On network transfers of lots of files of varying sizes over wireless, they’d drop the wireless connection entirely.  The only way around this was to use a cable when copying files over the network.

Following a little research this appears to be a reasonably widely experienced issue with a particular Windows configuration option in some environments. You can change this using an administrative command prompt by entering the following command

netsh interface tcp set global autotuninglevel=disabled

(To open an administrative command prompt, right click on a command prompt entry on your desktop or start menu and choose “Run as Administrator”. If you use a standard command prompt to issue the command you’ll get a permissions error).

More information on these settings can be found here. What I haven’t yet come across is a KB article explaining the issue in more detail (i.e with a list of routers this may be a problem with), which seems rather unfortuntate.