Quantcast
Channel: Setting proxy in apt.conf using Bash Script - Ask Ubuntu
Viewing all articles
Browse latest Browse all 3

Setting proxy in apt.conf using Bash Script

$
0
0

I wrote the following bash script to write the proxy in the apt.conf file, and hide it from being echoed to the terminal.

sudo echo "Acquire::http::proxy  "http://"$prox":"$port"/";" | sudo tee -a /etc/apt/apt.conf > /dev/null 2>&1
sudo echo "Acquire::https::proxy  "https://"$prox":"$port"/";" | sudo tee -a /etc/apt/apt.conf > /dev/null 2>&1
sudo echo "Acquire::ftp::proxy  "ftp://"$prox":"$port"/";" | sudo tee -a /etc/apt/apt.conf > /dev/null 2>&1

Although the commands write to the apt.conf file, but on running the script, I get the following error :

E: Syntax error /etc/apt/apt.conf:6: Extra junk at end of file

Help appreciated over this!


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images