PDA

View Full Version : [SOLVED] Change download servers from command line?



dasunsrule32
October 30th, 2009, 08:15 PM
How do I change the whole sources.list to a different update server? I want to change from the US server to one in utah that is blazing fast. How do I do this from the CLI? I am running Server 9.04 and want to upgrade, without using do-release-upgrade. Thanks.

scragar
October 30th, 2009, 08:17 PM
Use a text based editor to edit the sources file.

sudo nano /etc/apt/sources.list
Ctrl+o to save
Ctrl+X to exit.

dasunsrule32
October 30th, 2009, 08:19 PM
I know this, i want to have the file scanned and then replace all the existing URL's for the US server to the Utah server. Thanks though.

scragar
October 30th, 2009, 08:24 PM
Well you can comment out the current server and remove the comment from the other server, but it's a bit of a risk really.


sudo sed -i 's/^[^#]/#/' /etc/apt/sources.list
echo "NEW URL" | sudo tee -a /etc/apt/sources.list

Much safer to do it by hand.

dasunsrule32
October 30th, 2009, 10:41 PM
I ended up modifying your sed command, worked great. Thanks.