Note: All commands asked to be run must be run in the terminal, which can be opened by either Ctrl+Alt+T or searching for terminal in the dash.
Is it really broken?
Try running the following command and try to reinstall the software you were trying to install
sudo apt-get update
Pre-Perfomance Steps
Backing up
Back up the following files:
/etc/apt/sources.list
/var/lib/dpkg/status
To do so, use these commands
sudo cp /etc/apt/sources.list /etc/apt/sources.list.original
and
sudo cp /var/lib/dpkg/status /var/lib/dpkg/status.original
Clearing your apt-cache
apt
keeps a cache of recently downloaded packages to save bandwidth when it is required to be installed. This can be counter-productive in some cases
Now, to clean it, you have two options
sudo apt-get clean
This will remove all cached packages belonging to the folder /var/cache/apt/archives/
and /var/cache/apt/archives/partial
except the .lock files. This is recommended
sudo apt-get autoclean
This scans the folders /var/cache/apt/archives/
and /var/cache/apt/archives/partial
and checks if the package is still in the repositories and removes the ones that aren't
Fixing dependencies
Using apt's fix-broken mode
sudo apt-get -f install
This will cause apt to scan for missing dependencies and fix them from the repositories
If the output states that nothing new was installed or upgraded, it has failed.
Checking if all required sources are enabled
Type gksu software-properties-gtk
and you'll get this window

Make sure all sources are enabled.
next, go to the Other software tab and check if the required PPAs for the software to be installed are there and are enabled. Also, try disabling some PPAs which might be having broken packages

now, run sudo apt-get update
Try installing the software now
Selecting a better server to download from
Type gksu software-properties-gtk
and you'll get this window

Click the Download from the Dropdown box and select other

Click Select Best Server

Run sudo apt-get update
Try installing the software
also, try using sudo apt-get install -f
PPA Purge
This is a tool used to purge broken/unwanted ppa's and their applications along with it
To install it, run
sudo apt-get install ppa-purge
But, Considering the question apt
is broken so the above command will fail. So use this command
mkdir ppa-purge && cd ppa-purge && wget http://mirror.pnl.gov/ubuntu/pool/universe/p/ppa-purge/ppa-purge_0.2.8+bzr56_all.deb && wget http://mirror.pnl.gov/ubuntu//pool/main/a/aptitude/aptitude_0.6.6-1ubuntu1_i386.deb && sudo dpkg -i ./*.deb
Now use ppa purge
sudo ppa-purge ppa:someppa/ppa
Y-PPA Manager
Y-PPA Manager is a gui app that helps you manage PPA's and various problems assosiated with it
To install it
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
and
sudo apt-get update
and
sudo apt-get install y-ppa-manager
Considering the question, apt
is broken so, use these command instead
sudo su
and
32 Bit:
mkdir y-ppa-manager && cd y-ppa-manager && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/launchpad-getkeys_0.3.2-1~webupd8~oneiric_all.deb && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/y-ppa-manager_0.0.8.6-1~webupd8~precise_all.deb && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/yad_0.17.1.1-1~webupd8~precise_i386.deb && dpkg -i ./*.deb
64 Bit:
mkdir y-ppa-manager && cd y-ppa-manager && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/launchpad-getkeys_0.3.2-1~webupd8~oneiric_all.deb && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/y-ppa-manager_0.0.8.6-1~webupd8~precise_all.deb && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/yad_0.17.1.1-1~webupd8~precise_amd64.deb && dpkg -i ./*.deb
Now type in y-ppa-manager
You'll be presented with this window

Double click on advanced, and you'll get this window

Do the following Tasks outlined in black

Prevention is better than cure
It is better to prevent than to search for this question on AskUbuntu :D
So, here are the guidelines to keep you safe
Keep your system up-to-date
always run the following command regularly
sudo apt-get update&&sudo apt-get upgrade
or, you can always use Update Manager with this command
gksu update-manager
Using only trusted PPA's
Only use PPA's meant to be used on Ubuntu also, only use PPA's with trusted sources. Infact, the package might already be in the ubuntu repositories
Backing up when things are good and restoring it later
For this you need Y-PPA-Manager. The steps to install it are given above.
Run this command to open Y-PPA-Manager
y-ppa-manager
You'll be presented with this window

Double click on advanced, and you'll get this window

Run this:

You'll be asked to save a tar.gz file with a dialog similar to the one below. Save it in another partition or a safe place

Later, when you need to restore it again, follow similar steps and when you get to the advanced dialog,Click on this:

You'll be asked to restore from the previous backup which you saved before with a dialog similar to the one below

Still not working?
Package dependency errors are not always generic and depends on the package to be installed.
If following all the steps given to fix the error does not work for you, you can always ask on Ask Ubuntu
Here are some commands which you need to post the output of
sudo apt-get install packagename
and
cat /etc/apt/sources.list
and
cat /etc/apt/sources.list.d/*
(Thanks to Basharat Sial)
There are also other files/commands that you need the output of that might be error specific, and users will probably prompt you in the comments to post the file/command.