我正在尝试将 Ubuntu 软件包打包为 Debian 软件包。为了可维护性,我尝试使用sbuild
.
我完成了前五个步骤,但是当我尝试构建时出现 chroot 错误。
这些是步骤:
1 sudo apt-get install sbuild
2 sudo mkdir /root/.gnupg # To work around #792100
3 sudo sbuild-update --keygen
4 sudo sbuild-adduser $LOGNAME
5 ... *logout* and *re-login* or use `newgrp sbuild` in your current shell
6 sudo sbuild-createchroot --make-sbuild-tarball=/srv/chroot/unstable-amd64.tar.gz unstable `mktemp -d` http://httpredir.debian.org/debian
sbuild-createchrrot
我使用的命令是:代码:选择全部
sudo sbuild-createchroot --make-sbuild-tarball=/srv/chroot/jessie-amd64.tar.gz jessie `mktemp -d` http://httpredir.debian.org/debian
I: SUITE: jessie
I: TARGET: /tmp/tmp.uLbQox2R0X
I: MIRROR: http://httpredir.debian.org/debian
I: Running debootstrap --arch=amd64 --variant=buildd --verbose --include=fakeroot,build-essential,debfoster --components=main --resolve-deps jessie /tmp/tmp.uLbQox2R0X http://httpredir.debian.org/debian
I: Retrieving Release
I: Retrieving Release.gpg
I: Checking Release signature
I: Valid Release signature (key id 75DDC3C4A499F1A18CB5F3C8CBF8D6FD518E17E1)
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Found additional required dependencies: acl adduser dmsetup insserv libaudit-common libaudit1 libbz2-1.0 libcap2 libcap2-bin libcryptsetup4 libdb5.3 libdebconfclient0 libdevmapper1.02.1 libgcrypt20 libgpg-error0 libkmod2 libncursesw5 libprocps3 libsemanage-common libsemanage1 libslang2 libsystemd0 libudev1 libustr-1.0-1 procps systemd systemd-sysv udev
I: Found additional base dependencies: binutils bzip2 cpp cpp-4.9 debian-archive-keyring dpkg-dev g++ g++-4.9 gcc gcc-4.9 gnupg gpgv libapt-pkg4.12 libasan1 libatomic1 libc-dev-bin libc6-dev libcilkrts5 libcloog-isl4 libdpkg-perl libfakeroot libgc1c2 libgcc-4.9-dev libgdbm3 libgmp10 libgomp1 libisl10 libitm1 liblsan0 libmpc3 libmpfr4 libquadmath0 libreadline6 libstdc++-4.9-dev libstdc++6 libtimedate-perl libtsan0 libubsan0 libusb-0.1-4 linux-libc-dev make patch perl perl-modules readline-common xz-utils
I: Checking component main on http://httpredir.debian.org/debian...
I: Retrieving acl 2.2.52-2
I: Validating acl 2.2.52-2
I: Retrieving libacl1 2.2.52-2
I: Validating libacl1 2.2.52-2
I: Retrieving adduser 3.113+nmu3
I: Validating adduser 3.113+nmu3
I: Retrieving apt 1.0.9.8.2
I: Validating apt 1.0.9.8.2
I: Retrieving libapt-pkg4.12 1.0.
它会一直持续到完成,我不确定这些是否是错误,但这种情况发生在我重新控制终端之前。
I: Base system installed successfully.
I: Configured /etc/hosts:
┌────────────────────────────────────────────────────────────────────────
│127.0.0.1 hn localhost
└────────────────────────────────────────────────────────────────────────
I: Configured /usr/sbin/policy-rc.d:
┌────────────────────────────────────────────────────────────────────────
│#!/bin/sh
│echo "All runlevel operations denied by policy" >&2
│exit 101
└────────────────────────────────────────────────────────────────────────
I: Configured APT /etc/apt/sources.list:
┌────────────────────────────────────────────────────────────────────────
│deb http://httpredir.debian.org/debian jessie main
│deb-src http://httpredir.debian.org/debian jessie main
└────────────────────────────────────────────────────────────────────────
I: Please add any additional APT sources to /tmp/tmp.uLbQox2R0X/etc/apt/sources.list
I: Setting reference package list.
I: Updating chroot.
Ign http://httpredir.debian.org jessie InRelease
Hit http://httpredir.debian.org jessie Release.gpg
Hit http://httpredir.debian.org jessie Release
Get:1 http://httpredir.debian.org jessie/main Sources [7058 kB]
Get:2 http://httpredir.debian.org jessie/main amd64 Packages [6763 kB]
Get:3 http://httpredir.debian.org jessie/main Translation-en [4582 kB]
Fetched 18.4 MB in 21s (837 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I: chroot /tmp/tmp.uLbQox2R0X has been removed.
I: Successfully set up jessie chroot.
I: Run "sbuild-adduser" to add new sbuild users.
之后我尝试运行:
sbuild -d jessie filename.dsc
然后我得到这个错误:
╔══════════════════════════════════════════════════════════════════════════════╗
║ simplescreenrecorder 0.3.6+1~ppa1~wily1 (amd64) 07 Feb 2016 04:15 ║
╚══════════════════════════════════════════════════════════════════════════════╝
Package: simplescreenrecorder
Version: 0.3.6+1~ppa1~wily1
Source Version: 0.3.6+1~ppa1~wily1
Distribution: jessie
Machine Architecture: amd64
Host Architecture: amd64
Build Architecture: amd64
E: /etc/schroot/schroot.conf: Failed to stat file: No such file or directory
┌──────────────────────────────────────────────────────────────────────────────┐
│ Summary │
└──────────────────────────────────────────────────────────────────────────────┘
然后光标就坐在那里闪烁。
chroot 有什么问题吗?怎么sbuild
没设置好呢?我该如何修复这个以使用sbuild
?
sbuild:
Installed: 0.65.2-1
Candidate: 0.65.2-1
Version table:
0.66.0-5~bpo8+1 0
100 http://httpredir.debian.org/debian/ jessie-backports/main amd64 Packages
*** 0.65.2-1 0
500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
100 /var/lib/dpkg/status
schroot:
Installed: 1.6.10-1+b1
Candidate: 1.6.10-1+b1
Version table:
*** 1.6.10-1+b1 0
500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
100 /var/lib/dpkg/status
编辑:
我没有以下文件或文件夹,也不知道如何手动创建它们。维基百科并没有对这些文件说太多。
E: /etc/schroot/schroot.conf: Failed to stat file: No such file or directory
编辑/etc/schroot
这是我的文件夹 的内容
tree /etc/schroot/
/etc/schroot/
├── buildd
├── chroot.d
│ └── jessie-amd64-sbuild-k92zq_
├── default
├── desktop
├── minimal
├── sbuild
└── setup.d
└── 99check -> 00check
7 directories, 2 files
这是 jessie-amd64 文件的内容
cat /etc/schroot/chroot.d/jessie-amd64-sbuild-k92zq_
[jessie-amd64-sbuild]
type=file
description=Debian jessie/amd64 autobuilder
file=/srv/chroot/jessie-amd64.tar.gz
groups=root,sbuild
root-groups=root,sbuild
profile=sbuild
当我跑步时
schroot -c jessie-amd64-sbuild
E: /etc/schroot/schroot.conf: Failed to stat file: No such file or directory
schroot -c jessie-amd64
E: /etc/schroot/schroot.conf: Failed to stat file: No such file or directory
即使我使用 -c 命令,他们仍然只是给出错误,它抱怨 schroot.conf 文件。
我尝试将其写入 schroot.conf 文件
cat /etc/schroot/schroot.conf
[jessie-amd64]
type=file
description=Debian jessie/amd64 autobuilder
file=/srv/chroot/jessie-amd64.tar.gz
groups=root,sbuild
root-groups=root,sbuild
profile=sbuild
然后尝试运行schroot -c /etc/schroot/schroot.conf
schroot -c jessie-amd64
E: /srv/chroot/jessie-amd64.tar.gz: Failed to stat file: No such file or directory
然后我得到上面的错误。
答案1
您需要将/etc/schroot/chroot.d/jessie-amd64-sbuild-k92zq_
创建的文件重命名sbuild-createchroot
为jessie-amd64-sbuild
(即删除随机后缀)。如果您愿意,也可以对其进行编辑。他们你应该能够schroot -c jessie-amd64-sbuild
和sbuild -d jessie whatever.dsc
。您使用 tarball chroot,这确实需要一些时间来实例化和清理;确保你有足够的耐心。