首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行apt更新E时出错:无法确定fd7-fstat的文件大小

运行apt更新E时出错:无法确定fd7-fstat的文件大小
EN

Ask Ubuntu用户
提问于 2021-05-05 11:22:42
回答 3查看 1.5K关注 0票数 4

我在Termux上设置了Ubuntu21.04 基像。当我运行apt update时,我会得到以下错误。由于我无法运行apt update,所以无法安装任何软件包。

代码语言:javascript
复制
root@localhost:~# apt update
Get:1 http://ports.ubuntu.com/ubuntu-ports hirsute InRelease [269 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports hirsute-updates InRelease [109 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports hirsute-backports InRelease [90.7 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports hirsute-security InRelease [101 kB]
Reading package lists... Done
E: Unable to determine file size for fd 7 - fstat (1: Operation not permitted)
E: The repository 'http://ports.ubuntu.com/ubuntu-ports hirsute InRelease' provides only weak security information.
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.
E: Unable to determine file size for fd 7 - fstat (1: Operation not permitted)
E: The repository 'http://ports.ubuntu.com/ubuntu-ports hirsute-updates InRelease' provides only weak security information.
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.
E: Unable to determine file size for fd 7 - fstat (1: Operation not permitted)
E: The repository 'http://ports.ubuntu.com/ubuntu-ports hirsute-backports InRelease' provides only weak security information.
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.
E: Unable to determine file size for fd 7 - fstat (1: Operation not permitted)
E: The repository 'http://ports.ubuntu.com/ubuntu-ports hirsute-security InRelease' provides only weak security information.
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.

怎么解决这个问题?在20.04.2基本图像中没有此错误。

以下是/tmp权限的输出。

代码语言:javascript
复制
root@localhost:~# ls -ld /tmp
drwx------ 2 root root 3488 Jul  1 10:54 /tmp

这是sources.list (我没有修改它)。

代码语言:javascript
复制
root@localhost:~# cat /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ports.ubuntu.com/ubuntu-ports/ hirsute main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ hirsute main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://ports.ubuntu.com/ubuntu-ports/ hirsute-updates main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ hirsute-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ports.ubuntu.com/ubuntu-ports/ hirsute universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ hirsute universe
deb http://ports.ubuntu.com/ubuntu-ports/ hirsute-updates universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ hirsute-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ports.ubuntu.com/ubuntu-ports/ hirsute multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ hirsute multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ hirsute-updates multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ hirsute-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://ports.ubuntu.com/ubuntu-ports/ hirsute-backports main restricted universe multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ hirsute-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu hirsute partner
# deb-src http://archive.canonical.com/ubuntu hirsute partner

deb http://ports.ubuntu.com/ubuntu-ports/ hirsute-security main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ hirsute-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ hirsute-security universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ hirsute-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ hirsute-security multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ hirsute-security multiverse
EN

回答 3

Ask Ubuntu用户

发布于 2021-07-01 12:39:04

正确的权限:

代码语言:javascript
复制
sudo chmod 777 -R /tmp
票数 0
EN

Ask Ubuntu用户

发布于 2021-07-02 10:24:40

请在以下位置找到apt更新的PID:

代码语言:javascript
复制
ps ax | grep "apt"

当你知道类型时:

代码语言:javascript
复制
ls -al /proc/PID/fd/

其中PID是您之前获得的进程号。

名为7的文件描述符是什么?

更新2021-07-05:

也许这是正常的。

根据Termux文档https://wiki.termux.com/wiki/Package_管理

root下的Apt使用是受限制的,以防止在Android /data分区上混淆所有权和/data标签。我们强烈建议使用pkg实用程序而不是apt直接.不支持降级。为了回收磁盘空间,我们不保留软件包版本的历史记录。

票数 0
EN

Ask Ubuntu用户

发布于 2021-12-01 09:02:33

2021年年12月1日

对我来说,这是由于安装到/tmp路径与ubuntu20.04。我必须将挂载位置更改为/usr/local/bin

检查这里这里

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1336219

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档