Daily Cron job 'apt' removes all repositories if un-reachable
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.
Changed in apt: | |
assignee: | nobody → mvo |
status: | Unconfirmed → Confirmed |
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