gpt4 book ai didi

linux - Ubuntu 内核源码下载时出错

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:06:28 25 4
gpt4 key购买 nike

我需要下载我正在运行的 Ubuntu 内核的源代码。所以我关注了these instructions .下载几乎成功了。最后我得到了:

W: Can't drop privileges for downloading as file 'linux-hwe_4.10.0-32.36~16.04.1.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

有谁知道问题出在哪里以及我应该怎么做?

最佳答案

https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel页面说只运行 apt,没有任何 sudo 前缀:

  apt-get source linux-image-$(uname -r)`

因此,只需在没有 sudo 前缀的情况下启动它。

许多流行的 apt 命令,如 apt install 将写入一些全局数据库和文件,应该以 sudo 启动。但是 apt-get source 和大多数 apt-cache 都是非特权的,可以从任何用户运行。 apt-get source 将写入当前目录,并且从 root 启动时从特殊伪用户下载文件是一项安全功能...

这已多次报告给 bugzillas,并在 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813786 中改写

$ LANG=C sudo apt-get source debian-installer
W: Can't drop privileges for downloading as file 'debian-installer_20160106.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

I don't get why there are bug reports about that. If you fetch in a directory _apt cannot write to, it will run the fetchers as root instead of _apt so you can do whatever foolish (no root needed here) task you are trying to do.

We could also just make it an error and say: This command does not work as root, but that won't make people happy either.

While we might want to solve this at some point, this is no huge deal, and would require a huge amount of work to fix.

警告已改写:

Note: This is a warning about disabling a security feature. It is
supposed to be scary as we are disabling a security feature and we
can't just be silent about it! Downloads really shouldn't happen
any longer as root to decrease the attack surface – but if a warning
causes that much uproar, consider what an error would do…

The old WARNING message:
| W: Can't drop privileges for downloading as file 'foobar' couldn't be
| accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
is frequently (incorrectly) considered to be an error message indicating
that the download didn't happen which isn't the case, it was performed,
but without all the security features enabled we could have used if run
from some other place…

关于linux - Ubuntu 内核源码下载时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45766719/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com