首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在aptcache中添加apt-utils,使牛仔/pbuilder能够使用它?

如何在aptcache中添加apt-utils,使牛仔/pbuilder能够使用它?
EN

Unix & Linux用户
提问于 2018-09-01 19:56:49
回答 1查看 288关注 0票数 0

我在运行cowbuilder --update,得到了以下信息-

代码语言:javascript
运行
复制
$ sudo cowbuilder --update
[sudo] password for shirish: 
I: Copying COW directory
I: forking: rm -rf /var/cache/pbuilder/build/cow.12496
I: forking: cp -al /var/cache/pbuilder/sid-amd64/base.cow /var/cache/pbuilder/build/cow.12496
I: removed stale ilistfile /var/cache/pbuilder/build/cow.12496/.ilist
I: Invoking pbuilder
I: forking: pbuilder update --buildplace /var/cache/pbuilder/build/cow.12496 --mirror http://deb.debian.org/debian/ --distribution sid --no-targz --internal-chrootexec 'chroot /var/cache/pbuilder/build/cow.12496 cow-shell'
I: Running in no-targz mode
I: Current time: Sun Sep  2 01:16:22 IST 2018
I: pbuilder-time-stamp: 1535831182
I: copying local configuration
W: --override-config is not set; not updating apt.conf Read the manpage for details.
I: mounting /proc filesystem
I: mounting /sys filesystem
I: creating /{dev,run}/shm
I: mounting /dev/pts filesystem
I: redirecting /dev/ptmx to /dev/pts/ptmx
I: policy-rc.d already exists
I: Refreshing the base.tgz 
I: upgrading packages
Get:1 http://cdn-fastly.deb.debian.org/debian sid InRelease [233 kB]
Get:2 http://cdn-fastly.deb.debian.org/debian sid/main amd64 Packages.diff/Index [27.9 kB]
Get:3 http://cdn-fastly.deb.debian.org/debian sid/main amd64 Packages 2018-09-01-1408.47.pdiff [11.0 kB]
Get:3 http://cdn-fastly.deb.debian.org/debian sid/main amd64 Packages 2018-09-01-1408.47.pdiff [11.0 kB]
Fetched 272 kB in 3s (97.6 kB/s)
Reading package lists...
I: Obtaining the cached apt archive contents
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
  libidn2-0
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 76.4 kB of archives.
After this operation, 120 kB of additional disk space will be used.
Get:1 http://cdn-fastly.deb.debian.org/debian sid/main amd64 libidn2-0 amd64 2.0.5-1 [76.4 kB]
Fetched 76.4 kB in 1s (79.8 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 11986 files and directories currently installed.)
Preparing to unpack .../libidn2-0_2.0.5-1_amd64.deb ...
Unpacking libidn2-0:amd64 (2.0.5-1) over (2.0.4-2.2) ...
Setting up libidn2-0:amd64 (2.0.5-1) ...
Processing triggers for libc-bin (2.27-5) ...
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
aptitude is already the newest version (0.8.10-9).
build-essential is already the newest version (12.5).
dpkg-dev is already the newest version (1.19.0.5).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I: Copying back the cached apt archive contents
I: new cache content 'libidn2-0_2.0.5-1_amd64.deb' added
I: unmounting dev/ptmx filesystem
I: unmounting dev/pts filesystem
I: unmounting dev/shm filesystem
I: unmounting proc filesystem
I: unmounting sys filesystem
I: removing cowbuilder working copy
I: Moving work directory [/var/cache/pbuilder/build/cow.12496] to final location [/var/cache/pbuilder/sid-amd64/base.cow] and cleaning up old copy
I: forking: rm -rf /var/cache/pbuilder/build/cow.12496-12496-tmp

现在,在/var/cache/pbuilder中,我得到了以下目录-

代码语言:javascript
运行
复制
/var/cache/pbuilder$ ls
aptcache  build  result  sid-amd64

从我所知的一点来看,aptcache有可能需要的.deb包,build是构建包的地方,result是成功构建包的地方,sid-amd64是用于构建包所需的base.cow或最小Debian发行版。随着新软件包的建立,aptcache和base.cow都会随着时间的推移而增加。

我对这个理解是正确的吗?

如果是,我如何在aptcachebase.cow中添加apt-utils?

从之前共享的动作中看到这一行-

代码语言:javascript
运行
复制
debconf: delaying package configuration, since apt-utils is not installed. 

更新- 02/09/18 -

我试过以下方法-

代码语言:javascript
运行
复制
$ sudo pbuilder --autocleanaptcache
pbuilder - a personal builder
Copyright 2001-2007 Junichi Uekawa
Distributed under GNU Public License version 2 or later

pbuilder [operation] [pbuilder-options]
pdebuild [pdebuild-options] -- [pbuilder-options]
........

由于某些原因,该命令似乎不起作用,要么我拼错了它,要么它需要显式路径才能使命令工作。

在此之前,我确实尝试过$cowbuilder ----autocleanaptcache,但即便如此,我也什么也没有得到。

最后我不得不去-

代码语言:javascript
运行
复制
$ sudo pbuilder clean
I: Cleaning [/var/cache/pbuilder/build]
I: removing directory /var/cache/pbuilder/build and its subdirectories
I: Cleaning [/var/cache/pbuilder/aptcache/]
shirish@debian:~$ cd /var/cache/pbuilder/aptcache/
EN

回答 1

Unix & Linux用户

发布于 2018-09-01 21:23:08

随着新软件包的建立,aptcache和base.cow都会随着时间的推移而增加。

APT缓存可以,但是您应该定期使用clean命令(pbuilder cleancowbuilder clean)或--autocleanaptcache选项(与命令一起使用,例如pbuilder update --autocleanaptcache)来清理它。基本映像只反映基本Debian安装;构建所需的包只安装在用于构建的副本中,而不是基本映像中。(我每天使用一个cron作业,它在我所有的基本映像上运行pbuilder update --autocleanaptcache。)

要在基本映像中安装额外的包,可以使用pbuilder login --save-after-logincowbuilder login --save-after-login“登录”到映像,进行更改并退出。但是,这不是一个好主意,因为它改变了包构建的期望。特别是关于apt-utils,您可以忽略debconf警告--它只是抱怨缺少apt-extracttemplates,这意味着包不能预先配置(使用dpkg-preconfigure),而必须在安装过程中进行配置。由于构建运行的方式,这没有任何影响。

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/466292

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档