[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Only Download Packages via Wi-Fi if Total Download Size Over 100 MB



On Sat 22 Jun 2019 at 19:32:20 (+0700), Bagas Sanjaya wrote:
> In Android (Google Play), when a user is about to download application which its size is over 100 MB, a message is
> displayed whether the application is about to be downloaded only via Wi-Fi or continue using mobile data.
> 
> How can I configure the similar feature on apt, that is when user tried to install or upgrade packages, alert whether
> the download should continue only via Wi-Fi if the total download size is over 100 MB?

apt-get emits messages like:

  Calculating upgrade... Done
  The following packages will be upgraded:
    …   …   …   …
  9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  Need to get 52.5 MB/52.5 MB of archives.
  After this operation, 74.8 kB of additional disk space will be used.
  Do you want to continue? [Y/n]

If you wanted to automate it, I guess you could write a script to
pipe stdout through tee to some process that's checking the value and
taking action accordingly. It's the sort of thing I might do myself
if I were to have a mobile data account somewhere. (My smartphone
only uses wifi as it has no SIM, so I guess it's not really a phone.)

Cheers,
David.


Reply to: