Setting via /etc/environment
is supported because that’s where some GUI things set it (in 16.04, System settings → Network → Network proxy).
On core, snapd itself can set the proxy in /etc/environment
, which makes sense as on core snapd manages the device. This is done via snap set system proxy.http=
etc (core
is a synonym for system
here, kept for backwards compatibility).
If you have root on the device you could also edit /etc/environment
yourself, or add it to snapd’s environment if you want snapd to have a proxy that is different from the rest of the system’s.
On classic (that is, when not on a core device), snapd
won’t write /etc/environment
, but still supports setting its own proxy via snap set
. A proxy set via snap set
overrides that obtained from the environment.
Outside of their effect on the rest of the system, the approaches are (or should be! bugs might exist) equivalent, and down to sysadmin preference.