Install gcc on kali linux

How to install a specific version of GCC in Kali Linux?

This question appears to be addressed properly in several questions and other places easily found with Google, but I don’t find the solution satisfactory for the reasons explained below. But just for completion, I’ve included some relevant links: https://askubuntu.com/questions/138284/how-to-downgrade-a-package-via-apt-get https://askubuntu.com/questions/428772/how-to-install-specific-version-of-some-package/428778 https://askubuntu.com/questions/26498/choose-gcc-and-g-version . And others. However, this question is regarding installing a very specific version of GCC in Kali Linux, which does not appear readily available as a specific package. In particular, the question is regarding how to install version 6.3.0, as I need this version to compile a particular program: https://www.reddit.com/r/Monero/comments/6d0ah8/xmrig_miner_new_release/ (as a bonus question, if there is a more sane way to fix this particular issue without using a different version of GCC, feel free to answer, but I believe this question is general and I would like to know how to do it regardless of how to make the aforementioned program link correctly) The versions which are available to install of any package, e.g. gcc, can be determined with:

This will install the older version 4:4.9.2-2, by simply (I believe) overwriting the 7.2.0-1d1 install, if present. To get version 4:4.9.2-2 available at all, I had to add deb http://old.kali.org/kali sana main non-free contrib to my /etc/apt/sources.list file and then run apt-get update . However, what if the version I need is not listed? I’ve been experimenting with various sources, e.g. those found here: http://snapshot.debian.org/ and at various other questions and websites from Google searches. Most of them give me ignore or errors, e.g. as follows

Ign:3 http://snapshot.debian.org/archive/debian/20091004T111800Z lenny InRelease 

Even if this would work, it seems to be a very bad approach to get a particular version installed, as adding some arbitrary source might not have the particular version I want. If I search on snapshot.debian.org for gcc, I get only very old versions: http://snapshot.debian.org/package/gcc/ I eventually became frustrated with this approach and compiled GCC 6.3.0 from the source tarball. The compilation was successful, but then I’m faced with how to install it. I’m cautious about running make install as I fear it will tamper with apt and dpkg and possibly break the system. Instead, I attempted to run it from the build directory, directly. I tried to simply add the build directory as the first entry in my PATH, which didn’t work. Then, I attempted to rename /usr/bin/gcc and do a symlink from /usr/bin/gcc to where my gcc-6.3.0 executable lives. This presents the following problem:

cc: error trying to exec 'cc1': execvp: No such file or directory, which 
/usr/include/stdio.h:34:21: fatal error: stddef.h: No such file or directory 

Which I assume is because of a missing entry in /usr/lib/gcc/x86_64-linux-gnu . I tried to make a symlink from 6 to 6.3.0, but this wasn’t sufficient. I also tried to actually copy everything with cp -R , same result. This should be a 64-bit program, but I also considered the same for /usr/lib/gcc/i686-linux-gnu . I’m sure I could start doing strace to see where it attempts to open the files from, read log files, read the source, and eventually I imagine I’d be able to figure out how to hack together a poorly conceived solution. But it would be nice if someone could tell me how to do this in a sane manner.

Читайте также:  Grafana zabbix linux dashboard

Источник

How To Install gcc-9 on Kali Linux

In this tutorial we learn how to install gcc-9 on Kali Linux.

What is gcc-9

This is the GNU C compiler, a fairly portable optimizing compiler for C.

There are three ways to install gcc-9 on Kali Linux . We can use apt-get , apt and aptitude . In the following sections we will describe each method. You can choose one of them.

Install gcc-9 Using apt-get

Update apt database with apt-get using the following command.

After updating apt database, We can install gcc-9 using apt-get by running the following command:

sudo apt-get -y install gcc-9 

Install gcc-9 Using apt

Update apt database with apt using the following command.

After updating apt database, We can install gcc-9 using apt by running the following command:

Install gcc-9 Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

After updating apt database, We can install gcc-9 using aptitude by running the following command:

sudo aptitude -y install gcc-9 

How To Uninstall gcc-9 on Kali Linux

To uninstall only the gcc-9 package we can use the following command:

Uninstall gcc-9 And Its Dependencies

To uninstall gcc-9 and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove gcc-9 

Remove gcc-9 Configurations and Data

To remove gcc-9 configuration and data from Kali Linux we can use the following command:

Remove gcc-9 configuration, data, and all of its dependencies

We can use the following command to remove gcc-9 configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge gcc-9 

References

Summary

In this tutorial we learn how to install gcc-9 using different package management tools like apt, apt-get and aptitude.

Читайте также:  Серверы обновления linux ubuntu

Источник

How To Install gcc on Kali Linux

In this tutorial we learn how to install gcc on Kali Linux.

What is gcc

This is the GNU C compiler, a fairly portable optimizing compiler for C.

This is a dependency package providing the default GNU C compiler.

There are three ways to install gcc on Kali Linux . We can use apt-get , apt and aptitude . In the following sections we will describe each method. You can choose one of them.

Install gcc Using apt-get

Update apt database with apt-get using the following command.

After updating apt database, We can install gcc using apt-get by running the following command:

sudo apt-get -y install gcc 

Install gcc Using apt

Update apt database with apt using the following command.

After updating apt database, We can install gcc using apt by running the following command:

Install gcc Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

After updating apt database, We can install gcc using aptitude by running the following command:

sudo aptitude -y install gcc 

How To Uninstall gcc on Kali Linux

To uninstall only the gcc package we can use the following command:

Uninstall gcc And Its Dependencies

To uninstall gcc and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove gcc 

Remove gcc Configurations and Data

To remove gcc configuration and data from Kali Linux we can use the following command:

Remove gcc configuration, data, and all of its dependencies

We can use the following command to remove gcc configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge gcc 

References

Summary

In this tutorial we learn how to install gcc using different package management tools like apt, apt-get and aptitude.

Источник

How To Install gcc-6 on Kali Linux

In this guide, we’ll discuss How To Install gcc-6 on Kali Linux. Also, we will demonstrate how to uninstall and update gcc-6 .

One-liner install command

For those in a hurry, here’s a one-line installation command:

sudo apt-get update && sudo apt -y install gcc-6

But if you are interested in the detailed steps with descriptions, the following information is for you.

What is gcc-6 and what are the ways to install it?

Short description: GNU C compiler

Before beginning this tutorial, you will need access to a server or computer running Kali Linux. This guide was written specifically with a server running Kali Linux in mind, although it should also work on older, supported versions of the operating system.

Читайте также:  Reading linux files in windows

Also, make sure you are running a regular, non-root user with sudo privileges configured on your server. When you have an account available, log in as your non-root user to begin.

There are several ways to install gcc-6 on Kali Linux. You can use (links are clickable):

In the following sections, we will describe each method in detail. You can choose one of them or refer to the recommended one.

Install gcc-6 using apt-get

First, update apt database with apt-get using the following command.

After updating apt-get database, You can install gcc-6 using apt by running the following command:

Install gcc-6 using apt

Because gcc-6 is available in Kali Linux’s default repositories, it is possible to install it from these repositories using the apt packaging system.

To begin, update apt database with apt using the following command.

After updating apt database, You can install gcc-6 using apt by running the following command:

Install gcc-6 using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

After updating aptitude database, You can install gcc-6 by running the following command:

sudo aptitude -y install gcc-6

How to upgrade (update) a single package gcc-6 using apt-get?

First, you will need to update packages index. Run update command as usual:

Next, to upgrade only the gcc-6, e.g. single package, you should use the following format with the apt-get command/apt command:

sudo apt-get --only-upgrade install gcc-6

Note that this command will not install any new packages! If you wish to install the package if it doesn’t exist you may leave out —only-upgrade part.

It’s Good to Know:

This will upgrade the package even if is already installed.

How To Uninstall gcc-6 from Kali Linux

To uninstall only the gcc-6 package you can execute the following command:

Uninstall gcc-6 and all its dependencies

To uninstall gcc-6 and its dependencies that are no longer needed by Kali Linux, you can use the command below:

sudo apt-get -y autoremove gcc-6

Remove gcc-6 with all configurations and data

To remove gcc-6 configuration and data from your system you can run the following purge command:

Remove gcc-6 completely (configurations, data and all of its dependencies)

And lastly, you can run the next command to remove absolutely everything related to gcc-6 package, e.g.: configurations, data and all of its dependencies. Just use this command:

sudo apt-get -y autoremove --purge gcc-6

Extra info and code examples

This is the GNU C compiler, a fairly portable optimizing compiler for C.

Conclusion

You now have a full guide on how to install gcc-6 using apt, apt-get and aptitude tools. Also, we showed how to update as a single package and different ways to uninstall the gcc-6 from Kali Linux.

Источник

Оцените статью
Adblock
detector