太奇怪了,我有一个centos7 VM盒子。尝试安装,dnf
因为它是另一个包的依赖项。
互联网上的大多数说明是这样的:
sudo yum install epel-release
sudo yum install dnf
Run Code Online (Sandbox Code Playgroud)
但没有安装。 No package dnf available
甚至关注 DNF 博客:http : //dnf.baseurl.org/2016/07/01/fresh-dnf-for-rhel-7-and-centos-7/
# cat <<EOF > /etc/yum.repos.d/dnf-stack-el7.repo
[dnf-stack-el7]
name=Copr repo for dnf-stack-el7 owned by @rpm-software-management
baseurl=https://copr-be.cloud.fedoraproject.org/results/@rpm-software-management/dnf-stack-el7/epel-7-\$basearch/
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/@rpm-software-management/dnf-stack-el7/pubkey.gpg
enabled=1
enabled_metadata=1
Run Code Online (Sandbox Code Playgroud)
仍然没有安装
# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
# yum search dnf
Loading mirror speeds from cached hostfile
* base: centos.bhs.mirrors.ovh.net
* epel: mirror.umd.edu
* extras: centos.bhs.mirrors.ovh.net
* remi-safe: remi.mirror.ate.info
* updates: centos.bhs.mirrors.ovh.net
========================================================================= N/S matched: …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Ansible 的 dnf 模块和开关module
来从 remi 存储库安装 PHP 7.4。
我将其作为命令执行,因为我无法使用 Ansible dnf 让它工作。
这就是我想做的:dnf module -y install php:remi-7.4
我不知道是否可以使用module
Ansible dnf 模块上的开关。有谁知道这是否可能?
谢谢,
大卫
感谢回复。我在 Ansible 中使用模块没有问题,但在使用 Ansible 使用dnf
参数时遇到问题。module
dnf
我正在这样做:
- name: install php from stream {{ php_module_stream }}
command: dnf module -y install {{ php_module_stream }}
Run Code Online (Sandbox Code Playgroud)
我想做这样的事情:
- name: install php from stream {{ php_module_stream }}
dnf:
name: {{ php_module_stream }}
module: true
Run Code Online (Sandbox Code Playgroud)
我不知道如何使用这个module
词dnf
。
我正在更新我的一些 ansible playbook 以在最新版本的 Fedora 上运行,该版本现在dnf
默认使用。
由于我的大部分剧本也应该在 CentOS 上运行,我希望我的脚本yum
在对 CentOS 机器运行dnf
时运行 ansible 命令,在对 Fedora 运行时运行该命令(Ansible 1.9 中的新功能),但使用其余的角色原样。
换句话说,我想编写一个可以智能地选择正确命令的单个操作(类似于):
- name: Install zsh
sudo: yes
yum|dnf: name=zsh state=latest
Run Code Online (Sandbox Code Playgroud)
...而不是复制粘贴相同的命令两次,更换yum
与dnf
两个中的一个,然后执行一些逻辑,说两个不同的角色来运行的一个至极:
- name: Install zsh (yum version)
sudo: yes
yum: name=zsh state=latest
- name: Install zsh (dnf version)
sudo: yes
dnf: name=zsh state=latest
Run Code Online (Sandbox Code Playgroud)
在有人冲过去之前:我知道yum
在dnf
最新的 Fedora 上有一个别名,并且我可以将剧本保持原样......我的问题不是关于编写 CentOS/Fedora 兼容的剧本,我的问题是关于选择一个根据目标环境,相同参数的不同命令
有没有办法通过 yum (dnf) 存储库在 Fedora 上安装 CentOS 软件包?我正在尝试安装 freeswitch,但他们自己的存储库仅提供适用于 RHEL 和 CentOS 的构建。我假设 CentOS 和 Fedora 足够兼容以安装 rpm 包,但如果我可以使用存储库会更好。
下面是来自 CentOS 机器的存储库查询。
[foverzar@localhost ~]$ yum list freeswitch
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.logol.ru
* epel: fedora-mirror01.rbc.ru
* extras: mirror.logol.ru
* updates: mirror.h1host.ru
Installed Packages
freeswitch.x86_64 1.6.13-1.el7.centos @freeswitch
Run Code Online (Sandbox Code Playgroud) 如果我添加 remi 存储库,dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
我会得到 3 个文件,其中/etc/yum.repos.d
声明了以下存储库:
remi-modular
remi-modular-test
remi
remi-test
remi-debuginfo
remi-test-debuginfo
remi-safe
remi-safe-debuginfo
Run Code Online (Sandbox Code Playgroud)
我遗漏了一些关于如何组织包以及何时使用什么的介绍性文字。我什么时候应该使用 remi、remi-safe 或 remi-modular 存储库?
我已将 Centos7 服务器升级到 Centos8,然后升级到 Almalinux 8.8。如果我运行dnf update,任何包都会出现错误。我已经删除了 yum,所以我使用 dnf。我已经尝试了dnf clean all ,但是当我进行dnf update时,问题再次出现。这是我的更新日志的最后一部分。我在尝试更新的每个包上都会遇到相同的错误!
Public key for libstdc++-8.5.0-18.el8.alma.x86_64.rpm is not installed. Failing package is: libstdc++-8.5.0-18.el8.alma.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
Public key for ncurses-6.1-9.20180224.el8_8.1.x86_64.rpm is not installed. Failing package is: ncurses-6.1-9.20180224.el8_8.1.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
Public key for ncurses-base-6.1-9.20180224.el8_8.1.noarch.rpm is not installed. Failing package is: ncurses-base-6.1-9.20180224.el8_8.1.noarch
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
Public key for ncurses-libs-6.1-9.20180224.el8_8.1.x86_64.rpm is not installed. Failing package is: ncurses-libs-6.1-9.20180224.el8_8.1.x86_64 …
Run Code Online (Sandbox Code Playgroud) 我来自软呢帽。只是在 RHEL 8.2 中测试水域
我的标准 dnf 包都不可用。例如:
$ sudo dnf install powerline powerline-fonts
[sudo] password for adamhanna:
Updating Subscription Management repositories.
Last metadata expiration check: 0:09:50 ago on Tue 16 Jun 2020 09:38:48 PM PDT.
No match for argument: powerline
No match for argument: powerline-fonts
Error: Unable to find a match: powerline powerline-fonts
Run Code Online (Sandbox Code Playgroud)
需要明确的是,这不是唯一给我带来问题的软件包。
对不起,基本问题,但我已经搜索过,但找不到我的答案。
谢谢你的帮助!