Checking for gcc no linux

unixforum.org

Здравствуйте, прошу не винить за то что тема мб уже повторялась, но поиск ничего подходящего не нашел.

История такая, приобрел vps сервер с операционной fedora 8, попытался установить всякие полезные штуки (например тот же самый mc-4.7.0.2)

После выполнения команды ./configure выдало следующее:

checking for a BSD-compatible install. /usr/bin/install -c checking whether build environment is sane. yes checking for a thread-safe mkdir -p. //bin/mkdir -p checking for gawk. gawk checking whether make sets $(MAKE). yes checking whether to enable maintainer-specific portions of Makefiles. no checking build system type. i686-pc-linux-gnu checking host system type. i686-pc-linux-gnu checking for style of include used by make. GNU checking for gcc. no checking for cc. no checking for cl.exe. no configure: error: in `/var/worktable/mc-4.7.0.2': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details.

Из этого я понял что gcc в системе не установлен. Пока лазил по форумам наткнулся на такую команду: cat /proc/version

Linux version 2.6.18-028stab053.4 (root@rhel5-32-build) (gcc version 4.1.1 20070105 (Red Hat 4.1.1-52)) #1 SMP Mon Jan 14 11:06:00 MSK 2008

Тут вроде написано что gcc присутствует, если я не ошибаюсь?

Так же хотел поискать папки с названием gcc не получилось locate gcc выдало следующее:

locate: can not open `/var/lib/mlocate/mlocate.db': No such file or directory

В чем может может быть проблема почему не работает gcc и locate?

Источник

Checking If GCC Compiler Is Installed On My Linux System

This post will guide you how to check if the gcc compiler or g++ compiler are installed on my ubuntu/CentOS/RHEL Linux system. How to check the location of the installed GCC compiler on Linux. HOw to install GNU c/c++ compiler (GCC and G++) on my Linux system.

Читайте также:  Linux add user with ssh

Checking If GCC Compiler Is Installed

If you want to check if the GNU GCC Compilers are install on your system, you can try to check the version of GCC compiler on Linux, or you can use which command to locate gcc or g++ commands .

Check the Location of GNU or GCC Compiler

Type the following command to check the location of gcc compiler in your system, type:

$ which g++ $ which gcc $which make
devops@devops-osetc:~$ which gcc /usr/bin/gcc devops@devops-osetc:~$ which g++ /usr/bin/g++ devops@devops-osetc:~$ which make /usr/bin/make

Or you can use the type command to achieve the same result of checking the location of all compilers, type:

$ type gcc $ type g++ $ type make
devops@devops-osetc:~$ type gcc gcc is hashed (/usr/bin/gcc) devops@devops-osetc:~$ type g++ g++ is hashed (/usr/bin/g++) devops@devops-osetc:~$ type make make is hashed (/usr/bin/make)

Check Version of Compiler

if you want to check the version of All compilers installed on your Linux system, you just need to execute the following command:

$ gcc --version $ g++ --version $ make --version
devops@devops-osetc:~$ gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 Copyright (C) 2015 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. devops@devops-osetc:~$ g++ --version g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 Copyright (C) 2015 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. devops@devops-osetc:~$ make --version GNU Make 4.1 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Installing GNU GCC Compiler

For CentOS/RHEL 6/7:
You need to execute the following yum command to install gcc compiler, type:

#yum groupinstall "Developent Tools"
#yum group install "Development Tools"

For Ubuntu/Debian Linux:
you need to run the one of the following command to install compilers, type:

$ sudo apt-get install build-essential
$ sudo apt install build-essential

Источник

Читайте также:  Изменить имя интерфейса linux

Installing g++ on windows subsystem for linux

A while back I activated Windows Subsystem for Linux on my machine but didn’t use it much. Now I have an idea what I could use it for and that is why I’m trying to install gcc/++ 7 on my WSL and keep running into problems. My idea was to download it and compile it by hand following this guide with:

../gcc/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=$/software/gcc-7.3.0/installDir --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib 
checking build system type. x86_64-pc-linux-gnu checking host system type. x86_64-pc-linux-gnu checking target system type. x86_64-pc-linux-gnu checking LIBRARY_PATH variable. ok checking GCC_EXEC_PREFIX variable. ok checking whether to place generated files in the source directory. no checking whether a default linker was specified. no checking whether a default assembler was specified. no checking for x86_64-linux-gnu-gcc. no checking for gcc. no checking for x86_64-linux-gnu-cc. no checking for cc. no checking for x86_64-linux-gnu-cl.exe. no checking for cl.exe. no configure: error: in `$HOME/software/gcc-7.3.0/build': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. 

Apparently, there was no(?) gcc installed at all. At least gcc and cc yielded «command not found». So my next step was installing gcc via:

$ gcc --version gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 Copyright (C) 2013 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. 
checking build system type. x86_64-pc-linux-gnu checking host system type. x86_64-pc-linux-gnu checking target system type. x86_64-pc-linux-gnu checking LIBRARY_PATH variable. ok checking GCC_EXEC_PREFIX variable. ok checking whether to place generated files in the source directory. no checking whether a default linker was specified. no checking whether a default assembler was specified. no checking for x86_64-linux-gnu-gcc. x86_64-linux-gnu-gcc checking for C compiler default output file name. configure: error: in `/home/seriously-ubuntu/software/gcc-7.3.0/build': configure: error: C compiler cannot create executables see `config.log' for more details. 
$ gcc foo.c /usr/bin/ld: cannot find crt1.o: No such file or directory /usr/bin/ld: cannot find crti.o: No such file or directory /usr/bin/ld: cannot find -lc /usr/bin/ld: cannot find crtn.o: No such file or directory collect2: error: ld returned 1 exit status 

Any Ideas where I can even start to repair this? I wouldn’t even mind reseting the whole WSL if this helps :/

lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial 
$ sudo add-apt-repository ppa:jonathonf/gcc-7.1 $ sudo apt-get update $ sudo apt-get install gcc-7 g++-7 Reading package lists. Done Building dependency tree Reading state information. Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: g++-7 : Depends: libstdc++-7-dev (= 7.1.0-10ubuntu1~16.04.york0) but it is not going to be installed Depends: libisl15 (>= 0.15) but it is not installable gcc-7 : Depends: cpp-7 (= 7.1.0-10ubuntu1~16.04.york0) but it is not going to be installed Depends: binutils (>= 2.26.1) but 2.24-5ubuntu14.2 is to be installed Depends: libisl15 (>= 0.15) but it is not installable Recommends: libc6-dev (>= 2.13-0ubuntu6) but it is not going to be installed E: Unable to correct problems, you have held broken packages 

UPDATE 2 Sadly none of the suggested ways helped and I ended up nuking the WSL. Apparently, something more severe was broken.

Читайте также:  Where mysql in linux

Источник

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