apt-get WARNING: The following packages cannot be authenticated!

apt-get is verifying the packages before installing them.
If the keys are not up to date, then apt-get upgrade will issue a warning.

WARNING: The following packages cannot be authenticated!
  ure uno-libs3
Install these packages without verification [y/N]?

The way to solve this is rather simple, just run apt-get update and it should download the keys automatically.

apt-key handles keys, using apt-key list will show you the keys that are on the computer.

Limit the download speed of apt-get

Sometimes it is nice to limit the download speed of apt-get.

The way I do this is to create a file “/etc/apt/apt.conf.d/76download” and enter the following to it

Acquire{Queue-mode "access";http{Dl-Limit "50";};};

This will limit apt-get to at most 50 kb/s for apt-get.
Some other how to’s suggest the use of dl-limit but be adviced, dl-limit is per each connection apt-get does (normally it does 2 at a time); the one used above caps apt-get in total.

apt-get update gives the error “E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable)”

If running apt-get (or aptitude) and you get the following error:

$ apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the list directory

Then (most likely) explenation is that one of the sources have gotten a timeout and that a (cron) sheduled update task have gotten locked.
A simple solution for this is to find the cron process is locked, and kill it.

$ ps -a |grep apt
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
 3737 ?        SN     0:00 /bin/sh /etc/cron.daily/apt
 3833 ?        SN     0:00 apt-get -qq -y update -o APT::Update::Auth-Failure::=cp /usr/share/apt/apt-auth-failure.note /var/lib/update-notifier/user.d/
 3835 ?        SN     0:00 /usr/lib/apt/methods/http
 3838 ?        SN     0:00 /usr/lib/apt/methods/http
 3842 ?        SN     0:00 /usr/lib/apt/methods/http
 3869 ?        SN     0:00 /usr/lib/apt/methods/http
 4223 pts/0    R+     0:00 grep apt
$ kill -9 3833

If this happens often, then perhaps you should try to debug the sources and remove (or exchange) the source that is causing the problems.

apt-get update The following packages have been kept back

 apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  bind9-host dnsutils libbind9-50 libdns50 libisc50 libisccc50 libisccfg50 liblwres50 linux-generic linux-generic-pae linux-image-generic
  linux-image-generic-pae
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.

The message has been kept back most often means that the upgrade was kept back due to dependencies that are not met.

Some possible solutions

  • A simple way is to invoke dselect to help out with the update. dselect performs the actions necessary to realize that state (for instance, the removal of old and the installation of new packages).
     apt-get dselect-upgrade
  • While apt-get and aptitude are basically the same, aptitude is sometimes better at handling dependencies than apt-get
     aptitude upgrade
  • Another solution is to install the package using apt-get install to install the upgraded package and let apt-get install the missing dependencies
     apt-get install dnsutils

Installing Pine (or Pico) from source

Installing Pine on Debian might seem a bit tricky, but it isn’t as hard as it might look.

Due to the licensing rules of Pine (and Pico) these are not included as deb packages in the mirrors.
However the source of these two are.
Step 1 is to ensure that you have a deb-src in /etc/apt/sources.list (for instance)
deb-src http://http.us.debian.org/debian stable main contrib non-free
deb-src http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
To make Debian install from sources:
If you have never installed from source before we need to install a compiler and dpkg-dev
$apt-get install dpkg-dev
$ apt-get install gcc
Done, now we can start compiling Pine
A short note now: When building from source apt will download the source (and compile) to the directory where you start from. I think it is nice to make sure you are in a new directory that is clean from other files (and at a logical location if you intend to save the compiled package (like for instance /src/pine)
$ apt-get -b build-dep pine

$apt-get –only-source -b source pine
(now it will download and compile Pine. Be patient.
$ dpkg -i pine_4.64-3_i386.deb
Another option is downloading a deb package directly from Washington University here

Any program in the Debian archive can be compiled from sources using the steps above, important to note is that in “apt-get -b build-dep” -b means build from source and build-dep that apt should download any libraries that is needed at the same time.

Removing config files when un-installing

If you want apt to remove the config files as well when you uninstall a program (or maybe as I have removed them manually and is unable to reinstall using apt-get install)

$apt-get –purge remove pkg-name

This is a command i had to learn the hard way as I (accidenly) removed the /etc/munin (a server monitor tool) directory. After I had done this I was unable to get apt-get install to make any new config files in the /etc/ directory. Turns out that removing without using –purge (normaly) leaves the old config files (if I wish to re install later I assume).

apt-get update and key problems

After updating my installation to etch I ran into a sligt problem with apt-get.

I just got an odd error message from apt-get update
GPG error: ftp://www.se.debian.org unstable Release:
The following signatures couldn’t be verified
because the public key is not available:
NO_PUBKEY F1D53D8C4F368D5D

W: You may want to run apt-get update to correct these problems

Well, running apt-get update again (and again…) has no effect;)
What it (tries to) tell me is that the key used to verify the files in the archive was not found
The solution to this is simply

$ gpg --keyserver wwwkeys.eu.pgp.net --recv-keys F1D53D8C4F368D5D
$ gpg --armor --export F1D53D8C4F368D5D | apt-key add -
$ apt-get update

The wwwkeys.eu.pgp.net can be exchanged for any other key server that hosts the key, the only thing to note is that you should only use a key server that you feel is trusted.

Some info from Debian about this