# 虚拟机中centos service restart 问题和yum 无法使用问题

来源:互联网 发布:飞秋2013正式版 mac版 编辑:程序博客网 时间:2024/05/18 01:23

yum 报错
1. One of the configured repositories failed (Unknown),
2. and yum doesn’t have enough cached data to continue. At this point the only
3. safe thing yum can do is fail. There are a few ways to work “fix” this:
4.
5.
6. 1. Contact the upstream for the repository and get them to fix the problem.
7.
8.
9. 2. Reconfigure the baseurl/etc. for the repository, to point to a working
10. upstream. This is most often useful if you are using a newer
11. distribution release than is supported by the repository (and the
12. packages for the previous distribution release still work).
13.
14.
15. 3. Disable the repository, so yum won’t use it by default. Yum will then
16. just ignore the repository until you permanently enable it again or use
17. –enablerepo for temporary usage:
18.
19.
20. yum-config-manager –disable
21.
22.
23. 4. Configure the failing repository to be skipped, if it is unavailable.
24. Note that yum will try to contact the repo. when it runs most commands,
25. so will have to try and fail each time (and thus. yum will be be much
26. slower). If it is a very temporary problem though, this is often a nice
27. compromise:
28.
29.
30. yum-config-manager –save –setopt=.skip_if_unavailable=true
31.
32.
33. Cannot find a valid baseurl for repo: base/7/x86_64
service network restart 报错
Job for network.service failed. See ‘systemctl status network.service’ and ‘journalctl -xn’ for deta

这都是由于网络配置引起的,可能是由于网络配置脚本/etc/sysconfig/network-scripts/ifcfg-en33 配置不对,我的解决办法, 虚拟机网络适配器配置由NAT换成桥接模式即可 就不用与宿主机公用ip