我想,作为一个非特权用户,我不能做yum install或yum update ,这是可以理解的。 但我会认为我能够做yum search或yum whatprovides 。 这些命令不应该对我的本地系统进行任何更改,只需查询存储库中的内容即可。
当试图运行yum search或yum whatprovides作为非特权用户但是,我得到一个错误,如:
bash-4.2$ yum search openssh-server ovl: Error while doing RPMdb copy-up: [Errno 13] Permission denied: '/var/lib/rpm/.dbenv.lock' One of the configured repositories failed (Unknown), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=<repoid> ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable <repoid> or subscription-manager repos --disable=<repoid> 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true Cannot find repomd.xml file for rhel7-x86_64-730 bash-4.2$
以root身份login并将此.dbenv.lock为666后,现在我的非特权用户可以yum search但不能提供yum whatprovides 。
bash-4.2$ yum search openssh-server Loaded plugins: ovl, product-id, search-disabled-repos ovl: Error while doing RPMdb copy-up: [Errno 13] Permission denied: '/var/lib/rpm/__db.002' ========================= N/S matched: openssh-server ========================== gsi-openssh-server.x86_64 : SSH server daemon with GSI authentication openssh-server.x86_64 : An open source SSH server daemon openssh-server-sysvinit.x86_64 : The SysV initscript to manage the OpenSSH : server. Name and summary matches only, use "search all" for everything. bash-4.2$ bash-4.2$ yum whatprovides sshd Loaded plugins: ovl, product-id, search-disabled-repos ovl: Error while doing RPMdb copy-up: [Errno 13] Permission denied: '/var/lib/rpm/__db.002' One of the configured repositories failed (Unknown), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=<repoid> ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable <repoid> or subscription-manager repos --disable=<repoid> 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true Caching enabled but no local cache of /var/cache/yum/x86_64/7Server/rhel7-x86_64 -730/856d5d541d62809b07538e7b8b666e115e9871a9-filelists.sqlite.bz2 from rhel7-x8 6_64-730 bash-4.2$
这是因为在这样的查询操作中,yum会自动将东西提取到caching中,如果caching不可写,则会失败? 我(作为根)需要给非特权用户什么文件权限,以便他们可以运行这些yum查询(例如,写入访问某些caching文件夹)?
PS:根可以yum install东西很好,所以它不是连接到百胜储存库服务器本身的问题。
编辑:在将/var/lib/rpm目录中的所有文件修改为666之后,还禁用了ovl插件,但运行yum whatprovides没有得到最初的错误,但仍然无法运行yum whatprovides :
bash-4.2$ yum --disableplugin=ovl whatprovides apropos Loaded plugins: product-id, search-disabled-repos One of the configured repositories failed (Unknown), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=<repoid> ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable <repoid> or subscription-manager repos --disable=<repoid> 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true Caching enabled but no local cache of /var/cache/yum/x86_64/7Server/rhel7-x86_64 -730/856d5d541d62809b07538e7b8b666e115e9871a9-filelists.sqlite.bz2 from rhel7-x8 6_64-730
yum的较新版本允许您以普通用户身份执行非侵入式操作。 对于旧版本,您需要在yum-utils包中使用repoquery 。
此外,似乎ovl插件导致的问题,而不是百胜本身。 你可以通过--disableplugin=ovl来暂时禁用它。