ubuntu下 apt emacs git设置代理

1,apt
创建:/etc/apt/apt.conf.d/proxy.conf
内容:

Acquire::http::Proxy "http://username:password@ip地址或网址:8080/";
Acquire::https::Proxy "http://username:password@ip地址或网址:8080/";

2,emacs

(setq url-proxy-services
   '(("http" . "ip地址或网址:8080")
     ("https" . "ip地址或网址:8080")
     ))

(setq package-archives '(("gnu"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
                         ("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")))
(package-initialize)

3,git
在用户的根目录,创建:.gitconfig
内容:

[http]
	proxy = http://username:passwordl@ip地址或端口:8080
posted @ 2020-08-08 15:03  小石王  阅读(251)  评论(0编辑  收藏  举报