Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #210243 > unrolled thread

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

Started byBagas Sanjaya <bagasdotme@gmail.com>
First post2019-06-22 14:50 +0200
Last post2019-06-25 06:10 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.debian.user


Contents

  Only Download Packages via Wi-Fi if Total Download Size Over 100 MB Bagas Sanjaya <bagasdotme@gmail.com> - 2019-06-22 14:50 +0200
    Re: Only Download Packages via Wi-Fi if Total Download Size Over 100 MB Ryan Nowakowski <tubaman@fattuba.com> - 2019-06-22 16:20 +0200
    Re: Only Download Packages via Wi-Fi if Total Download Size Over 100  MB David Wright <deblis@lionunicorn.co.uk> - 2019-06-22 21:00 +0200
      Re: Re: Only Download Packages via Wi-Fi if Total Download Size Over  100 MB Bagas Sanjaya <bagasdotme@gmail.com> - 2019-06-25 06:10 +0200

#210243 — Only Download Packages via Wi-Fi if Total Download Size Over 100 MB

FromBagas Sanjaya <bagasdotme@gmail.com>
Date2019-06-22 14:50 +0200
SubjectOnly Download Packages via Wi-Fi if Total Download Size Over 100 MB
Message-ID<ybNCV-1Jv-1@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hello Debian Users,

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?

Regards, Bagas

[toc] | [next] | [standalone]


#210247

FromRyan Nowakowski <tubaman@fattuba.com>
Date2019-06-22 16:20 +0200
Message-ID<ybP22-2Hp-7@gated-at.bofh.it>
In reply to#210243

[Multipart message — attachments visible in raw view] — view raw

You'll need to mark your connection as metered in NetworkManager assuming you're using that as a connection manager.

I'm not sure if apt queries that metered status though.

On June 22, 2019 7:32:20 AM CDT, Bagas Sanjaya <bagasdotme@gmail.com> wrote:
>Hello Debian Users,
>
>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?
>
>Regards, Bagas

[toc] | [prev] | [next] | [standalone]


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

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2019-06-22 21:00 +0200
SubjectRe: Only Download Packages via Wi-Fi if Total Download Size Over 100 MB
Message-ID<ybToZ-590-1@gated-at.bofh.it>
In reply to#210243
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.

[toc] | [prev] | [next] | [standalone]


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

FromBagas Sanjaya <bagasdotme@gmail.com>
Date2019-06-25 06:10 +0200
SubjectRe: Re: Only Download Packages via Wi-Fi if Total Download Size Over 100 MB
Message-ID<ycKWl-42o-1@gated-at.bofh.it>
In reply to#210259
So in summary:

- If NetworkManager is used, mark any connections other than Wi-Fi as 
metered (as suggested by Ryan Nowakowski)

- Write helper script for apt that check for total download size, and if 
it exceeds 100 MB, prompt whether download via Wi-Fi or continue using 
current (non-Wi-Fi) connection (as suggested by David Wright).

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web