我有一些奇怪的行为yum对rpm,两者都声称安装,但只有rpm实际上创建文件,而yum只是声称安装。我不知道我做错了什么,以及为什么文件不会通过yum安装在码头。
步骤:
docker run --rm -it centos:7
设置yum缓存,以便我们可以通过yum和rpm使用相同的文件。
vi /etc/yum.conf
-> set keepcache=1让我们开始安装百胜
yum install -y centos-indexhtml
裁剪输出:
Installed:
centos-indexhtml.noarch 0:7-9.el7.centos
Complete!现在,这个包应该按照https://rpmfind.net/linux/RPM/centos/7.7.1908/x86_64/Packages/centos-indexhtml-7-9.el7.centos.noarch.html将文件安装到/usr/share/doc/HTML中
ll /usr/share/doc/HTML
ls: cannot access /usr/share/doc/HTML: No such file or directory因此,让我们从yum卸载这个包,并使用yum缓存,然后直接从RPM安装。
yum remove -y centos-indexhtml
(trimmed output)
Removed:
centos-indexhtml.noarch 0:7-9.el7.centos
Complete!rpm -Uvh /var/cache/yum/x86_64/7/base/packages/centos-indexhtml-7-9.el7.centos.noarch.rpm
Preparing... ################################# [100%]
Updating / installing...
1:centos-indexhtml-7-9.el7.centos ################################# [100%]并核实文件是否存在:
ll /usr/share/doc/HTML
total 16
drwxr-xr-x 2 root root 4096 Jan 10 18:18 en-US
drwxr-xr-x 2 root root 4096 Jan 10 18:18 img
-rwxr-xr-x 1 root root 4833 May 16 2014 index.html我对百胜有什么错?我没有收到任何错误,只是没有任何东西写在路上通过百胜?
发布于 2020-01-13 08:14:45
停靠库中的yum配置略有不同:在同一个/etc/yum.conf文件中,您会发现:
tsflags=nodocs这意味着软件包不会安装它们的文档。在docker映像中,大多数人的目标是拥有尽可能小的工作应用程序,从而删除文档化文件。
通过直接使用rpm,您将绕过此yum配置。
https://serverfault.com/questions/998497
复制相似问题