LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-02-2014, 07:25 AM   #1
f.abbaspour
LQ Newbie
 
Registered: Jun 2014
Posts: 21

Rep: Reputation: Disabled
Unhappy GCC in Debian


Hi
I want to install and setup new version of GCC on my Debian,so for this work I must compile last version of GCC for install new version be completed
I do not know how can i do this?
Or,Is it true that for setup new version of GCC,I must compile last version?
please help me.
 
Old 06-02-2014, 09:05 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Sorry, but why not just install the package. You can use one of the two commands given below. The commands must be run as root or you can use sudo if you prefer.
Code:
apt-get install gcc
aptitude install gcc
Once installed, gcc is ready for use.
jdk
 
Old 06-02-2014, 09:21 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

# apt-get install g++
... to get a fully working gcc.
I.e. the packages { libc-dev, libc-dev-bin, linux-libc-dev, etc.}
that will make gcc work, will be installed as dependencies.

Remark : You cannot compile gcc without the above prerequisites,
and then some https://packages.debian.org/source/wheezy/gcc-4.7

-

Last edited by knudfl; 06-02-2014 at 09:23 AM.
 
Old 06-02-2014, 09:27 AM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by f.abbaspour View Post
I want to install and setup new version of GCC on my Debian,so for this work I must compile last version of GCC for install new version be completed
It is more the opposite of what you said. In order to compile a newer version of GCC, you must first use the package manager in Debian to install some nearly current version of GCC.

Getting GCC source code and compiling it is a bit complicated for a Linux newbie. Are you sure it is something you want to do?

1) Check in your package manager, what is the newest GCC you can install via the package manager. Are you sure that isn't new enough?

2) Maybe you can find a newer GCC in a .deb file (meaning already compiled). That is harder than installing the one offered by the package manager, but easier than compiling.

3) GCC source code does come with pretty clear instructions for compiling it and for making the new one be a version-named alternative to the one installed by the package manager (so the two versions can co exist and you can select which one to use for any specific operation). You do need to be competent at command line Linux and you need to pat attention to details when reading those instructions.
 
Old 06-02-2014, 02:15 PM   #5
f.abbaspour
LQ Newbie
 
Registered: Jun 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Welcome to LQ.

# apt-get install g++
... to get a fully working gcc.
I.e. the packages { libc-dev, libc-dev-bin, linux-libc-dev, etc.}
that will make gcc work, will be installed as dependencies.

Remark : You cannot compile gcc without the above prerequisites,
and then some https://packages.debian.org/source/wheezy/gcc-4.7

-
Thanks.
I want to know that I must install all packages?
 
Old 06-02-2014, 04:33 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 5 .

As post #3 says, the one command # apt-get install g++
.. will take care that you get a fully working gcc.
Just try it, and you can watch the text that shows
all the other packages that will be installed.

-
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GCC 4.5+ on Debian Squeeze jhwilliams Debian 3 03-29-2012 03:35 AM
Debian 6 cant install gcc wmd12string Linux - Newbie 3 05-10-2011 08:25 AM
new to Debian cant find gcc manolakis Debian 2 05-21-2007 09:58 PM
Debian - gcc problem cpd05 Linux - Desktop 2 11-19-2006 05:13 PM
Upgrading gcc-3.4.3 from gcc-3.3.5 on Debian v3.1 MKSrivastava Debian 2 11-21-2005 10:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration