分享

安装memtester报错:./compile: line 3: exec: cc: not found解决办法

 醉人说梦 2018-05-08
                  [root@localhost memtester-4.2.2]# make
( cat warn-auto.sh; \
echo CC=\'`head -1 conf-cc`\'; \
echo LD=\'`head -1 conf-ld`\' \
) > auto-ccld.sh
cat auto-ccld.sh make-compile.sh > make-compile
chmod 755 make-compile
cat auto-ccld.sh find-systype.sh > find-systype
chmod 755 find-systype
./find-systype > systype
( cat warn-auto.sh; ./make-compile "`cat systype`" ) > \
compile
chmod 755 compile
./compile memtester.c

./compile: line 3: exec: cc: not found

解决:

yum install gcc

找不到安装包,更新yum源为

wget http://mirrors.163.com/.help/CentOS5-Base-163.repo

yum makecache报错:

[root@localhost yum.repos.d]# yum makecache

Loaded plugins: fastestmirror
Determining fastest mirrors
http://mirrors.163.com/centos/5Server/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

以为是DNS解析有问题,于是vim /etc/resolv.conf

nameserver 114.114.114.114
nameserver 8.8.8.8

修改dns后仍未解决问题

修改yum源为:

wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

仍存在相同的问题


于是访问http://mirrors.163.com,发现centos5.5的相关说明(5.5的源已不再更新,若要使用使用:go to http://vault./ for packages):

This directory (and version of CentOS) is deprecated.  For normal users,

you should use /5/ and not /5.5/ in your path. Please see this FAQ
concerning the CentOS release scheme:


https://wiki./FAQ/General


If you know what you are doing, and absolutely want to remain at the 5.5
level, go to http://vault./ for packages. Please keep in mind that 5.5 no longer gets any updates

于是修改yum源文件,vi /etc/yum.repos.d/CentOS5-Base-163.repo 

[base]
name=CentOS-$releasever - Base - org.com
baseurl=http://vault./5.5/os/x86_64/
gpgcheck=1
gpgkey=http://vault./5.5/os/x86_64/RPM-GPG-KEY-CentOS-5

其余内容注释掉

再使用yum makeche就不再报错了,安装软件成功


备注:

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897警告是由于安装了旧版本的GPG keys

自动导入:

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
base/gpgkey                                                                                                                     | 1.5 kB     00:00     
Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <centos-5-key@>" from http://vault./5.5/os/x86_64/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]: y

手动导入:

rpm --import /etc/pki/rpm-gpg/RPM*






    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多