12.04 reports itself as quantal after installing the toolchain-test-ppa?

Solution 1:

I had the exact same problem. In my case it was due to the fact that I had the ppa:ubuntu-toolchain-r/test enabled and even though only precise was listed as the series, the base-files package in there seems to belong to quantal. To find out from where the misbehaving base-files package is installed, use the following command:

$ apt-cache policy base-files

Find the line where the version matches the installed version and inspect the URL that is reported for that version.

If you want to keep the PPA enabled (e.g. because you want/must use the gcc-4.7 compiler), you can use apt-pinning to force the system into keeping the base-files package while allowing you to install gcc-4.7. Create the file /etc/apt/preferences.d/base-files (make sure not to use any dots in the name) with the following content:

Package: base-files
Pin: release o=Ubuntu
Pin-Priority: 1001

This will force a downgrade of the base-files package to its default version (from the main ubuntu repository) on the next upgrade.

Be extra careful about typographical errors, particularly spaces and capitalization.

Once the file is in place, use apt-cache policy base-files to determine the Candidate version. It should correspond to the version that is listed next to the default Ubuntu archive. Finally, start the downgrade:

$ sudo apt-get upgrade

When asked whether you really want to DOWNGRADE (capitalization not mine...), answer with y+Enter.