想法:  我的想法是想是一台国内的 ubuntu 云主机可以通过另外一台在国外(新加坡)的服务器 ,来实现可以访问 google ,哈哈,比较好查资料:)

下面的做法 去修改 /etc/environment 文件,然后重启reboot 这台服务器的话,发现 apt-get install 软件的时候也会走这个代理去装软件,

,哈哈,这个这国内的服务器无法访问,无法安装的一些软件就可以 so easy 的安装了!!! 哇哇哇。。。。。。。。。:)

-------------------------------------------------------

How do I configure proxies without GUI?

2 Answers

System-wide proxies in CLI Ubuntu/Server must be set as environment variables.

  • Open the /etc/environment file with vi (or your favorite editor). This file stores the system-wide variables initialized upon boot.
  • Add the following lines, modifying appropriately. You must duplicate in both upper-case and lower-case because (unfortunately) some programs only look for one or the other:

    http_proxy="http://myproxy.server.com:8080/"
    https_proxy="http://myproxy.server.com:8080/"
    ftp_proxy="http://myproxy.server.com:8080/"
    no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
    HTTP_PROXY="http://myproxy.server.com:8080/"
    HTTPS_PROXY="http://myproxy.server.com:8080/"
    FTP_PROXY="http://myproxy.server.com:8080/"
    NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"
  • apt-getaptitude, etc. will not obey the environment variables when used normally with sudo. So separately configure them; create a file called 95proxies in /etc/apt/apt.conf.d/, and include the following:

    Acquire::http::proxy "http://myproxy.server.com:8080/";
    Acquire::ftp::proxy "ftp://myproxy.server.com:8080/";
    Acquire::https::proxy "https://myproxy.server.com:8080/";

Finally, logout and reboot to make sure the changes take effect.


Sources: 12. See 1 in particular for additional help, including a script to quickly turn on/off the proxies.

ubuntu How do I configure proxies without GUI?的更多相关文章

  1. ubuntu 16.04 编译安装 amule (开启GUI)

    安装依赖 $ -dev libgeoip-dev zlib1g-dev libupnp-dev libboost-all-dev libwxbase3.-dev libwxgtk3.-dev buil ...

  2. [转]Ubuntu上的包管理:dpkg,apt和aptitude

    一直以来对于ubuntu的包管理的概念就是apt-get,偶尔手动装个包就是dpkg -i,现在觉得是要系统地了解一下这几个包管理的命令. 原文转自: http://zhouliang.pro/201 ...

  3. Ubuntu桌面版本和服务器版本之间的区别(转载)

    转载自:http://blog.csdn.net/fangaoxin/article/details/6335992 http://www.linuxidc.com/Linux/2010-11/297 ...

  4. 如何在Ubuntu上创建及管理LXC容器?

    将LXC安装到Ubuntu上 $ sudo apt-get install lxc 安装完毕之后,运行lxc-checkconifg工具,检查当前Linux内核支持LXC的情况.要是一切都已被启用,内 ...

  5. Ubuntu runlevel修改

    安装Unbuntu 12.04. 据说Ubunut的一个UI相对友好的Linux版本,但我的需求是仅仅将其作为服务器使用,偶尔用用UI界面.所以我希望启动Ubuntu时,直接进入Shell命令行. 印 ...

  6. Ubuntu桌面版与服务器版有什么不同?

         提到安装Linux,Ubuntu可谓是最受欢迎的.为了满足每个人的需求,出现了不少版本或风格的Ubuntu;其中两项便是桌面版与服务器版.只要发布版本号一致,这两者从核心来说也就是相同的,唯 ...

  7. Vbox中Ubuntu的安装和共享文件夹设置

    1. 选择版本 1.1 Ubuntu桌面版与服务器版的区别 桌面版与服务器版,只要发布版本号一致,这两者从核心来说也就是相同的,唯一的差别在于它们的预期用途.桌面版面向个人电脑使用者,可以进行文字处理 ...

  8. ubuntu安装Nginx

    什么都不说了 直接干 一.安装Nginx 首先从Nginx的官网下载最新的稳定版本1.14.0:nginx 1.解压安装包 1.root@ubuntu:tar -zxf nginx-1.14.0.ta ...

  9. Ubuntu使用总结一

    一.安装 Ubuntu桌面版与服务器版的不同之处桌面版面向个人电脑使用者,可以进行文字处理.网页浏览.多媒体播放和玩游戏.本质上说,这是一 个为普通用户所定制的多用途操作系统.另一方面,服务器版旨在充 ...

随机推荐

  1. Elasticsearch--搜索

    目录 基本知识 查询结果返回设置:版本值.得分限制.定制返回字段 搜索类型 搜索执行偏好 基本查询 过滤器类型 高亮 控制高亮的片段 验证查询 数据排序 查询重写 基本知识 查询结果返回设置:版本值. ...

  2. Spark学习之编程进阶——累加器与广播(5)

    Spark学习之编程进阶--累加器与广播(5) 1. Spark中两种类型的共享变量:累加器(accumulator)与广播变量(broadcast variable).累加器对信息进行聚合,而广播变 ...

  3. FTP初始化文件.netrc使用技巧[转发]

    FTP初始化文件.netrc使用技巧 FTP(文件传输)和E-mail(电子邮件).Telnet(远程登录)一样,是 Internet的三大主要功能之一.因为使用频繁,用户往往会遇到各种 各样的问题, ...

  4. tensorboard在windows系统浏览器显示空白的解决

    一个简单的using_tensorboard.py程序,如下: #using_tensorboard.py import tensorflow as tf a = tf.constant(10,nam ...

  5. [Windows Server 2012] 初识Windows Server 2012

    ★ 欢迎来到[护卫神·V课堂],网站地址:http://v.huweishen.com★ 护卫神·V课堂 是护卫神旗下专业提供服务器教学视频的网站,每周更新视频.★ 本节我们将带领大家:初次见识Win ...

  6. 【译】x86程序员手册26-7.5任务切换

    7.5 Task Switching 任务切换 The 80386 switches execution to another task in any of four cases: 80386在以下四 ...

  7. python学习笔记(6)——for...in &while

    for x in ...循环就是把每个元素代入变量x,然后执行缩进块的语句. 注意:python中的格式也起到语法规则的作用,缩进块就是一个例 求和问题,比较异同 1/sum= ,,,,,,,,,]: ...

  8. 新开的坑-python学习笔记(1)——连接符与转义

    1/print输出格式虽然知道怎么用却还要打破砂锅的问问题... 问题答案是 需要读很多基础文档教程 --------例如 "+"  . "," 作为连接符的作 ...

  9. 远程图形界面:VncServer与KDE桌面远程连接

           强烈不建议putty+xming的工作方式,太慢了,且界面也不是特别友好.        原文:vncserver与KDE远程连接        建议:不过还是建议使用Xshell,使用 ...

  10. java学习_5_24

    TreeMap底层是用红黑树实现的,源码如下: /** * A Red-Black tree based {@link NavigableMap} implementation. * The map ...