解决:centos 8 安装bashtop报错Error: Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist
前景:
在某乎发现一个挺华炫的资源监控工具bashtop,于是参考:https://github.com/aristocratos/bashtop#installation 章节进行安装尝试一下。
过程:
根据提供centos 8的命令使用如下:
dnf config-manager --set-enabled PowerTools
dnf install epel-release
dnf install bashtop
结果发现相关error,完整报错信息如下:
[root@brendon ~]# dnf install bashtop
Repository epel is listed more than once in the configuration
CentOS Linux 8 - AppStream 103 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
搜索报错相关Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist信息,someone said与centos8于21年底停止了维护有关?(待确定?)
centos8官方源已下线
解决方案:
更换下载源:我这里更换为阿里源(云服务器的版本为centos8.5.2111)
更换前请做相应备份以便回滚(我这已经连makedir都报错了,所以不备份,直接干掉)
1、换源:
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
2、yum缓存先清再生:
yum clean all
yum makecache
3、安装bashtop提供的命令重新执行:发现bashtop not found(无解?是不是这个在线下载通道下线了bashtop???)
4、改为手动安装:
我把它部署在 /usr/local下:
1)、git clone https://github.com/aristocratos/bashtop.git
2)、yum install -y git
(可选)—如果你的服务器已经安装了git命令则无需此步。
3)、cd bashtop/
4)、sudo make install
5)、最后执行bashtop即可启动:
这样炫酷的监控界面就出来了:
ps:
卸载:在bashtop的路径下执行[root@brendon bashtop]# sudo make uninstall
即可。
参考资料:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11QTXSya