How to install snap packages behind web proxy on Ubuntu 16.04
I know how to configure APT to use a web proxy. But what about snap?
16.04 proxy snap
add a comment |
I know how to configure APT to use a web proxy. But what about snap?
16.04 proxy snap
add a comment |
I know how to configure APT to use a web proxy. But what about snap?
16.04 proxy snap
I know how to configure APT to use a web proxy. But what about snap?
16.04 proxy snap
16.04 proxy snap
asked Apr 28 '16 at 22:42
Carlos EstradaCarlos Estrada
1822211
1822211
add a comment |
add a comment |
6 Answers
6
active
oldest
votes
snapd
reads /etc/environment
, so setting the usual proxy environment variables there works. On Ubuntu, that's done automatically for you by Settings → Network → Network proxy, so as long as you restart snapd
after changing that file you should be set.
1
Being more specific, the snapd.service file is located here: /lib/systemd/system/snapd.service
– julian-alarcon
May 26 '16 at 13:28
@darkhole one shouldn't edit/lib/systemd/system/snapd.service
, but usesystemctl edit snapd.service
. See my answer: askubuntu.com/questions/659267/…
– muru
Jun 7 '16 at 13:57
Well what if one wants to automate this configuration?
– pmatulis
Dec 19 '16 at 16:18
1
Remember, you will need to restart the snapd service before these changes take effect.
– Seth♦
Jan 11 '17 at 22:07
add a comment |
Snap uses snapd
daemon. You only need to define http_proxy
and https_proxy
in /etc/environment
and restart the service: systemctl restart snapd
.
add a comment |
There is another way to add environment variables to systemd services:
Create a folder for the snap daemon and create configuration files for the environment variables:
$ sudo mkdir -p /etc/systemd/system/snapd.service.d/
$ echo -e '[Service]nEnvironment="http_proxy=http://1.2.3.4:3128/"'
| sudo tee /etc/systemd/system/snapd.service.d/http-proxy.conf
$ echo -e '[Service]nEnvironment="https_proxy=http://1.2.3.4:3128/"'
| sudo tee /etc/systemd/system/snapd.service.d/https-proxy.conf
$ sudo systemctl daemon-reload
$ sudo systemctl restart snapd
After that you can check if the environment variables are set for snapd
:
$ systemctl show snapd | grep proxy
Environment=http_proxy=http://1.2.3.4:3128/ https_proxy=http://1.2.3.4:3128/
DropInPaths=/etc/systemd/system/snapd.service.d/http-proxy.conf /etc/systemd/system/snapd.service.d/https-proxy.conf
add a comment |
Be careful, because the snapd reads the /etc/environment file instead of get the ENV variable.
This example below doesn't work:
export https_proxy=http://<your.ip.here>:3128
you have to use:
http://<your.ip.here>:3128
add a comment |
There is a reported bug:
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1579652
Please subscribe to check changes on it.
add a comment |
Snap service is configured to use special environment file, so you can just add http_proxy variable to it if your current environment variables are not picked up by the snap.
Open file:
sudo vim /etc/sysconfig/snapd
Add:
http_proxy=http://127.0.0.1:3128
https_proxy=http://127.0.0.1:3128
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f764610%2fhow-to-install-snap-packages-behind-web-proxy-on-ubuntu-16-04%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
snapd
reads /etc/environment
, so setting the usual proxy environment variables there works. On Ubuntu, that's done automatically for you by Settings → Network → Network proxy, so as long as you restart snapd
after changing that file you should be set.
1
Being more specific, the snapd.service file is located here: /lib/systemd/system/snapd.service
– julian-alarcon
May 26 '16 at 13:28
@darkhole one shouldn't edit/lib/systemd/system/snapd.service
, but usesystemctl edit snapd.service
. See my answer: askubuntu.com/questions/659267/…
– muru
Jun 7 '16 at 13:57
Well what if one wants to automate this configuration?
– pmatulis
Dec 19 '16 at 16:18
1
Remember, you will need to restart the snapd service before these changes take effect.
– Seth♦
Jan 11 '17 at 22:07
add a comment |
snapd
reads /etc/environment
, so setting the usual proxy environment variables there works. On Ubuntu, that's done automatically for you by Settings → Network → Network proxy, so as long as you restart snapd
after changing that file you should be set.
1
Being more specific, the snapd.service file is located here: /lib/systemd/system/snapd.service
– julian-alarcon
May 26 '16 at 13:28
@darkhole one shouldn't edit/lib/systemd/system/snapd.service
, but usesystemctl edit snapd.service
. See my answer: askubuntu.com/questions/659267/…
– muru
Jun 7 '16 at 13:57
Well what if one wants to automate this configuration?
– pmatulis
Dec 19 '16 at 16:18
1
Remember, you will need to restart the snapd service before these changes take effect.
– Seth♦
Jan 11 '17 at 22:07
add a comment |
snapd
reads /etc/environment
, so setting the usual proxy environment variables there works. On Ubuntu, that's done automatically for you by Settings → Network → Network proxy, so as long as you restart snapd
after changing that file you should be set.
snapd
reads /etc/environment
, so setting the usual proxy environment variables there works. On Ubuntu, that's done automatically for you by Settings → Network → Network proxy, so as long as you restart snapd
after changing that file you should be set.
edited Jun 20 '17 at 17:08
answered May 16 '16 at 13:00
ChipacaChipaca
8,6142244
8,6142244
1
Being more specific, the snapd.service file is located here: /lib/systemd/system/snapd.service
– julian-alarcon
May 26 '16 at 13:28
@darkhole one shouldn't edit/lib/systemd/system/snapd.service
, but usesystemctl edit snapd.service
. See my answer: askubuntu.com/questions/659267/…
– muru
Jun 7 '16 at 13:57
Well what if one wants to automate this configuration?
– pmatulis
Dec 19 '16 at 16:18
1
Remember, you will need to restart the snapd service before these changes take effect.
– Seth♦
Jan 11 '17 at 22:07
add a comment |
1
Being more specific, the snapd.service file is located here: /lib/systemd/system/snapd.service
– julian-alarcon
May 26 '16 at 13:28
@darkhole one shouldn't edit/lib/systemd/system/snapd.service
, but usesystemctl edit snapd.service
. See my answer: askubuntu.com/questions/659267/…
– muru
Jun 7 '16 at 13:57
Well what if one wants to automate this configuration?
– pmatulis
Dec 19 '16 at 16:18
1
Remember, you will need to restart the snapd service before these changes take effect.
– Seth♦
Jan 11 '17 at 22:07
1
1
Being more specific, the snapd.service file is located here: /lib/systemd/system/snapd.service
– julian-alarcon
May 26 '16 at 13:28
Being more specific, the snapd.service file is located here: /lib/systemd/system/snapd.service
– julian-alarcon
May 26 '16 at 13:28
@darkhole one shouldn't edit
/lib/systemd/system/snapd.service
, but use systemctl edit snapd.service
. See my answer: askubuntu.com/questions/659267/…– muru
Jun 7 '16 at 13:57
@darkhole one shouldn't edit
/lib/systemd/system/snapd.service
, but use systemctl edit snapd.service
. See my answer: askubuntu.com/questions/659267/…– muru
Jun 7 '16 at 13:57
Well what if one wants to automate this configuration?
– pmatulis
Dec 19 '16 at 16:18
Well what if one wants to automate this configuration?
– pmatulis
Dec 19 '16 at 16:18
1
1
Remember, you will need to restart the snapd service before these changes take effect.
– Seth♦
Jan 11 '17 at 22:07
Remember, you will need to restart the snapd service before these changes take effect.
– Seth♦
Jan 11 '17 at 22:07
add a comment |
Snap uses snapd
daemon. You only need to define http_proxy
and https_proxy
in /etc/environment
and restart the service: systemctl restart snapd
.
add a comment |
Snap uses snapd
daemon. You only need to define http_proxy
and https_proxy
in /etc/environment
and restart the service: systemctl restart snapd
.
add a comment |
Snap uses snapd
daemon. You only need to define http_proxy
and https_proxy
in /etc/environment
and restart the service: systemctl restart snapd
.
Snap uses snapd
daemon. You only need to define http_proxy
and https_proxy
in /etc/environment
and restart the service: systemctl restart snapd
.
edited Apr 2 '18 at 22:35
user.dz
34.6k1190176
34.6k1190176
answered Apr 2 '18 at 21:42
mmartinmmartin
411
411
add a comment |
add a comment |
There is another way to add environment variables to systemd services:
Create a folder for the snap daemon and create configuration files for the environment variables:
$ sudo mkdir -p /etc/systemd/system/snapd.service.d/
$ echo -e '[Service]nEnvironment="http_proxy=http://1.2.3.4:3128/"'
| sudo tee /etc/systemd/system/snapd.service.d/http-proxy.conf
$ echo -e '[Service]nEnvironment="https_proxy=http://1.2.3.4:3128/"'
| sudo tee /etc/systemd/system/snapd.service.d/https-proxy.conf
$ sudo systemctl daemon-reload
$ sudo systemctl restart snapd
After that you can check if the environment variables are set for snapd
:
$ systemctl show snapd | grep proxy
Environment=http_proxy=http://1.2.3.4:3128/ https_proxy=http://1.2.3.4:3128/
DropInPaths=/etc/systemd/system/snapd.service.d/http-proxy.conf /etc/systemd/system/snapd.service.d/https-proxy.conf
add a comment |
There is another way to add environment variables to systemd services:
Create a folder for the snap daemon and create configuration files for the environment variables:
$ sudo mkdir -p /etc/systemd/system/snapd.service.d/
$ echo -e '[Service]nEnvironment="http_proxy=http://1.2.3.4:3128/"'
| sudo tee /etc/systemd/system/snapd.service.d/http-proxy.conf
$ echo -e '[Service]nEnvironment="https_proxy=http://1.2.3.4:3128/"'
| sudo tee /etc/systemd/system/snapd.service.d/https-proxy.conf
$ sudo systemctl daemon-reload
$ sudo systemctl restart snapd
After that you can check if the environment variables are set for snapd
:
$ systemctl show snapd | grep proxy
Environment=http_proxy=http://1.2.3.4:3128/ https_proxy=http://1.2.3.4:3128/
DropInPaths=/etc/systemd/system/snapd.service.d/http-proxy.conf /etc/systemd/system/snapd.service.d/https-proxy.conf
add a comment |
There is another way to add environment variables to systemd services:
Create a folder for the snap daemon and create configuration files for the environment variables:
$ sudo mkdir -p /etc/systemd/system/snapd.service.d/
$ echo -e '[Service]nEnvironment="http_proxy=http://1.2.3.4:3128/"'
| sudo tee /etc/systemd/system/snapd.service.d/http-proxy.conf
$ echo -e '[Service]nEnvironment="https_proxy=http://1.2.3.4:3128/"'
| sudo tee /etc/systemd/system/snapd.service.d/https-proxy.conf
$ sudo systemctl daemon-reload
$ sudo systemctl restart snapd
After that you can check if the environment variables are set for snapd
:
$ systemctl show snapd | grep proxy
Environment=http_proxy=http://1.2.3.4:3128/ https_proxy=http://1.2.3.4:3128/
DropInPaths=/etc/systemd/system/snapd.service.d/http-proxy.conf /etc/systemd/system/snapd.service.d/https-proxy.conf
There is another way to add environment variables to systemd services:
Create a folder for the snap daemon and create configuration files for the environment variables:
$ sudo mkdir -p /etc/systemd/system/snapd.service.d/
$ echo -e '[Service]nEnvironment="http_proxy=http://1.2.3.4:3128/"'
| sudo tee /etc/systemd/system/snapd.service.d/http-proxy.conf
$ echo -e '[Service]nEnvironment="https_proxy=http://1.2.3.4:3128/"'
| sudo tee /etc/systemd/system/snapd.service.d/https-proxy.conf
$ sudo systemctl daemon-reload
$ sudo systemctl restart snapd
After that you can check if the environment variables are set for snapd
:
$ systemctl show snapd | grep proxy
Environment=http_proxy=http://1.2.3.4:3128/ https_proxy=http://1.2.3.4:3128/
DropInPaths=/etc/systemd/system/snapd.service.d/http-proxy.conf /etc/systemd/system/snapd.service.d/https-proxy.conf
edited Oct 26 '18 at 14:43
answered Oct 18 '18 at 11:39
Simon SudlerSimon Sudler
1,429213
1,429213
add a comment |
add a comment |
Be careful, because the snapd reads the /etc/environment file instead of get the ENV variable.
This example below doesn't work:
export https_proxy=http://<your.ip.here>:3128
you have to use:
http://<your.ip.here>:3128
add a comment |
Be careful, because the snapd reads the /etc/environment file instead of get the ENV variable.
This example below doesn't work:
export https_proxy=http://<your.ip.here>:3128
you have to use:
http://<your.ip.here>:3128
add a comment |
Be careful, because the snapd reads the /etc/environment file instead of get the ENV variable.
This example below doesn't work:
export https_proxy=http://<your.ip.here>:3128
you have to use:
http://<your.ip.here>:3128
Be careful, because the snapd reads the /etc/environment file instead of get the ENV variable.
This example below doesn't work:
export https_proxy=http://<your.ip.here>:3128
you have to use:
http://<your.ip.here>:3128
answered Jul 1 '18 at 22:15
Zoltan SzaboZoltan Szabo
111
111
add a comment |
add a comment |
There is a reported bug:
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1579652
Please subscribe to check changes on it.
add a comment |
There is a reported bug:
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1579652
Please subscribe to check changes on it.
add a comment |
There is a reported bug:
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1579652
Please subscribe to check changes on it.
There is a reported bug:
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1579652
Please subscribe to check changes on it.
answered May 26 '16 at 13:31
julian-alarconjulian-alarcon
33926
33926
add a comment |
add a comment |
Snap service is configured to use special environment file, so you can just add http_proxy variable to it if your current environment variables are not picked up by the snap.
Open file:
sudo vim /etc/sysconfig/snapd
Add:
http_proxy=http://127.0.0.1:3128
https_proxy=http://127.0.0.1:3128
New contributor
add a comment |
Snap service is configured to use special environment file, so you can just add http_proxy variable to it if your current environment variables are not picked up by the snap.
Open file:
sudo vim /etc/sysconfig/snapd
Add:
http_proxy=http://127.0.0.1:3128
https_proxy=http://127.0.0.1:3128
New contributor
add a comment |
Snap service is configured to use special environment file, so you can just add http_proxy variable to it if your current environment variables are not picked up by the snap.
Open file:
sudo vim /etc/sysconfig/snapd
Add:
http_proxy=http://127.0.0.1:3128
https_proxy=http://127.0.0.1:3128
New contributor
Snap service is configured to use special environment file, so you can just add http_proxy variable to it if your current environment variables are not picked up by the snap.
Open file:
sudo vim /etc/sysconfig/snapd
Add:
http_proxy=http://127.0.0.1:3128
https_proxy=http://127.0.0.1:3128
New contributor
New contributor
answered 10 hours ago
AlexanderAlexander
101
101
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f764610%2fhow-to-install-snap-packages-behind-web-proxy-on-ubuntu-16-04%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown