我已使用 GNURoot 应用程序在配备 ARMv7 处理器的 Android 5.0 设备上安装了 Fedora 22(使用 rootfs)。这工作正常。 rootfs 中的所有命令都执行正常。不过,我在 dnf 上遇到了问题。
dnf clean all
并且dnf update
命令工作正常。如果我运行dnf search <package name>
,它工作正常。我得到了正确的搜索结果。如果我运行dnf info <package name>
,它工作正常。但是,当我运行时dnf install <package name>
,出现如下错误:
Last metadata expiration check performed 1:52:54 ago on Sat Dec 26 11:05:25 2015.
No package <package name> available.
Error: Unable to find a match.
我对每个包都会收到此错误,即使该包在 dnf 搜索结果中可用。
一个例子:
> less
bash: less: command not found
> dnf search less
Last metadata expiration check performed 1:44:08 ago on Sat Dec 26 11:05:25 2015.
================== N/S Matched: less ===================
less.armv7hl : A text file browser similar to more, but
: better
bless-doc.armv7hl : Bless user manual
python-lesscpy.noarch : Lesscss compiler
python3-lesscpy.noarch : Lesscss compiler
..
..
..
> dnf info less
Last metadata expiration check performed 1:44:58 ago on Sat Dec 26 11:05:25 2015.
Available Packages
Name : less
Arch : armv7hl
Epoch : 0
Version : 481
Release : 1.fc22
Size : 143 k
Repo : updates
Summary : A text file browser similar to more, but
: better
URL : http://www.greenwoodsoftware.com/less/
License : GPLv3+ or BSD
Description : The less utility is a text file browser
: that resembles more, but has more
: capabilities. Less allows you to move
: backwards in the file as well as forwards.
: Since less doesn't have to read the
: entire input file before it starts, less
: starts up more quickly than text editors
: (for example, vi).
:
: You should install less because it is a
: basic utility for viewing text files, and
: you'll use it frequently.
> dnf install less
Last metadata expiration check performed 1:50:23 ago on Sat Dec 26 11:05:25 2015.
No package less available.
Error: Unable to find a match.
> dnf install less.armv7hl
Last metadata expiration check performed 1:52:54 ago on Sat Dec 26 11:05:25 2015.
No package less.armv7hl available.
Error: Unable to find a match.
> dnf install less.armv7hl -v
cachedir: /var/cache/dnf
Loaded plugins: migrate
DNF version: 1.1.4
repo: using cache for: fedora
not found deltainfo for: Fedora 22 - armhfp
not found updateinfo for: Fedora 22 - armhfp
repo: using cache for: updates
fedora: using metadata from Sat May 23 09:54:23 2015.
updates: using metadata from Tue Dec 22 00:53:59 2015.
Last metadata expiration check performed 3:51:50 ago on Sat Dec 26 11:05:25 2015.
No package less.armv7hl available.
Error: Unable to find a match.
> dnf search less.armv7hl
Last metadata expiration check performed 0:18:04 ago on Sat Dec 26 15:27:49 2015.
Error: No matches found.
我该如何解决这个错误?
预先感谢您的帮助。
答案1
在你的arm chroot中打开这个文件:
/usr/lib/python3.5/site-packages/dnf/conf/substitutions.py
并更改__init__
函数如下(有效地,硬编码工作拱门名称):
def __init__(self):
super(Substitutions, self).__init__()
arch = hawkey.detect_arch()
self['arch'] = arch
self['arch'] = 'armv7hl'
self['basearch'] = dnf.rpm.basearch(arch)
self['basearch'] = 'armhfp'
self._update_from_env()
(唯一的变化是添加这两行:
self['arch'] = 'armv7hl'
self['basearch'] = 'armhfp'
)