V
V
Vyacheslav Vasiliev2016-04-29 21:52:58
linux
Vyacheslav Vasiliev, 2016-04-29 21:52:58

How to Set Proxy for Command Line in Linux?

Briefly explain the situation.
1. I scooped up information from archwiki - tyts
2. I read an article on ShellHack - tyts
3. I asked a question earlier on the Toaster and it still torments me - tyts
And so, in my "~/.bashrc" it is written like this:

# Включить Proxy
function setproxy() {
    export http_proxy=http://proxy_server:port/
    export https_proxy=$http_proxy
    export ftp_proxy=$http_proxy
    export rsync_proxy=$http_proxy
    export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
}

# Отключить Proxy
function unsetproxy() {
    unset {http,https,ftp,rsync_proxy,no_proxy}_proxy
}

, where under " http://proxy_server:port/ " I registered my real data.
Accordingly, I reloaded my bash:
. ~/.bashrc
Here is the result of the work done:
[[email protected]_pavilion_g6 ~]$ sudo pacman -Syu
[sudo] пароль для thenovalive: **********
:: Обновление баз данных пакетов...
ошибка: не удалось получить файл 'core.db' из mirror.yandex.ru : Connection timed out after 10001 milliseconds
ошибка: не удалось получить файл 'core.db' из archlinux.polymorf.fr : Connection timed out after 10001 milliseconds
^C
Interrupt signal received

[[email protected]_pavilion_g6 ~]$

I'm waiting for help.
PS: If the environment matters, then I have Archlinux KDE (the latest Plasma) and NetworkManager, where I also read everything in archwikis and did not find any good advice "How to set up a proxy ?!".
ATP, to everyone who participates!!!

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
J
jcmvbkbc, 2016-04-30
@thenovalive2013

in my "~/.bashrc" it is written like this:

It's just two functions, does anyone call them? After reboot ~/.bashrc echo $http_proxy writes what is needed?

V
viiy, 2016-04-30
@viiy

sudo looks at all your variables and functions as...

export a=123

$ env |grep ^a
a=123

$ sudo env |grep ^a

Apply values ​​after sudo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question