網(wǎng)站首頁 編程語言 正文
centOS 8 安裝nginx報錯:
[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
此時進(jìn)入了正常模式,然后按冒號鍵進(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
此時進(jìn)入了正常模式,然后按冒號鍵進(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
啟動nginx服務(wù)
$ sudo systemctl enable nginx
$ sudo systemctl start nginx
檢驗nginx是否在運(yùn)行:
$ sudo systemctl status nginx
默認(rèn)80端口,瀏覽器打開訪問:
原文鏈接:https://blog.csdn.net/qq_36256590/article/details/122937744
相關(guān)推薦
- 2022-04-30 DataGridView自定義單元格表示值、Error圖標(biāo)顯示的方法介紹_C#教程
- 2022-08-28 failed to configure a datasource: ‘url‘ attribute
- 2023-07-25 使用EasyExcel實現(xiàn)Excel的導(dǎo)入導(dǎo)出
- 2022-05-20 Python?文件處理之open()函數(shù)_python
- 2022-12-25 Redis中AOF與RDB持久化策略深入分析_Redis
- 2022-03-14 關(guān)于log4j日志擴(kuò)展---自定義PatternLayout(log4j自定義日志級別)
- 2022-12-28 Python標(biāo)準(zhǔn)庫之urllib和urllib3的使用及說明_python
- 2022-05-14 一起來學(xué)習(xí)React元素的創(chuàng)建和渲染_React
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- 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)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支