Using C compiler on Linux
OK, somebody gave me their old machine, its been completely abandoned, and I dont hardly know a thing about it. I am a complete newbie at Linux so please dont yell at me.
uname -a: Linux machine_name 2.4.20-20.7.XFS.1.3.1smp #1 SMP <date> <time> i686 unknown 1) What kind of Linux is this? On startup, it doesnt tell me this information, so I have no clue if its redhat, caldera, mandrake, or what. Now this is what happens when I type gcc or cc gcc: Command not found 2) I thought all Linux software came with a C compiler? 3) So now I guess I have to download and install a compiler. This seems pretty complex to me. How do I do this? Does one C compiler work on all the different types of Linux or do I have to find one that SPECIFICALLY matches that machine? Please help :scratch: |
1.
Check if there is a file named /etc/redhat-release or /etc/debian_version. Alternatively you can check /etc/issue and /etc/motd to get some more hints about the system. 2. They should. But eg. SuSe personal doesn't. And you can always uninstall any component you want, but IMHO system is broken without c compiler (all W systems are broken). 3. It is easiest to first figure out what distribution that is and then find a matching package that contains the c compiler in question. |
Quote:
|
Personally I would start again anyway. Linux is free to download, get a copy of Fedora or Mandrake and start from scratch. You'll get a more up to date kernel for a start.
As for the line about: Code:
Linux machine_name 2.4.20-20.7.XFS.1.3.1smp #1 SMP <date> <time> i686 unknown |
Many distro's will leave a file in
/etc that gives an inidcation of what you're dealing with .... Mine for instance says [tink@diggn:~]$ cat /etc/slackware-version Slackware 10.0.0 I've seen similar things on debian, Redhat and Mandrake machines ... tink@server:~ ls -l /etc/*version* -rw-r--r-- 1 root root 17 Jul 18 2002 /etc/debian_version Cheers, Tink |
OK I looked:
In the etc directory, there IS a file called redhat-release. There is no file called debian_version. There is also a file called motd, but its an empty file. There is also a file called issue, but it only says "GEMS Linux 1.8.9" OK, so I'm assuming that this machine has Red Hat. Can I assume that its Redhat version 2.4 or what? Do those uname numbers go together with the Red Hat version or is that something else? |
|
Quote:
|
1) uname won't tell you which distribution you are running, only the version of the kernel that you have running.
Most Linux distributions will tell you a welcome message on each text console on a virtual terminal, so you can probably find this out by pressing Ctrl+Alt+F1 through Ctrl+Alt+F7 and seeing what it says. (F7 should get you back to a graphical desktop if you run one). You could also try running “locate SuSE”, “locate debian” etc. as most distributions install at least one configuration or setup file containing the distro's name. 2) All major distributions usually ship with a C compiler on the install disks. This doesn't mean it will necessarily be installed. Assuming you're on an RPM based system (most distros except Debian seem to use RPM), you can run the command Code:
rpm -qil gcc | more 3) Debian is easy; you can install gcc by connecting to the 'net, and typing (as root) Code:
apt-get --install gcc You can install the rpms using Code:
rpm --install *.rpm Note: gcc is big and will take a long time to download and install, especially if you try to download its dependencies as well. You could also look at other C compilers for Linux, such as IBM's (which boasts slightly better optimisation than gcc for later processors). 4) As with any linux program, a C compiler will not work on all versions of Linux. It is, however, possible to compile a program and link it statically (copying the library routines instead of linking to them) so that it will work on any Linux or UNIX system with the same processor (and anything compiled for a 386 will run on later Intel processors too). But I don't thing there are any staticly-linked C compilers out there. I may be wrong. Hope that's of some help, — Robert J. Lee |
Quote:
any thing to do with Linux development at all.........so Technically GNU is NOT part of linux........ |
I went to that website for the binary pre-compiled gcc programs, and found the following available for download:
ftp://ftp.thewrittenword.com/package...ame/gcc-3.3.2/ gcc.3.3.2.rpm4.tar.z The website said it was for i686 redhat linux 9. I guess I can try this and see if its compatible. Unfortunately, its 131 MB so I will be waiting many hours for download. What if my Redhat is only release 7 or something? Does that mean this software wont work? |
Quote:
Try a cat /etc/redhat-release Cheers, Tink |
hopbalt; from u r last post reply #6 u stated u found a reference to redhat
so it maybe remanents left by last owner. that could be a starting point. or as some of the others suggested acquire any other distro via download or cd,whatever & update to that os acquired. my bet would be upgrade is better & probably newer more stable. 2nd ? compile if u wish its your machine (know what ur doing?) & that makes u boss(superuser/root) og for it! |
Quote:
Hey it may even put an end to the "What version of linux is best for me?" questions that are forever posted by people too lazy to search. |
Quote:
GEMS is the name of the company that used to own this machine. They gave it away to a friend of mine who works there because they upgraded all their machines and threw the old ones away. Then the friend gave it to me. What I dont understand is that even when the GUI loads up, it doesnt tell you antying about what version of Redhat it is. I hope the RPM I'm downloading works. |
All times are GMT -5. The time now is 05:29 PM. |