Problem scenario: You are trying to install various packages on Ubuntu 14.04, but they are not working. You are root and you run this command (where postgresql is the name of the package you want to install):
apt-get install postgresql postgresql-contrib
This error message is what you see as a result:
"Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package postgresql
E: Unable to locate package postgresql-contrib"
How do you install new packages on your Ubuntu server?
1. With a regular web browser, go to this website.
2. Manually check the boxes for the options you want and click "Generate" at the bottom.
3. Go back to the Ubuntu server. Back up /etc/apt/sources.list if there is a chance you'll want it later. Then copy the content of the /etc/apt/sources.list from the web browser and have it completely overwrite the existing content of your Ubuntu's /etc/apt/sources.list.
4. Run this command as root: apt-get update