Daily Cron job 'apt' removes all repositories if un-reachable

Bug #30215 reported by HarryW
6
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Medium
Michael Vogt

Bug Description

The apt script in /etc/cron.daily removes all repository directories from /var/lib/apt/lists/ if it cannot connect to the servers in question when run.

My site only allows proxied HTTP connections outbound. Since the root user (who runs the apt script via the cron job) doesn't have the http_proxy environment variable correctly set, whenever the script runs it finds it cannot connect to the apt servers and removes all the repository files.

I have created a workaround by adding a line to /etc/cron.daily/apt before 'UpdateInterval=0' that sets the http_proxy environment variable correctly.

I would recommend that either the default option to remove files for apt servers that cannot be contacted is removed or that a way of setting the proxy settings for automatic update checks is added.

Michael Vogt (mvo)
Changed in apt:
assignee: nobody → mvo
status: Unconfirmed → Confirmed
Revision history for this message
Matt Zimmerman (mdz) wrote :

If your environment requires a proxy, you can set this in /etc/environment or /etc/apt/apt.conf so that it is in effect while cron runs. You can also disable the nightly update in apt.conf as described in /etc/cron.daily/apt

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

This problem is fixed in dapper. If you use breezy, please use the workaround described by Matt or the software-properties application to disable daily auto updates.

Cheers,
 Michael

Revision history for this message
Michael Vogt (mvo) wrote :

Just to be sure, please let me know what distro version you are runing (breey, dapper) ?

Changed in apt:
status: Confirmed → Needs Info
Revision history for this message
HarryW (hw) wrote :

I'm runing Breezy.

Whilst the workarounds specified work to enable automated, unattended updates, has anything been done to stop the original issue which is that if the cron job can't access the update site it removes all the repository directories?

I believe it would be better to keep the cached copies and possibly fail at installation time than to completely remove the cached directories each time the update is run.

Revision history for this message
Michael Vogt (mvo) wrote :

yes, this issue was a bug and is fixed in dapper.

Revision history for this message
Michael Vogt (mvo) wrote :

This is fixed with dapper and edgies apt.

Changed in apt:
status: Needs Info → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.