LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   make : cc : command not found (https://www.linuxquestions.org/questions/linux-newbie-8/make-cc-command-not-found-657858/)

hash123 07-24-2008 12:23 AM

make : cc : command not found
 
I am trying to build a sample kernel module called to print "hello world" .
I want to generate a .ko file from the .c file

so i type the command
% make hello

I get the following error.

% make : cc : command not found
% make : *** [hello] Error 127

I think that this error might be because may be cc compiler might not be installed .
but how do i check whether it is installed or not ?
and in case i find that it is not installed then what do i do and how do i install it?

John VV 07-24-2008 12:52 AM

the process varies depending on your distro
for Fedora 8 or 9 it would be
~]# yum install kernel-devel
just install the your currant kernel source packages
and the dev tools for your distro

pgroover 07-24-2008 01:01 AM

As John VV pointed out, it all depends on your distro. If you're using Ubuntu, you could just do the following:
sudo apt-get install build-essential

Alternatively, you could simply do this to just get the compiler:
sudo apt-get install gcc

hash123 07-24-2008 01:43 AM

yum localinstall gcc
 
i am working on fedora core 8 installed as a guest OS on a vmware server

I tried using yum install gcc
but it give the following error:

Could not retrieve mirrorlist http://mirrors.fedoraproject.org/mir...ra-8&arch=i386 error was [Errorno 4]IOError: <urlopen error (-2, 'Name or service not known')>
Erro: Cannot retrieve repository metadata (repomd.xml)for repository : fedora.
Please verify its path and try again.

John VV 07-24-2008 01:56 AM

as to the error
1) mirror may be down , it happens try tomorrow
2) wrong mirror , there has been a change it the last 7 months
[code]
su -
gedit /etc/yum.repo.d/fedora.repo
mine
Quote:

[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
failovermethod=priority
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
from Applications / add/remove just put a check in
Development / Development Libraries
Development / Development Tools
if using Gnome
Development / GNOME software Development
Development / Legacy Software Development
and install

hash123 07-24-2008 03:47 AM

when i tried to save the fedora.repomine file ,it gives the error "File Not Found"

hash123 07-24-2008 04:05 AM

hey well i could find the file in the yum.repos.d directory
but the file already contains the same code which u gave.
and so when i install it it gives the same error.

Tinkster 07-24-2008 10:38 AM

Is the networking set-up right for your VM? Can you contact the
host OS, can you ping anything on the network?

John VV 07-24-2008 10:59 AM

also you can try uncommenting the baseurl in fedora.repo and fedora_update.repo
Code:

#baseurl=http://do...
-- to ---
baseurl=http://do...

can you access google.com or yahoo.com while in the vm environment


All times are GMT -5. The time now is 06:57 PM.