在虚拟机里使用代理

  1. Edit the proxy server in /etc/bash.bashrc

rzfwch:~$ gedit/etc/bash.bashrc &

 

# edit the proxy servicer

 

# This function allows you toset up the http and ftp proxies in a terminal window for

# performing "wget",etc. Type proxy at the command line and enter the correct

# id/pw.

functionproxy(){

       echo-n "username: "

       read-e username

       echo-n "password: "

扫描二维码关注公众号,回复: 519740 查看本文章

       read-es password

       exporthttps_proxy="https://$username:[email protected]:8080/"

       exporthttp_proxy="http://$username:[email protected]:8080/"

       exportftp_proxy="http://$username:[email protected]:8080/"

       echo""

}

  1. How to use In shell

rzfwch:~$proxy     # enter proxy and press return

username:rzfwch    # enter your netid

password:xxxx      # enter your password

Install software using apt-get

rzfwch:~$ sudo -s   #enter root mode

root:~#proxy

username: rzfwch

password: xxxx

# Using apt-get to installpackage

apt-get update

apt-get install xxxx

...

猜你喜欢

转载自blog.csdn.net/melody157398/article/details/77368334