I have a feeling that this has been discussed previously in this forum. e.g. Cellular connection anomalies - #8 by Whe3zy but I feel as if there are others that I can’t find right now.
I don’t think there are good answers in respect of downloading packages but you can at least partly control this by any one of:
- adding a route
- a web proxy for
aptto use (but that is a heavyweight solution) - probably with your own interface up/down hook scripts (and that might work around the problem more widely)
where control here means to make it impossible for it to download a package except via WiFi.
(The good non-existent answer would be to configure apt to Acquire::Bind to a specific interface.)
And as noted in that very old topic linked above, you need to understand your IPv6 scenario. However I believe that you can outright just tell apt to use IPv4 only if IPv6 is also available.