3

诡异 YUM 问题: 无法找到(安装卸载)一个特定的包

 3 years ago
source link: https://www.v2ex.com/t/816495
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Linux

诡异 YUM 问题: 无法找到(安装卸载)一个特定的包

  abcbuzhiming · 11 分钟前 · 29 次点击

CentOS 8.4 ,之前在 Nginx 官网,用编写 /etc/yum.repos.d/nginx.repo 的办法装上了 nginx stable 版本的 1.18 。

有新手在未通知我的情况下,给系统装了宝塔面板,然后我知道后,把宝塔面板给卸载了,然后噩梦就来了。

yum 安装其他包是正常的,唯独找不到 nginx 。为了确定问题在哪里,我进行了一系列测试

======
执行:yum install nginx
All matches were filtered out by exclude filtering for argument: nginx
Error: Unable to find a match: nginx

======
执行:yum remove nginx (我之前装的 nginx 还在系统上跑着,nginx 的命令还能用)
All matches were filtered out by exclude filtering for argument: nginx
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!


看到了吗?也找不到。于是我怀疑我的 /etc/yum.repos.d/ 路径下仓库配置文件被动过,于是全部删除,从正常机器上拷贝过来,然后 yum clean all ,yum makecache ,yum update 。全部执行后,问题造就。

======
执行命令: yum repolist all
nginx-stable nginx stable repo enabled

nginx 的仓库和其它正常机器上一模一样没问题


======
执行命令: yum list |grep nginx
好,现在区别来了,正常机器上有这两行
nginx.x86_64 1:1.20.1-1.el8.ngx @nginx-stable
nginx.x86_64 1:1.20.2-1.el8.ngx nginx-stable

而我的机器上缺这两行,其它的 nginx 模块都不缺。

======
执行命令: yum list installed |grep nginx
我的机器没有任何反馈,这表明 yum 认为自己未安装 nginx


现在,这个 Nginx 在我的机器上好像失踪了一般,无法被 yum 找到,但是之前被 yum 安装上去的那个 nginx 版本,还在正常的跑。我实在想不通这种现象如何产生的,我放狗翻遍国内国外社区,尝试了所有能找到的办法,除了把 yum 整个卸载重装以外的一切重置方法,我都试验过了,yum 还是找不到 Nginx ,但是安装其它的东西一切正常。


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK