Linux Ubuntu内核源代码下载时出错

Linux Ubuntu内核源代码下载时出错,linux,ubuntu,linux-kernel,Linux,Ubuntu,Linux Kernel,我需要下载我正在运行的Ubuntu内核的源代码。所以我跟着。下载几乎成功。就在最后,我得到了: W:无法删除作为文件下载的权限 用户无法访问“linux-hwe_4.10.0-32.36~16.04.1.dsc” “_apt.”pkgAcquire::Run(13:权限被拒绝) 有人知道问题出在哪里吗?我该怎么办?页面上说要运行得恰到好处,没有任何sudo前缀: apt-get source linux-image-$(uname -r)` 因此,只需启动它而不使用sudo前缀 许多流行的

我需要下载我正在运行的Ubuntu内核的源代码。所以我跟着。下载几乎成功。就在最后,我得到了:

W:无法删除作为文件下载的权限 用户无法访问“linux-hwe_4.10.0-32.36~16.04.1.dsc” “_apt.”pkgAcquire::Run(13:权限被拒绝)

有人知道问题出在哪里吗?我该怎么办?

页面上说要运行得恰到好处,没有任何sudo前缀:

  apt-get source linux-image-$(uname -r)`
因此,只需启动它而不使用
sudo
前缀

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

这被报告给bugzillas很多次,并在年被改写

我不明白为什么会有关于这个的bug报告。如果你取一个目录 _apt无法写入,它将以root身份运行抓取程序,而不是以您的身份运行 你可以做任何愚蠢的(这里不需要根)任务

我们也可以将其设置为一个错误,然后说:此命令不能像 根,但这也不会让人们快乐

虽然我们可能希望在某个时候解决这个问题,但这并不是什么大问题,而且 将需要大量的工作来修复

警告被改写:

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…

使用
sudo
帮助运行它吗?或者不使用
sudo
:。apt-get-source-linux-image-$(uname-r)应该在没有sudo的情况下使用,它是不受限制的-只需将文件保存到当前目录。与apt get install不同,它不在全局目录中存储任何内容,并且不需要sudo。它不是“几乎成功”,而是成功的。W表示警告,E表示错误。
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…