php做网站需要学的东西,seo最好的cms系统,上百度推广的网站要多少钱,app 制作公司前言 在Linux系统中#xff0c;安装nginx时候#xff0c;需要先安装环境。 Nginx是使用C语言开发#xff0c;安装nginx需要先从官网上将源码下载#xff0c;然后编译#xff0c;编译需要gcc环境,但是在安装gcc环境的时候#xff0c;执行命令报错。
yum install –y gcc-…
前言 在Linux系统中安装nginx时候需要先安装环境。 Nginx是使用C语言开发安装nginx需要先从官网上将源码下载然后编译编译需要gcc环境,但是在安装gcc环境的时候执行命令报错。
yum install –y gcc-c一、报错信息 报错信息一 [rootlocalhost ~]# yum install –y gcc-c 已加载插件fastestmirror, langpacks Loading mirror speeds from cached hostfile base: mirrors.aliyun.com * c7-media: * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - “Failed connect to mirrors.aliyuncs.com:80; 拒绝连接” 正在尝试其它镜像。 http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - “Could not resolve host: mirrors.cloud.aliyuncs.com; 未知的错误” 正在尝试其它镜像。 base | 3.6 kB 00:00:00 file:///media/CentOS/repodata/repomd.xml: [Errno 14] curl#37 - “Couldn’t open file /media/CentOS/repodata/repomd.xml” 正在尝试其它镜像。 file:///media/cdrecorder/repodata/repomd.xml: [Errno 14] curl#37 - “Couldn’t open file /media/cdrecorder/repodata/repomd.xml” 正在尝试其它镜像。 file:///media/cdrom/repodata/repomd.xml: [Errno 14] curl#37 - “Couldn’t open file /media/cdrom/repodata/repomd.xml” 正在尝试其它镜像。 One of the configured repositories failed (CentOS-7 - Media), and yum doesn’t have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work “fix” this: 1. Contact the upstream for the repository and get them to fix the problem.2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Run the command with the repository temporarily disabledyum --disablerepoc7-media ...4. Disable the repository permanently, so yum wont use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable c7-mediaorsubscription-manager repos --disablec7-media5. Configure the failing repository to be skipped, if it is unavailable.Note that yum will try to contact the repo. when it runs most commands,so will have to try and fail each time (and thus. yum will be be muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setoptc7-media.skip_if_unavailabletruefailure: repodata/repomd.xml from c7-media: [Errno 256] No more mirrors to try. file:///media/CentOS/repodata/repomd.xml: [Errno 14] curl#37 - “Couldn’t open file /media/CentOS/repodata/repomd.xml” file:///media/cdrecorder/repodata/repomd.xml: [Errno 14] curl#37 - “Couldn’t open file /media/cdrecorder/repodata/repomd.xml” file:///media/cdrom/repodata/repomd.xml: [Errno 14] curl#37 - “Couldn’t open file /media/cdrom/repodata/repomd.xml” 报错信息二centos7 yum安装使用时提示 cannot find a valid baseurl for repo:base/7/x86_64 。 二、解决方案 第一步先看本地yum是否安装
直接linux下输入yum查看出现如图信息说明已经安装就不需要再安装直接到第四步。
[rootlocalhost yum.repos.d]# yum第二步卸载yum如果上一步没有安装则安装
rpm -qa | grep yum | xargs rpm -e --nodeps第三步安装yum 第四步yum命令报错解决方案
这个报错是因为yum配置源不对的问题这个配置文件在/etc/yum.repos.d/ 目录下的CentOS-Base.repo文件中重新下载一个阿里或者163的yum源配置文件文件名字不一样的改成CentOS-Base.repo。
下载163yum镜像源根据自己的版本选择不同的下载地址 第1步 备份你的原镜像文件以免出错后可以恢复。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 第2步 下载新的CentOS-Base.repo
CentOS 6下载命令
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repoCentOS 7下载命令
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo3、 第3步 运行 yum clean allyum makecache 生成缓存
yum clean allyum makecache3、 **第4步**如果还不行那么就需要换一个下载源地址。
第五步可以执行命令了
yum install –y gcc-c