Wednesday, February 24, 2010

ppa package users and NO_PUBKEY - Dell laptops in particular

If you are seeing messages like:
'The following signatures couldn't be verified because the public key is not available'
when you attempt to update your Ubuntu machine then read on for what to do.

In particular Dell laptop users who have manually upgraded their distribution will likely keep seeing this message until they issue apt-key add

There is no mystery in all this and the message 'GPG error: http://ppa.launchpad.net' gives you a fair clue as to what is wrong I think.

In short you are consulting a ppa package repository aswell as the regular Ubuntu repositories. Message example here:


Steps to solve (illustrated in next few paragraphs):
  1. Get the missing key from a keyserver
  2. Add it to your local key store
Before attempting to get the key from the keyserver you might need to disable any firewall you run. Keyserver ports are quite rarely used, so it is possible your request will be blocked if you have a firewall active.


( The above is a fair illustration of a machine with no firewall running )
Command to check your machine: sudo /sbin/iptables -n -L

Now you can get the key from the keyserver:


( Click on the above image if it blurs on your screen or simply paste following command )

gpg --keyserver keyserver.ubuntu.com --recv 8B9FBE5158B3AFA9

Now to add it to your local keystore you will need an apt-key add perhaps like the following:

...which I repeat in convenient form here:

gpg --export --armor 8B9FBE5158B3AFA9 | sudo apt-key add -


If you get back an 'OK' message then your key was added to the local keystore and your next attempt to update will not see NO_PUBKEY messages :)

Note: All command examples in this post assume the ppa key you are missing is 8B9FBE5158B3AFA9. If your key is different, then just replace the key id I am using (which ends in AFA9) with the key id you are seeking and go that way.

*** End of main article ***

Footnotes: If at any point you witnessed a message that said 'unsafe ownership on configuration file...' then I write a short explanation in the next few sentences.

The gpg export command needs to be executed with your own privileges as by default only your userid can see the contents of ~/.gnupg/gpg.conf

running sudo gpg --export rather than the correct gpg --export command will trip you up.

Sometimes messages like 'WARNING: unsafe ownership' will make you wonder about your security setup but satisfy yourself that your ~/.gnupg/gpg.conf file really is only readable and writeable by your own user account with a simple ls command:

ls -l ~/.gnupg/gpg.conf

...which should show permissions like -rw------- if all is in order

Comment: My Dell Laptop (Inspiron 1525) came preinstalled with Ubuntu 7.10 (Gutsy) and had the relevant ppa keys from Day 1. When I manually upgraded to newer distributions, I choose to leave my preinstalled system behind, and this required me to add appropriate ppa keys .

Saturday, December 26, 2009

Ubuntu on Dell Laptops - Auto shutdown at 5% battery

If your Dell Laptop came preinstalled with Ubuntu it probably had nice
shutdown setting from Day 1.

If any of the following apply then you may not have the auto shutdown setup ideally:
  • You installed Ubuntu on your Dell Manually
  • You have upgraded your version of Ubuntu
  • The battery you are running with is not the original
(Explanations for the above are given at the end of this posting)

By default, the settings on my preinstalled Dell, were such that at 2 minutes battery life remaining, the thing should shut down.

I now show some settings which I would recommend and then comment at the end regarding the defaults.

Firstly change
use_time_for_policy


so it is not checked...

(the images can be clicked to make them zoom in bigger if on your screen they blur)


...which has the effect of making your system look at percentages instead.

Now change the percentages to the following numbers:
And now your system is set to Auto shutdown at 5% battery.

Some (optional) extra reading now follows, regarding the original settings.

Ubuntu/Gnome has three thresholds which are 'action', 'critical', 'low' and in normal running your system would hit the 'low' threshold, then if still draining you would hit the 'critical' threshold.

Finally when the battery is almost out of juice entirely, the 'action' threshold (the point at which your system will shutdown) is encountered.

Here are the unchanged settings that my system had originally:

...and frankly they are less than ideal for several reasons which I now elaborate upon.

(1) Firstly by using time_action, time_critical, time_low the system is relying on estimations which are at best rough guesswork. By changing use_time_for_policy to be unchecked we are now avoiding this time based stuff.

Time based thresholds work well if you are running an unchanged system and your batteries are well know to the system*

(*Batteries in regular use which have had a couple of full charge and discharge cycles are just fine)

If however your batteries are replacements and/or the system has not got enough historic information, then any time remaining estimates are very much guesswork and using time thresholds may be unreliable.

If you have upgraded your system (and/or installed new versions of power manager) then the battery history information may have been emptied out. Without history the power manager is pretty helpless at the time based stuff.

(2) Having auto shutdown at 2% is in my opinion skirting a bit close to the edge. Alright you might have a battery that really does report it's percentage remaining very well. Even so for a 3 hour battery (pretty typical) 2% remaining is 3.6 minutes which is not a lot really.

As your battery ages it's percentage reporting might become less reliable also. Having a setting of 2 minutes (time_action = 120) is not a setting that I would like either.

Having 5% for the percentage_action and 7% for the percentage_critical gives me 3 to 4 minutes to save my work nicely before the system does an auto shutdown.

I want to be warned at 15% (around half hour to go) so that I can get to somewhere with a socket and plug in.

These settings are just my preferences, and you will have your own ideas of good percentages to use that suit your own working style.