有时候在内网中使用树莓派,需要使用代理才能连接外网。但是命令行下面又不像windows机器上面浏览器设置一下那么容易。有没有能够在命令行下面设置代理服务器的方法呢,答案是肯定的,下面是设置步骤:
1,编辑配置文件:
vi ~/.bashrc
2,文件内容(红色为添加内容,格式形如http://easwy:123456@192.168.1.1:8080):
# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1=’${debian_chroot:+($debian_chroot)}\h:\w\$ ‘
# umask 022
# You may uncomment the following lines if you want `ls’ to be colorized:
# export LS_OPTIONS=’–color=auto’
# eval “`dircolors`”
# alias ls=’ls $LS_OPTIONS’
# alias ll=’ls $LS_OPTIONS -l’
# alias l=’ls $LS_OPTIONS -lA’
#
# Some more alias to avoid making mistakes:
# alias rm=’rm -i’
# alias cp=’cp -i’
# alias mv=’mv -i’
export http_proxy=http://xxx.xxx.com:8080
export ftp_proxy=http://xxx.xxx.com:8080
3,应用修改:
source ~/.bashrc
OK,现在你已经可以通过命令行安装软件,获取更新了。:)