Install gcc in Ubuntu Kali Virtual Machine Program c | IndianTechonEra - IndianTechnoEra
Latest update Android YouTube

Install gcc in Ubuntu Kali Virtual Machine Program c | IndianTechonEra

Install gcc on ubuntu kali virtual machine program c | IndianTechonEra,

 

How to install gcc in Ubuntu, Kali Linux on Virtual Machine? | IndianTechnoEra


Aim - To install a C compiler in Virtual machine and execute sample program using.

Some of Linux OS contain C compiler gcc.

To check gcc in your system run gcc --version in the terminal of your OS.

If gcc will be in your system then you will show the gcc version like this

gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Install gcc in Linux/ Ubuntu by commands

Open Virtual-box software

Run your Operating System (Ubuntu/ Kali or any one)

Run the following command in terminal

sudo apt update

sudo apt install build-essential

sudo apt-get install manpages-dev

gcc --version

Or,

sudo apt install build-essential

sudo apt purge gcc

sudo apt-get autoremove

sudo apt update

sudo apt upgrade

sudo apt full-upgrade

sudo apt install gcc

gcc --version


After successful installed the gcc and get the version, follow the step to create a C program file and write the c-programming code and execute

Step 1: Open terminal 

Step 2; Type sudo nano HelloWorld.c where HelloWorld is your name of c-program.

Step 3: Type the code of c-programming as given the following

#include <stdio.h>

int main(void){

    printf("Hello World \n");

}

 

Step 4: Press Ctrl+O and Ctrl+X key combinations for saving the file 

Step 5: Then exit from the editor mode respectively.

Step 6: For compiling, type the command as: 

gcc HelloWorld.c –o HelloWorld

Step 7: For execution of the file, type as:

./HelloWorld

Step 8: Now result of the C program will be displayed.

Or instead of install by terminal you can download gcc.ova and you can use only as per need at the time to import this downloaded file. Just follow the step

1. Open VirtualBox.

2. Select File -> Import Appliance -> Select file named ‘ubuntu15 with gcc.ova’ ->

Open ->Next -> Import.

3. Select ‘ubuntu15’ virtual machine and select start button.

4. Enter into terminal mode and type as ‘sudo nano first.c’. and follow as crate execute command


إرسال تعليق

Feel free to ask your query...
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.