I ran into below problem on RHEL while using gcc to compile a C file.
[test]$ gcc hello.c
as: unrecognized option '-Qy'
Then found my "as" is the MIPS version:
[test]$ as -v
GNU assembler version 2.13.2 (mips-dec-ultrix42) using BFD version 2.13.2
So I tried to remove MIPS utilities and reinstall x86 gcc and x86 binutilites by issuing:
sudo yum erase binutils-mips64-linux-gnu.x86_64
sudo yum install gcc-4.4.6-4.el6.x86_64
sudo yum install binutils-2.20.51.0.2-5.34.el6.x86_64
But the problem still occurred. Anyone has any clue on how to replace my "as" with a x86 version?
BTW, Linux release info is as following:
[test]$ lsb_release -a LSB Version:
:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:gaphics-4.0-noarch:printing-4.0-amd64:printing- 4.0-noarch
Distributor ID: RedHatEnterpriseWorkstation Description: Red Hat
Enterprise Linux Workstation release 6.3 (Satiago) Release: 6.3
Codename: Santiago
Related
RHEL 7 comes with built-in gcc of version 4.8.
If I do
yum remove gcc
then it removes gcc 4.8. How can I remove gcc 7.3 from the system completely?
I have tried to find the solution for the above problem but most of the solution is for Ubuntu. Can someone help to figure out a solution for CentOS/RHEL?
Thanks.
Note:
which gcc
/usr/local/bin/gcc
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=c,c++
Thread model: posix
gcc version 7.3.0 (GCC)
Try to give version number in package name to yum:
yum remove gcc-7.3.0
I just install a kali-linux, and trying to play with it.
I did use ubuntu before. That cause some problems with different gcc version when I am trying to use some code what I build in my old Ubuntu.
I check the gcc -v; the kali give me
gcc version 6.1.1 20160802(Debian 6.1.1-11)
and ubuntu give me
gcc version 5.4.0 20160609 (ubuntu 5.4.0-6ubuntu1~16.04.2)
I am not sure if my code doesn't compile because of this or not. But just want to check.
how can I remove Debian's gcc and switch to ubuntu one?
May be i'm not much familiar with debian. But with Ubuntu, i've followed this and changed the gcc version. May be this will help.
Change default gcc version
You can use this command to install gcc versions.
sudo apt-get install gcc-4.3 gcc-4.4
Once installed, you have to update the alternatives with the variant gcc versions. Using
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 10
You can choose which version of gcc, you can use by this command.
sudo update-alternatives --config gcc
I need to compile a special program (i.e. configuring, making, and making install processes of nest) by an old version of g++ such as 3.3 or 3.4. However, I don't have such versions in my package manager.
I downloaded g++-3.0-3.0.4-7_alpha-deb, but I don't know if it is the true version for Linux, or how can I install it and set as the default compiler. I will appreciate if any one informs me of its possible dangers to my Linux (as I read in Google).
First : You can have as many versions of gcc, g++ as you want, installed at the same time.
The default Mint 18, Ubuntu 16.04 versions are :
sudo apt install g++ g++-4.7 g++-4.8 g++-4.9
The reliable gcc, g++ version 3.4.6 : compat-gcc34-3.4.6-ubuntu1204-1_amd64.deb
https://drive.google.com/file/d/0B7S255p3kFXNRTkzQnRSNXZ6UVU/view?usp=sharing
, and compat-gcc-34-c++_3.4.6-20_amd64.deb https://drive.google.com/file/d/0B7S255p3kFXNV3J3bnVoWGNWdG8/view?usp=sharing
Please install with sudo dpkg -i compat-gcc*
Using, examples : 1) export CC=gcc34 CXX=g++34 && [other command] , like 2) export CC=gcc34 CXX=g++34 && ./configure ... and 3) make CC=gcc34 CXX=g++34
Though iperf is successfully installed inside the container, Docker doesn't recognize it:
Docker version:
$ sudo docker version
Client version: 1.0.1
Client API version: 1.12
Go version (client): go1.2.1
Git commit (client): 990021a
Server version: 1.0.1
Server API version: 1.12
Go version (server): go1.2.1
Git commit (server): 990021a
Image inf.
root#15cb22522f30:/#uname -a && cat /etc/lsb-release
Linux f93f33213b2a 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"
iperf package installation:
root#15cb22522f30:/#wget https://iperf.fr/download/iperf_2.0.2/iperf_2.0.2-4_i386
root#15cb22522f30:/#chmod +x iperf_2.0.2-4_i386
root#15cb22522f30:/#sudo mv iperf_2.0.2-4_i386 /usr/bin/iperf
File located:
root#15cb22522f30:/# which iperf
/usr/bin/iperf
Docker doesn't recognize it:
root#15cb22522f30:/# iperf
bash: /usr/bin/iperf: No such file or directory
You are trying to execute a 32 bit binary on a 64 bit system.
Docker runs on 64 bit systems, and produces 64 bit containers [*]
The copied iperf file is a 32 bit binary.
file /usr/bin/iperf
/usr/bin/iperf: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped
After hunting around, I found if you install these 32 bit libs in the docker container:
apt-get update && apt-get install libc-i386 lib32stdc++6
Then it will at least load iperf:
iperf
Usage: iperf [-s|-c host] [options]
Try `iperf --help' for more information.
[*] A few people have hacked dockers tools to run on 32 bit systems, so it can be done -- but it isn't the norm and appears to have been rejected by the docker leaders in favor of a single standard.
Paul's answer solved the issue. I additionally had to install i386 architecture for 32-bit packages to be installed automatically:
dpkg --add-architecture i386
apt-get update
apt-get install libc6-dbg
apt-get install libc6-dbg:i386
apt-get install lib32stdc++6
Background:
Made CentOS 6.6 x64 VM on VMware workstation 10.
sudo yum update
Directly installed gcc 4.8.2 from answer given here.Set variables using scl enable devtoolset-2 bash
Downloaded libtool 2.4.3
wget http://gnumirror.nkn.in/libtool/libtool-2.4.3.tar.gz
./configure --prefix=/usr`
sudo make
Build errors
config.log
$uname -a
Linux sphirewall 2.6.32-504.1.3.el6.x86_64 #1 SMP Tue Nov 11 17:57:25 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Try lower version.
It worked for me :
OS Centos 6.7
[root#host libtool-2.4]# cat /etc/centos-release
CentOS release 6.7 (Final)
GCC version
[root#host libtool-2.4]# rpm -q gcc
gcc-4.4.7-18.el6.x86_64
libtool from ftp://ftp.gnu.org/gnu/libtool/libtool-2.4.tar.gz