Need released (not prerelease) g++ in Kubuntu 7.10

Asked by tbd

I installed Kubuntu 7.10, and everything works fine, except that my g++ version is
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

How do I get a released version , say 4.1.2.

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Urbán Dániel
Solved:
Last query:
Last reply:
Revision history for this message
Ralph Janke (txwikinger) said :
#1

Thanks for this question.

The current version for g++ on gutsy is 4:4.1.2-9ubuntu2. I am not sure where you get the prerelease from. Maybe you need to check your sourcelist and take out some non-ubuntu repositories or ppas.

I hope this helps.

Revision history for this message
tbd (moodeye) said :
#2

I installed 7.10 directly from the CD distribution. That has g++ 4.1.3 prerelease in it.
I then tried
     apt-get upgrade
and I still have 4.1.3 prerelease.
I tried
    apt-get install g++=4.1.2
and it said I already have a more recent version, so it did nothing.

Some questions:
1. Do I need to uninstall g++ and reinstall at an older version?

2. I doubt I have any non-ubuntu stuff, since my web-based installs have been limited to "apt-get". But just in case, where is the sourcelist and what should I look for in it?

3. Also, could you explain what the "4:" is in "4:4.1.2-9ubuntu2"?

Thanks for the help, really appreciate it.

--TBD

Revision history for this message
Urbán Dániel (urban.dani) said :
#3

The version of the package "g++-4.1" should be "4.1.2-16ubuntu2" in Gutsy, so if it is, then it's OK.
(See http://packages.ubuntu.com/gutsy/g++-4.1 )
(However the version of the package "g++" (which depends on "g++-4.1") should be the mentioned "4:4.1.2-9ubuntu2".)

You can check the version of these packages with "dpkg -l | grep g++". This command should list both "g++" and "g++-4.1", with their version, so you can check them.

2. The sourcelist is in the file "/etc/apt/sources.list".

Revision history for this message
tbd (moodeye) said :
#4

I have exactly the versions you specify ("g++-4.1" is "4.1.2-16ubuntu2", and g++ is "4:4.1.2-9ubuntu2").
However, when I do "g++ -v", it shows up as a prerelease version [4.1.3 20070929 (prerelease) (Ubunt 4.1.2-16ubuntu2)]. How do I get a released version?

Revision history for this message
Urbán Dániel (urban.dani) said :
#5

Well it seems, that in Gutsy there is a package called "g++-4.2". Its version is "4.2.1-5ubuntu4". I don't know, if it's a release, but I think it's worth a try. (I can't try it now, I'm using Feisty.)
(You maybe have to select for use the newer version with "update-alternatives".)

Revision history for this message
tbd (moodeye) said :
#6

Well, I installed g++-4.2 successfully and rebooted, but when I do "g++ -v", it still shows up as my 4.1.3 prerelease version.
I google'd around and it appears that it is not that easy to downgrade the version using apt-get. But I'm quite a novice, so don't take my word for it.
I'm not sure how I got stuck with a prerelease version. Here's my /etc/apt/sources.list: Any help is greatly appreciated!

deb cdrom:[Kubuntu 7.10 _Gutsy Gibbon_ - Release i386 (20071016.1)]/ gutsy main restricted

deb http://in.archive.ubuntu.com/ubuntu/ gutsy main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ gutsy main restricted

deb http://in.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted

deb http://in.archive.ubuntu.com/ubuntu/ gutsy universe
deb-src http://in.archive.ubuntu.com/ubuntu/ gutsy universe
deb http://in.archive.ubuntu.com/ubuntu/ gutsy-updates universe
deb-src http://in.archive.ubuntu.com/ubuntu/ gutsy-updates universe

deb http://in.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb http://in.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse

deb http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb http://security.ubuntu.com/ubuntu gutsy-security universe
deb-src http://security.ubuntu.com/ubuntu gutsy-security universe
deb http://security.ubuntu.com/ubuntu gutsy-security multiverse
deb-src http://security.ubuntu.com/ubuntu gutsy-security multiverse

Revision history for this message
tbd (moodeye) said :
#7

I forgot to mention:

When I do "dpkg -l | grep g++", I do see
ii g++ 4:4.1.2-9ubuntu2 The GNU C++ compiler
ii g++-4.1 4.1.2-16ubuntu2 The GNU C++ compiler
ii g++-4.2 4.2.1-5ubuntu4 The GNU C++ compiler

But when I try "update-alternatives --display g++", it just says "no alternatives for g++".

And "g++ -v" continues to say "4.1.3 20070929 (prerelease) (Ubunt 4.1.2-16ubuntu2)".

Thanks.

Revision history for this message
Best Urbán Dániel (urban.dani) said :
#8

Try "g++-4.2" instead of "g++". There should be an executable: "/usr/bin/g++-4.2", and I think that's the installed v4.2 g++.

(I don't know, why update-alternatives doesn't allow to modify the default g++, but I think /usr/bin/g++ is just a symbolic link to /usr/bin/g++-4.1, so if the above mentioned /usr/bin/g++-4.2 is a good executable, you maybe just need to modify /usr/bin/g++, to point to that.)

Revision history for this message
tbd (moodeye) said :
#9

Thanks Urbán Dániel, that solved my question.

Revision history for this message
tbd (moodeye) said :
#10

Thanks Urban, that worked. I really appreciate your help.

Regards,
--tbd.