網(wǎng)站首頁(yè) 編程語(yǔ)言 正文
centOS 8 安裝nginx報(bào)錯(cuò):
[root@xxx]# yum install nginx
CentOS Linux 8 - AppStream 6.3 kB/s | 2.3 kB 00:00
Errors during downloading metadata for repository 'appstream':
- Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
解決
1. 備份原有配置
cp /etc/yum.repos.d/CentOS-Linux-BaseOS.repo /etc/yum.repos.d/CentOS-Linux-BaseOS.repo1
cp /etc/yum.repos.d/CentOS-Linux-AppStream.repo /etc/yum.repos.d/CentOS-Linux-AppStream.repo1
2. 編輯配置文件
① 編輯CentOS-Linux-BaseOS.repo
vim /etc/yum.repos.d/CentOS-Linux-BaseOS.repo
此時(shí)進(jìn)入了正常模式,然后按冒號(hào)鍵進(jìn)入命令模式,執(zhí)行以下命令:
%s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g
%s/$releasever/$releasever-stream/g
保存退出:
:wq!
② 編輯CentOS-Linux-AppStream.repo
vim /etc/yum.repos.d/CentOS-Linux-AppStream.repo
此時(shí)進(jìn)入了正常模式,然后按冒號(hào)鍵進(jìn)入命令模式,執(zhí)行以下命令:
%s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g
%s/$releasever/$releasever-stream/g
保存退出:
:wq!
3. 構(gòu)建緩存,更新yum源
yum makecache
yum update
4. 繼續(xù)安裝nginx:
sudo yum install nginx
Is this OK[Y/N]: y
啟動(dòng)nginx服務(wù)
$ sudo systemctl enable nginx
$ sudo systemctl start nginx
檢驗(yàn)nginx是否在運(yùn)行:
$ sudo systemctl status nginx
默認(rèn)80端口,瀏覽器打開(kāi)訪問(wèn):
原文鏈接:https://blog.csdn.net/qq_36256590/article/details/122937744
相關(guān)推薦
- 2022-03-30 Android實(shí)現(xiàn)定時(shí)任務(wù)功能_Android
- 2022-06-01 jQuery實(shí)現(xiàn)選項(xiàng)卡嵌套效果_jquery
- 2022-07-09 Python3中的re.findall()方法及re.compile()_python
- 2022-07-11 spring boot中動(dòng)態(tài)代理導(dǎo)致自定義注解掃描失敗以及解決辦法
- 2022-12-03 Sql?Server中通過(guò)sql命令獲取cpu占用及產(chǎn)生鎖的sql_MsSql
- 2023-03-11 Rust如何進(jìn)行模塊化開(kāi)發(fā)技巧分享_Rust語(yǔ)言
- 2023-05-06 react中axios結(jié)合后端實(shí)現(xiàn)GET和POST請(qǐng)求方式_React
- 2022-06-10 阿里云日志服務(wù)日志過(guò)濾器配置_服務(wù)器其它
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過(guò)濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支