I was trying to install an R package which said it couldn't find -lgortran. So I uninstalled gfortran. However, when I tried to install it again, I got the following error

Code:
gfortran : Depends: gfortran-4.7 (>= 4.7.2-1~) but it is not going to be installed
When I tried installing gfortran-4.7

Code:
gfortran-4.7 : Depends: gcc-4.7-base (= 4.7.2-2ubuntu1) but 4.7.2-11precise2 is to be installed

             Depends: gcc-4.7 (= 4.7.2-2ubuntu1) but 4.7.2-11precise2 is to be installed
When I try installing gcc-4.7-base or gcc-4.7, it tells me they're already installed.

What's happening here and how can I fix this?

I'm running 12.10

Thanks