centos7 yum fastestmirror不能使用怎么办
下面由centos基础教程栏目给大家介绍centos7 yum fastestmirror不能使用的解决办法,希望对需要的朋友有所帮助!
centos7 yum fastestmirror不能使用
[root@localhost ~]# yum install lrzsz Loaded plugins: fastestmirror Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
==================================================
第一步:
[root@localhost ~]# vi /etc/yum/pluginconf.d/fastestmirror.conf [main] enabled=1//把1改为0 verbose=0 always_print_best_host = true socket_timeout=3 # Relative paths are relative to the cachedir (and so works for users as well # as root). hostfilepath=timedhosts.txt maxhostfileage=10 maxthreads=15 #exclude=.gov, facebook #include_only=.nl,.de,.uk,.ie
============================================
第二步:
[root@localhost ~]# vi /etc/yum.conf [main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1//将plugins的值修改为0 installonly_limit=5 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum distroverpkg=centos-release # This is the default, if you make this bigger yum won't see if the metadata # is newer on the remote and so you'll "gain" the bandwidth of not having to # download the new metadata and "pay" for it by yum not having correct # information. # It is esp. important, to have correct metadata, for distributions like # Fedora which don't keep old packages around. If you don't like this checking # interupting your command line usage, it's much better to have something # manually check the metadata once an hour (yum-updatesd will do this). # metadata_expire=90m # PUT YOUR REPOS HERE OR IN separate files named file.repo # in /etc/yum.repos.d
=============================================
继续运行,出现如下错误
[root@localhost ~]# yum install lrzsz Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error" One of the configured repositories failed (Unknown), 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 working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=
... 4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable
or
subscription-manager repos --disable=
5. 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 much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=
.skip_if_unavailable=true Cannot find a valid baseurl for repo: base/7/x86_64
==============================================
原因:没有配置resolv.conf
解决方法:
到/etc目录下配置resolv.conf加入nameserver IP,如:
[root@localhost ~]# vi /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4 search localdomain
保存再次运行命令就可以。
更多centos技术文章,请当centos教程栏目!
以上是centos7 yum fastestmirror不能使用怎么办的详细内容。更多信息请关注PHP中文网其他相关文章!

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

热门话题

载CentOS-7.0-1406的时候,有很多可选则的版本,对于普通用户来说,不知道选择哪个好,下面做一下简单介绍:(1)CentOS-xxxx-LiveCD.ios和CentOS-xxxx-bin-DVD.iso有什么区别?前者只有700M,后者有3.8G。其差别不仅仅在大小上,其更本质的差别是,CentOS-xxxx-LiveCD.ios只能加载到内存里运行,不能安装。CentOS-xxx-bin-DVD1.iso才可以安装到硬盘上。(2)CentOS-xxx-bin-DVD1.iso,Ce

打开centos7页面出现:welcometoemergencymode!afterloggingin,type“journalctl-xb”toviewsystemlogs,“systemctlreboot”toreboot,“systemctldefault”totryagaintobootintodefaultmode。giverootpasswordformaintenance(??Control-D???):解决方法:执行r

centos7系统中tmp目录下有很多垃圾,想要清除垃圾,该怎么清除呢?下面我们就来看看详细的教程。查看tmp文件目录下文件列表,执行命令cdtmp/切换到tmp当前文件目录,执行ll命令,查看当前目录下文件列表。如下图所示。使用rm删除文件命令,需要注意的是rm命令是将文件永远从系统中删除,因此建议在使用rm命令时,最好是在删除文件前给出提示。使用命令rm-i文件名,等用户确认删除(y)或跳过删除(n),系统进行相应的操作。如下图所示。

出于安全考虑设置密码规则设置密码到期的天数。用户必须在天内更改密码。此设置仅影响创建用户,而不会影响现有用户。如果设置为现有用户,请运行命令“chage-M(days)(user)”。PASS_MAX_DAYS60#密码到期时间PASS_MIN_DAYS3#初始密码更改时间PASS_MIN_LEN8#密码最小长度PASS_WARN_AGE7#密码过期提示时间重复密码限制使用[root@linuxprobe~]#vi/etc/pam.d/system-auth#nearline15:

1.UncaughtError:Calltoundefinedfunctionmb_strlen();出现如上错误时,说明我们没装上mbstring扩展;2.进入PHP安装目录cd/temp001/php-7.1.0/ext/mbstring3.启动phpize(/usr/local/bin/phpize或/usr/local/php7-abel001/bin/phpize)命令来安装php扩展4../configure--with-php-config=/usr/local/php7-abel

centos7不带mysql数据库了,默认的数据库是mariadb(mysql的一个分支)。可以按照以下步骤手动安装mysql数据库。1.下载rpm安装文件wgethttp://repo.mysql.com/mysql-community-release-el7.rpm2.执行rpm安装rpm-ivhmysql-community-release-el7.rpm依赖解析完成后,出现下列选项:dependenciesresolved=================================

当默认快捷键与使用的软件按键冲突或需要按照自己的习惯使用快捷键,这时候只好修改和设置默认快捷键,该怎么修改CentOS7默认的快捷键额?下面我们就来看看详细的教程。1、开启虚拟机中的Centos7系统,进入桌面2、单击左上角的应用程序->系统工具->设置3、进入到设置界面,单击设备4、选择Keyboard,单击右边任意一项,并在键盘上按下要设置的快捷键,即可更改其快捷键,(注意有些是无法更改的!)5、更改后如下所示,最后点击设置,这样快捷键的设置修改就完成了。

1.压缩文件夹为zip文件[root@cgls]#zip-rmydata.zipmydata2.把mydata.zip解压到mydatabak目录里面[root@cgls]#unzipmydata.zip-dmydatabak3.mydata01文件夹和mydata02.txt压缩成为mydata.zip[root@cgls]#zipmydata.zipmydata01mydata02.txt4.直接解压mydata.zip文件[root@cgls]#unzipmydata.zip5.查看myd
