Maybe simple...
sudo apt-get install gcc
... could be enough?
Answer from Jot eN on askubuntu.comMaybe simple...
sudo apt-get install gcc
... could be enough?
Do this: open a terminal and type gcc --version. Does anything come up?
Alternatively, search for the gcc executable, which should be located in /usr/bin.
Do ls /usr/bin | grep gcc. What output do you get from that command?
If you get no output from either command, then you need to find your gcc executable wherever you installed it (somewhere in /usr/share maybe?). When found, do cd /usr/bin && ln -s [ABSOLUTE PATH OF GCC].
If you got no output from the first, but output from the second, then you have serious trouble, because /usr/bin is not in your PATH. Edit the file /etc/environment and ADD the following line to the end of the document: PATH="$PATH:/usr/bin".
If you got output from the first, then there is a problem somewhere with bash not reading its own PATH. I think hell would freeze before the first works, but watch you prove me wrong and freeze hell for me. :)
Hope this helps! +1 me if it does!
centos - ./configure cannot find GCC but whereis is able to? - Unix & Linux Stack Exchange
python - error: command 'gcc' failed with exit status 1 on CentOS - Stack Overflow
linux + g++: command not found - Unix & Linux Stack Exchange
gcc - how to install gcc7 in docker centos7 - Stack Overflow
RHEL / CentOS
yum install gcc should work. Try sudo yum install gcc.
If yum groupinstall "Development Tools" does not work, add sudo in front of it as well.
Check your repositories: yum repolist all
That's because it isn't finding a package named solely gcc. That is too broad. Do a yum search gcc to see all of the gcc packages, and the full package name. Then you'll be able to install the correct one. It'll probably be something like yum install gcc 4.x And as others said, don't forget to be in root or do `sudo. I've had this same thing happen to me a few times.
" error: command 'gcc' failed with exit status 1 ". the installation failed because of missing python-devel and some dependencies.
the best way to correct gcc problem:
You need to reinstall gcc , gcc-c++ and dependencies.
For python 2.7
$ sudo yum -y install gcc gcc-c++ kernel-devel
$ sudo yum -y install python-devel libxslt-devel libffi-devel openssl-devel
$ pip install "your python packet"
For python 3.4
$ sudo apt-get install python3-dev
$ pip install "your python packet"
Hope this will help.
Is gcc installed?
sudo yum install gcc
Install the suite of development tools first. Then go back to compile the software.
yum groupinstall 'Development Tools'
You could need much more than just the compiler. The Development Tools package includes the core development tools like automake, gcc, perl, python, flex, make, gdb, bison, and many more. To list all of the software in the package group, use yum as follows.
yum group info 'Development Tools'
For Fedora 20 (at least), you'll additionally need to install gcc-c++.
For Debian-based systems, install the suite of development tools as follows.
apt-get install build-essential
In Void Linux, it's xbps-install -Su base-devel, which provides m4, autoconf, automake, bc, binutils, bison, ed, libfl-devel, flex, libgcc-devel, kernel-libc-headers, glibc-devel, isl, cloog, mpfr, libmpc, gcc, libstdc++-devel, gcc-c++, gettext-libs, gettext, groff, libtool, make, patch, pkg-config, texinfo, unzip, and xz.
On CentOS 7, I only needed
yum install gcc-c++
(but maybe I already had most of the other development packages)
FROM centos:centos7
RUN yum update -y
RUN yum groupinstall "Development Tools" -y
RUN yum install wget -y
RUN curl -O https://ftp.gnu.org/gnu/gcc/gcc-7.3.0/gcc-7.3.0.tar.gz
RUN tar xzf gcc-7.3.0.tar.gz
RUN cd gcc-7.3.0
RUN ./contrib/download_prerequisites
RUN cd ..
RUN mkdir gcc-build
RUN cd gcc-build
RUN ../gcc-7.3.0/configure \
--enable-shared \
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--disable-multilib \
--enable-languages=all
RUN make
# (Go make a cup of ice tea :)
RUN make install
To save the build time you can create a new docker from the running docker using "docker commit" or save /usr/local to a tar file and open it on any other fresh centos7 docker.
Following commands in Dockerfile worked for me:
RUN yum install -y centos-release-scl
RUN yum install -y devtoolset-7-gcc-*
RUN echo "source scl_source enable devtoolset-7" >> /etc/bashrc
RUN source /etc/bashrc