HostOnNet Blog

Changing Ubuntu APT mirror from commandline

Last day i removed GUI from Ubuntu installation as i don’t need GUI in development machine. Today i run apt-get, found it is downloading packages from server located in USA. I need it to download files from Indian Ubuntu mirror server. This is done by editing

/etc/apt/sources.list

Finding all instance of

http://us.archive.ubuntu.com

Replacing it With

http://in.archive.ubuntu.com

You can do this with sed, run following command

sed -i "s/http:\/\/us.archive/http:\/\/in.archive/g" /etc/apt/sources.list

That will do all the find and replacement for you.


Posted in Ubuntu