Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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

#!/bin/sh
# 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
fi

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

 
discard

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.