Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a system that I set up with Maverick and the "automatically apply security updates" setting. It is now sending e-mail on a daily basis:

Subject: Anacron job 'cron.daily' on gwen

Segmentation fault

If I manually "apt-get update; apt-get dist-upgrade", it runs just fine. Also, if I login and run /etc/cron.daily/apt it also does not give the segfault.

I did some searches on google and most of the results seem to be from 2008 and related to "pam_mount", which is not on this system.

share|improve this question

I'm betting your problem stems from insufficient environment variables in that apt script. (eg: $PATH or $LD_LIBRARY_PATH) Essentially, there's a difference between running things via cron and running them in an interactive shell. The latter gets your login environment from places like /etc/profile and ~/.bashrc. Try adding a line or two at the start /etc/cron.daily/apt to import those settings, like so:
. /etc/profile

I'll be totally honest, and point out that I'm not too familiar with Ubunto, so those file locations may not be perfect. If you're using a shell other than Bash, your personal login file may be ~/.profile, or ~/.cshrc, or even something completely different. But the concept is the same.

A related question can be found here.

--Christopher Karel

share|improve this answer
Thanks for the ideas. I agree that it seems like it's a safe bet that it's either something in the environment or related to running without a controlling terminal. A couple of notes: This cron job is something provided by Ubuntu and is meant to be running from cron, but I'll take a look at whether sourcing /etc/profile might help. When I login, I don't have any LD_* variables set. Under 10.04 this cron job definitely does work, so it's something with the job or the commands it calls in 10.10. I've put some debugging in place so I can see WHERE it fails tomorrow. Thanks. – Sean Reifschneider Dec 2 '10 at 7:22
Turns out that the reason I couldn't reproduce it from the command-line is that the script doesn't run all the components, depending on how recently it was run from cron. – Sean Reifschneider Dec 3 '10 at 13:30
up vote 2 down vote accepted

This is a known bug in the python-apt library, documented in Ubuntu bug 664514. Upstream has released a bug-fix, but Ubuntu hasn't assigned this to anyone to fix. More information and interim packages which fix this problem until Ubuntu releases a fix.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.