设置apt代理需要修改/etc/apt/apt.conf 脚本内容如下: # file 1.sh #!/bin/bash PROXY_IP_PORT=$1 if [ -z ${/etc/apt/apt.conf} ];then echo Please enter the Proxy IP and Port. exit 1 fi sudo sh -c 'echo Acquire::http::proxy \http://127.0.0.1:8000/\; Acquire::ftp::proxy \ftp://127.0.0.1:8000/\; Acquire::h