LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Installing GCC (https://www.linuxquestions.org/questions/linux-newbie-8/installing-gcc-920416/)

kjjohny1991 12-24-2011 10:57 PM

Installing GCC
 
Hai.
How to install gcc.
I do not have network manager hence cannot use apt-get install.
So downloaded package from windows.
used ./configure but cannot use make makeinstall afterward...
Any helps please.

fukawi1 12-24-2011 11:17 PM

Quote:

Originally Posted by kjjohny1991 (Post 4557875)
Hai.
How to install gcc.
I do not have network manager hence cannot use apt-get install.

You say you dont have network manager, but can you connect it manually via the commandline?
Quote:

So downloaded package from windows.
used ./configure but cannot use make makeinstall afterward...
Any helps please.
Why cant you use make? Do you get an error? Posting said error would be most beneficial to people trying to help you. Its highly probably that if gcc isnt installed, make wont be either.

Dark_Helmet 12-24-2011 11:20 PM

Quote:

Originally Posted by kjjohny1991
So downloaded package from windows.
used ./configure but cannot use make makeinstall afterward...

Well, I hate to be blunt, but of course not. You cannot compile the gcc source package if you do not have a compiler. You need to download a pre-compiled binary deb package and install that.

For instance, go to Debian Packages - gcc search results. That assumes you are using a Debian distribution. If you are using something else (e.g. Ubuntu, Mint, etc.), then you'll need to find the web page that lets you download pre-compiled binaries for your distribution.

Pick whichever gcc version you need and that also matches the version/release for your distribution. Download the package to your Windows machine. Copy the package over to your Linux machine, and install the package via the command line. For instance:
Code:

apt-get install /path/to/downloaded/gcc_package.deb
EDIT:
Be aware that you may need to download additional packages. The gcc package you download may have some software requirements of its own before it will install. The kernel headers might be one such package.

EDIT2:
I should also point out that it is very likely you have the needed package on CD/DVD if you installed your distribution from that. Check your install media if you still have them. The good thing is, if the CD/DVD does have the gcc package, it will also have any other necessary packages to support gcc on the CD/DVD as well.

kjjohny1991 12-24-2011 11:54 PM

But where can I get .deb package?That link does not have one .I already have tried the tar.gz from the link but make does not work.

Dark_Helmet 12-25-2011 12:49 AM

Quote:

Originally Posted by kjjohny1991
That link does not have one

Yes, it does. You did not read the page.

At the very top, it says:
Code:

Exact hits
Package gcc

    * lenny (oldstable) (devel): The GNU C compiler
      4:4.3.2-2: amd64 arm armel hppa i386 ia64 mips mipsel powerpc s390 sparc
      4:4.2.4-5: alpha
    * squeeze (stable) (devel): The GNU C compiler
      4:4.4.5-1: amd64 armel i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 sparc
    * wheezy (testing) (devel): GNU C compiler
      4:4.6.1-3: amd64 armel i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 sparc
    * sid (unstable) (devel): GNU C compiler
      4:4.6.2-2: alpha amd64 armel armhf hurd-i386 i386 ia64 kfreebsd-amd64 kfreebsd-i386 m68k mips mipsel powerpc s390 s390x sh4 sparc sparc64
      4:4.5.2-5: hppa

As I said earlier, you need to select the package that matches your version of Debian. You have not said what distribution you are running nor have you said what version of that distribution you are using. So you need to figure that out. The most recent stable version of Debian is named "squeeze." If you are running the most recent stable version, then you would click on the link for "squeeze." And again, if you are using a distribution other than Debian (for example: Ubuntu or Mint) then these packages may not work for you.

If you had clicked on any of those links above, you would have seen a follow-up webpage. At the bottom of that follow-up webpage is a number of download links for architecture-specific deb packages (for example: amd64, i386, ia64, etc.).

EDIT:
Also, after clicking the "squeeze" link (or whichever link is appropriate for your distribution), you see a color-coded list of packages that are required, recommended, and suggested. You must download and install all packages that are indicated as required.

According to that page, you must have cpp and gcc-4.4 installed. You need to download those in addition to the plain "gcc" package. You will also need to download any required packages for cpp and gcc-4.4, and any required packages for those, and so on.

EDIT2:
If you do not want to go hunt for all these packages, then (as I mentioned before) look at your install discs to see if it contains the packages for gcc. If you do not have your install discs anymore, then you can re-download it, burn a new disc, and try to get the packages from there.

kjjohny1991 12-25-2011 02:43 AM

I got my network fixed.So i am trying to install it through the command line.
Do I need to add any repos to do so .....not even any packges it reports an error.It searches the drive rather than the net... :(

teckk 12-25-2011 11:58 AM

Quote:

I got my network fixed.So i am trying to install it through the command line. Do I need to add any repos to do so....
From last members post,
Quote:

You have not said what distribution you are running nor have you said what version of that distribution you are using.
Kind of hard to advise until we have some idea what you are using. If you are using apt-get then...I have this in my notes.

apt-get update Update information from repositories. Do this before running any other commands.

apt-get install newpackage Install newpackage

apt-get upgrade Upgrade all packages that have available upgrades.

apt-get remove oldpackage Remove oldpackage

apt-get remove --purge oldpackage remove oldpackage and purge all associated files

dpkg-query --list "package*" List packages matching the pattern given, and show whether they're installed (line begins ii) or not.

To add a repository, edit /etc/apt/sources.list to add a couple of lines like this:
deb http://example.com/debian stable main
deb-src http://example.com/debian stable main

gcc should be on your install disks.


All times are GMT -5. The time now is 11:07 PM.