在 Ubuntu 20.04 上安装 Anbox 时出现太多错误

在 Ubuntu 20.04 上安装 Anbox 时出现太多错误

有什么办法可以在 20.04 上使用 anbox 吗?运行时sudo apt-get install dkms出现此错误

sudo apt install dkms

Reading package lists... Done
Building dependency tree       
Reading state information... Done
dkms is already the newest version (2.8.1-5ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up anbox-modules-dkms (13) ...
Removing old anbox-1 DKMS files...

------------------------------
Deleting module version: 1
completely from the DKMS tree.
------------------------------
Done.
Loading new anbox-1 DKMS files...
Building for 5.11.0-27-generic
Building initial module for 5.11.0-27-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/anbox-modules-d
kms.0.crash'
Error! Bad return status for module build on kernel: 5.11.0-27-generic (x86_64)
Consult /var/lib/dkms/anbox/1/build/make.log for more information.
dpkg: error processing package anbox-modules-dkms (--configure):
 installed anbox-modules-dkms package post-installation script subprocess return
ed error exit status 10
Errors were encountered while processing:
 anbox-modules-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

当我运行时sudo apt install linux-headers-generic anbox-modules-dkms,它给了我这个错误

sudo apt install linux-headers-generic anbox-modules-dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package anbox-modules-dkms is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'anbox-modules-dkms' has no installation candidate

当我运行时,ls -1 /dev/{ashmem,binder} 它给了我这个--

ls -1 /dev/{ashmem,binder}
ls: cannot access '/dev/binder': No such file or directory
**/dev/ashmem**

当我运行这个时——sudo add-apt-repository ppa:morphis/anbox-support 它给了我这个——

Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/morphis/anbox-support/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

运行后snap info anbox 结果如下——

snap info anbox
name:      anbox
summary:   Android in a Box
publisher: Simon Fels (morphis)
store-url: https://snapcraft.io/anbox
contact:   https://anbox.io
license:   unset
description: |
  Runtime for Android applications which runs a full Android system
  in a container using Linux namespaces (user, ipc, net, mount) to
  separate the Android system fully from the host.
  
  You can find further details in our documentation at
  https://github.com/anbox/anbox/blob/master/README.md
commands:
  - anbox
  - anbox.android-settings
  - anbox.appmgr
  - anbox.collect-bug-info
  - anbox.shell
services:
  anbox.container-manager: simple, enabled, active
snap-id:      Nr9K6UJaIOD8wHpDEQl16nabFFt9LLEQ
tracking:     latest/beta
refresh-date: today at 15:58 IST
channels:
  latest/stable:    --                                   
  latest/candidate: --                                   
  latest/beta:      4-56c25f1     2020-01-02 (186) 391MB devmode
  latest/edge:      4+gitrad377ff 2021-05-27 (213) 405MB devmode
installed:          4-56c25f1                (186) 391MB devmode

答案1

显然,不再需要安装内核从 Ubuntu 19.04 开始,因此也不需要 PPA。

只需安装ashmembinder使用

sudo modprobe ashmem_linux
sudo modprobe binder_linux

要验证安装是否成功,请使用lsmod | grep -e ashmem_linux -e binder_linux

确保不要拼错“ashmem”

现在可以anbox使用 snap安装最新的开发测试版

snap install anbox --beta --devmode

但在anboxgit 页面上建议更新至 Edge 版本

snap refresh --devmode --edge anbox

对于第一次干启动,我发现在启动应用程序时预加载一些内容很有用

anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity

您可以关注此程序如果您有兴趣,请安装 Google Play Store。

相关内容