我正在尝试获取某些软件包的源文件,它给出了该错误:
~$ sudo apt source ros-kinetic-nav-core
Reading package lists... Done
Need to get 6.606 B of source archives.
Get:1 http://packages.ros.org/ros/ubuntu xenial/main ros-kinetic-nav-core 1.14.0-0xenial (dsc) [1.061 B]
Get:2 http://packages.ros.org/ros/ubuntu xenial/main ros-kinetic-nav-core 1.14.0-0xenial (tar) [3.509 B]
Get:3 http://packages.ros.org/ros/ubuntu xenial/main ros-kinetic-nav-core 1.14.0-0xenial (diff) [2.036 B]
Fetched 6.606 B in 4s (1.455 B/s)
dpkg-source: warning: extracting unsigned source package (ros-kinetic-nav-core_1.14.0-0xenial.dsc)
dpkg-source: info: extracting ros-kinetic-nav-core in ros-kinetic-nav-core-1.14.0
dpkg-source: info: unpacking ros-kinetic-nav-core_1.14.0.orig.tar.gz
dpkg-source: info: unpacking ros-kinetic-nav-core_1.14.0-0xenial.debian.tar.xz
W: Can't drop privileges for downloading as file 'ros-kinetic-nav-core_1.14.0-0xenial.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
文件可用,但apt不能解压缩它们:
/opt/ros/kinetic/share/nav_core$ ls
cmake ros-kinetic-nav-core-1.14.0 ros-kinetic-nav-core_1.14.0-0xenial.dsc
package.xml ros-kinetic-nav-core_1.14.0-0xenial.debian.tar.xz ros-kinetic-nav-core_1.14.0.orig.tar.gz
只需使用apt-get source
不带sudo
前缀的命令即可;它将写入当前目录。
错误报告后,该警告被改写为“以root身份运行apt-get源时无法删除特权”。Debian Bug报告日志(以及许多其他具有相同功能的报告)
我不明白为什么有关于此的错误报告。如果您获取_apt无法写入的目录,它将以root身份而不是_apt身份运行获取程序,因此您可以执行您想做的任何愚蠢的任务(此处不需要root)。
我们也可以把它说成一个错误,然后说:该命令不能以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…
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句