Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

There is a known behavior of anacron not to run when the laptop is running on batteries. Is there any way to stop this behavior and run anacron whatever the power state?

share|improve this question
Are you sure it's up to anacron ? cron.daily/apt, cron.daily/mlocate and cron.daily/apt-xapian-index do call /usr/bin/on_ac_power explicitly to check whether the script is being run on a battery. You could probably just comment these conditions within those scripts as a solution. – user40613 Jan 9 '12 at 21:28
up vote 2 down vote accepted

I found how to do this and summarized it in my blogpost

To change this behavior of anacron do the following:

 sudo gedit /usr/lib/pm-utils/power.d/anacron

and change to

case $1 in
 start -q anacron || :
 start -q anacron || :
share|improve this answer
Just edit /etc/default/anacron, and set ANACRON_RUN_ON_BATTERY_POWER to yes. You should never edit files in /usr. – Teresa e Junior Oct 19 '14 at 11:50
you may want to change this comment to an answer – ECII Mar 25 '15 at 7:57

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.