惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
Recorded Future
Recorded Future
T
Tenable Blog
S
Securelist
C
CERT Recently Published Vulnerability Notes
T
Threatpost
S
Schneier on Security
A
Arctic Wolf
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Register - Security
The Register - Security
Cisco Talos Blog
Cisco Talos Blog
AWS News Blog
AWS News Blog
K
Kaspersky official blog
T
True Tiger Recordings
T
Threat Research - Cisco Blogs
V
Vulnerabilities – Threatpost
P
Palo Alto Networks Blog
T
The Exploit Database - CXSecurity.com
小众软件
小众软件
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
Cyberwarzone
Cyberwarzone
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tor Project blog
Spread Privacy
Spread Privacy
Malwarebytes
Malwarebytes
P
Proofpoint News Feed
F
Fox-IT International blog
F
Fortinet All Blogs
P
Privacy & Cybersecurity Law Blog
G
GRAHAM CLULEY
量子位
Latest news
Latest news
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
Project Zero
Project Zero
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
I
Intezer
博客园_首页
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Darknet – Hacking Tools, Hacker News & Cyber Security

TecHug

照片展现中国风电与太阳能建设令人惊叹的规模 - Yale E360 Date 已过时,Temporal 正流行 – TecHug — TecHug Let’s Encrypt:6天有效期证书与IP地址证书现已全面开放 – TecHug — TecHug jQuery 4.0.0 – TecHug — TecHug 暗色模式与浅色模式:孰优孰劣? – TecHug — TecHug CSS 网格车道(Grid Lanes)布局 – TecHug — TecHug 马斯克称特斯拉将把完全自动驾驶功能转为月度订阅服务 – TecHug — TecHug Gentoo Linux 2025年回顾与2026年新年快乐! – TecHug — TecHug 纯HTML的条件性延迟加载方案(通过preload + media条件查询实现) – TecHug — TecHug Xfce 真是太棒了 – TecHug — TecHug
问题解决:在 Android 上的 Ubuntu chroot 环境中运行 apt-get update 失败 – TecHug — TecHug
techug · 2026-05-20 · via TecHug

我在 Android 设备(采用 armhf/x64 架构)的 chroot 环境中安装了 Ubuntu 。一切运行正常。所有本地命令以及 wget 和 curl 都能正常工作。然而,apt-get 却失败了。

我在 Android 设备(采用 armhf/x64 架构)的 chroot 环境中安装了 Ubuntu 。一切运行正常。所有本地命令以及 wget 和 curl 都能正常工作。然而,apt-get 却失败了。问题如下:

  1. 执行 sudo apt-get update 时出现错误:解析 ports.ubuntu.com 暂时失败(其他程序如 wget 和 curl 能成功访问该域名)。我已通过 ping 命令获取了服务器 IP,并据此修改了 /etc/apt/sources.list 文件
  2. 执行 sudo apt-get update 又出现另一个错误:无法为 91.189.88.150 (f=2 t=1 p=6) 创建套接字 - 套接字 (13: 权限被拒绝)
  3. 好吧,于是我将所有 apt-* 程序设为 suid 权限:sudo chmod u+s /usr/bin/apt-*

为排除特定 apt-get 版本的影响,我已通过 apt-get 自身卸载了 apt,并成功使用 dpkg 安装了 apt.deb 包,但问题依然存在。

Ubuntu上这个基本功能似乎失效了,这非常令人惊讶,可能是armhf架构包特有的问题。我在Stack Overflow上似乎找不到关于此问题的报告。不过,我在Reddit的 /r/debian 版块确实发现另一位用户报告了类似情况,但该问题尚未得到解决。

有什么建议吗?

据我所知,在 Debian chroot 环境中使用 setsid 切换到 root 用户是行不通的,这是因为 Android 的安全策略(sepolicy)。也许 Android 的安全策略中有一条规则,例如:“要使用网络,必须拥有 inet 的组 ID(即 3003,如 adb shell id 所示)”。也许它还规定:“拥有 setsid root 权限是无效的”。

因此,要使之生效,你必须在 Debian chroot 环境中添加一个 GID 为 3003 的组(可能命名为 aid_inet):sudo addgroup --gid 3003 aid_inet,然后将 _apt 的主组 ID 更改为 aid_inet:sudo usermod -g aid_inet _apt

将 android_inet 作为 _apt 的辅助组添加是行不通的,因为这不符合 Android 安全策略的要求。

addgroup --gid 3003 --system aid_inet
元素周期表抱枕