How To: Update Your Ubuntu GNU/Linux sources.list the Geeky Way

Here's my geeky tip for updating your /etc/apt/sources.list on Ubuntu GNU/Linux.

This tip is especially useful around April/October when the new Ubuntu releases are freed into the wild and the main servers are very busy.

I know what you're saying: This can easily be done from the  Ubuntu Software Center via the edit > sources menu. Yes, this is true, but now that's not a very geeky (or terminal-fast) thing to do, now is it? Besides, I like it better when I can initiate the sources update myself with sudo apt-get update, vs. having the software centre do it on exit.

To change your sources.list package server setting from the command line.

1.) Open the Terminal. Simply hit CTRL+ALT+T.

2.) Run this command to update your sources.list file:

sudo sed -i.backup 's/' /etc/apt/sources.list

3.) Run this command to see if your change took effect (you should see instead of on update).

sudo apt-get update

Related Notes:

a.) Edits your sources.list file in place (makes a backup of your current sources.list as /etc/apt/sources.list.backup). Keep in mind if you run the command twice - the backup will be overwritten.

b.) Assumes your Ubuntu was installed in the USA(can probably swap the us for your country code) - hence the original setting.

c.) Assumes you want to replace your current package source with (that one is fast for me here in Seattle, WA). See your list of options for package servers by running this command:

cat /usr/share/update-manager/mirrors.cfg

Alternatively, checkout
archivemirrors for list with speeds and other information.

Feel free to leave your suggestions for the better way below. Thanks!

See these links for more information:


Shannon VanWagner

Popular posts from this blog

How To Connect Ubuntu Linux to Cisco VPN with openconnect (anyconnect-capable alternative)

(updated) How To: Ubuntu 16.04 GNU / Linux - Netgear Wireless AC Adapter AC600 ( AC6100 ) Dual Band

How To Set Default Grub / kernel / boot option on Ubuntu GNU/Linux 14.04