apt-get处于下载模式

氨酚

从的man页面apt-get

-d, --download-only
           Download only; package files are only retrieved, not unpacked or installed. Configuration Item: APT::Get::Download-Only.

download
          download will download the given binary package into the current directory.

那么以下命令之间有什么区别:

apt-get download apache2

apt-get install --download-only apache2

以及为什么第一个给出以下错误:

Get:1 http://gr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2 amd64 2.4.29-1ubuntu4.2 [95,1 kB]
Fetched 95,1 kB in 1s (102 kB/s)                        
W: Download is performed unsandboxed as root as file '/home/pkaramol/Desktop/apache2_2.4.29-1ubuntu4.2_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
氨酚

尽管我没有设法找出错误,但是命令的区别似乎主要是以下几点:

apt-get download apache2

将仅下载.deb当前wd中的

因此,下载后,dpkg -i <filename>.deb由于缺少相关性,运行很可能会失败

apt-get install --download-only apache2

将下载相应的.deb 其下的依赖关系/var/cache/apt/archives/,其中包缓存完成;

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章