apt-get 在下载 deb 文件时卡在 33%,但 wget+dpkg 可以

apt-get 在下载 deb 文件时卡在 33%,但 wget+dpkg 可以

我使用 Google Cloud Artifact Registry 提供公共 deb 包。最近,apt-get 在下载 deb 文件到 33% 时卡住了:

# apt-get install pkg_name_placeholder
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libatasmart4 libblockdev-fs2 libblockdev-loop2 libblockdev-part-err2 libblockdev-part2 libblockdev-swap2 libblockdev-utils2 libblockdev2 libmm-glib0 libnspr4 libnss3 libnuma1 libparted-fs-resize0 libudisks2-0 usb-modeswitch
  usb-modeswitch-data
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  pkg_name_placeholder
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 15.3 MB of archives.
After this operation, 65.5 MB of additional disk space will be used.
Get:1 https://us-west2-apt.pkg.dev/projects/PROJECT ppa/main amd64 pkg_name_placeholder amd64 1.0.0+github388~e974429020fc50435dc21d900a699717fbde470b [15.3 MB]
33% [1 pkg_name_placeholder 6291 kB]

我尝试打印下载 uri,wgetdpkg --install直接打印,并且一切正常。

# apt-get install --print-uris pkg_name_placeholder
# wget https://us-west2-apt.pkg.dev/projects/PROJECT/pool/ppa/pkg_name_placeholder_1.0.0+github388~e974429020fc50435dc21d900a699717fbde470b_amd64_5e5e78b0e5e5b20ae87f2abe4cd5ae88.deb
# dpkg --install pkg_name_placeholder_1.0.0+github388~e974429020fc50435dc21d900a699717fbde470b_amd64_5e5e78b0e5e5b20ae87f2abe4cd5ae88.deb

添加后的一些日志-oDebug::pkgAcquire::Worker=1

0% [Working] <- https:102 Status
URI: https://us-west2-apt.pkg.dev/projects/PROJECT/pool/ppa/pkg_name_placeholder_1.0.0+github388~e974429020fc50435dc21d900a699717fbde470b_amd64_5e5e78b0e5e5b20ae87f2abe4cd5ae88.deb
Message: Connecting to us-west2-apt.pkg.dev

 <- https:102 Status
URI: https://us-west2-apt.pkg.dev/projects/PROJECT/pool/ppa/pkg_name_placeholder_1.0.0+github388~e974429020fc50435dc21d900a699717fbde470b_amd64_5e5e78b0e5e5b20ae87f2abe4cd5ae88.deb
Message: Connecting to us-west2-apt.pkg.dev (64.233.189.82)

 <- https:102 Status
URI: https://us-west2-apt.pkg.dev/projects/PROJECT/pool/ppa/pkg_name_placeholder_1.0.0+github388~e974429020fc50435dc21d900a699717fbde470b_amd64_5e5e78b0e5e5b20ae87f2abe4cd5ae88.deb
Message: Connected to us-west2-apt.pkg.dev (64.233.189.82)

 <- https:102 Status
URI: https://us-west2-apt.pkg.dev/projects/PROJECT/pool/ppa/pkg_name_placeholder_1.0.0+github388~e974429020fc50435dc21d900a699717fbde470b_amd64_5e5e78b0e5e5b20ae87f2abe4cd5ae88.deb
Message: Waiting for headers

0% [Waiting for headers] <- https:200 URI Start
Last-Modified: Mon, 06 Jun 2022 00:08:07 +0000
URI: https://us-west2-apt.pkg.dev/projects/PROJECT/pool/ppa/pkg_name_placeholder_1.0.0+github388~e974429020fc50435dc21d900a699717fbde470b_amd64_5e5e78b0e5e5b20ae87f2abe4cd5ae88.deb
Get:1 https://us-west2-apt.pkg.dev/projects/PROJECT ppa/main amd64 pkg_name_placeholder amd64 1.0.0+github388~e974429020fc50435dc21d900a699717fbde470b [15.3 MB]
33% [1 pkg_name_placeholder 6291 kB]

经过几次尝试,我发现如果我添加,-oAcquire::http::Dl-Limit=500下载就会处理,一切正常。但是,如果将限制设置为大于 ~1000 的值,下载就会卡住并重试。

相关内容