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

Is it possible to disable the automatic download of updates when the internet connection is through a 3G dongle, while still downloading them in the background when the connection is via WiFi or eth0? (Without manually changing the preferences twice a day).

I have a not-so-cheap pay-per-MB subscription, and what's even worse, the 3G coverage in my area is lousy, so I prefer to have the whole, however crippled, bandwidth to myself. I don't know if there are any other processes which use an internet connection whenever present (well, NTP, but I suppose that traffic is negligible).

I'm using 10.10 currently.

share|improve this question

Everytime a network interface goes up, scripts in /etc/network/if-up.d/ get executed. You need to find out wich interface does your 3G connection binds.
This is a snipped for samba script, that comes in Ubuntu 12.04

# Try to bring nmbd up when an interface comes up, if smbd is already running.

# Don't bother to do anything for lo.
if [ "$IFACE" = lo ]; then
        exit 0

You can disable automatic update of the package list and unattended upgrade thorugh this file (this is for Ubuntu 12.04, your files might have different names), you can search for this pair of keys on directory /etc/apt/apt.conf.d

$ cd /etc/apt/apt.conf.d/
$ grep Update-Package-Lists *
10periodic:APT::Periodic::Update-Package-Lists "0";
20auto-upgrades:APT::Periodic::Update-Package-Lists "0";

Same goes to this key

Unattended-Upgrade "0";

You can build the script that copies the "non-auto-update" version of the files, when IFACE is your 3G connection. And in any other situation, copy the normal files that you have now. Here is an example that does something similar: How do I make the script to run automatically when tun0 interface up/down events?

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.