如何从 Ubuntu 版本下载源包并针对以前的 Ubuntu 版本进行重建

如何从 Ubuntu 版本下载源包并针对以前的 Ubuntu 版本进行重建

python3-pychromecastUbuntu Xenial 官方 Ubuntu 存储库中不存在源包。

我想下载Ubuntu Bionic python3-pychromecast源包并在 Ubuntu Xenial 上重建它:

$ sudo apt-get build-dep python3-pychromecast/bionic-universe
Reading package lists... Done
E: Unable to find a source package for python3-pychromecast/bionic-universe
$ apt-get source --compile python3-pychromecast/bionic-universe
Reading package lists... Done
E: Unable to find a source package for python3-pychromecast

EDIT0:下载并提取源包:

$ wget http://archive.ubuntu.com/ubuntu/pool/universe/p/pychromecast/pychromecast_0.8.1-1.dsc http://archive.ubuntu.com/ubuntu/pool/universe/p/pychromecast/pychromecast_0.8.1.orig.tar.gz http://archive.ubuntu.com/ubuntu/pool/universe/p/pychromecast/pychromecast_0.8.1-1.debian.tar.xz 
--2020-05-27 11:50:58--  http://archive.ubuntu.com/ubuntu/pool/universe/p/pychromecast/pychromecast_0.8.1-1.dsc
Resolving archive.ubuntu.com (archive.ubuntu.com)... 2001:67c:1360:8001::23, 2001:67c:1360:8001::24, 2001:67c:1562::15, ...
Connecting to archive.ubuntu.com (archive.ubuntu.com)|2001:67c:1360:8001::23|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2205 (2,2K)
Saving to: ‘pychromecast_0.8.1-1.dsc’

pychromecast_0.8.1-1.dsc      100%[=================================================>]   2,15K  --.-KB/s    in 0,001s  

2020-05-27 11:50:58 (3,24 MB/s) - ‘pychromecast_0.8.1-1.dsc’ saved [2205/2205]

--2020-05-27 11:50:58--  http://archive.ubuntu.com/ubuntu/pool/universe/p/pychromecast/pychromecast_0.8.1.orig.tar.gz
Reusing existing connection to [archive.ubuntu.com]:80.
HTTP request sent, awaiting response... 200 OK
Length: 37130 (36K) [application/x-gzip]
Saving to: ‘pychromecast_0.8.1.orig.tar.gz’

pychromecast_0.8.1.orig.tar.g 100%[=================================================>]  36,26K  --.-KB/s    in 0,03s   

2020-05-27 11:50:58 (1,37 MB/s) - ‘pychromecast_0.8.1.orig.tar.gz’ saved [37130/37130]

--2020-05-27 11:50:58--  http://archive.ubuntu.com/ubuntu/pool/universe/p/pychromecast/pychromecast_0.8.1-1.debian.tar.xz
Reusing existing connection to [archive.ubuntu.com]:80.
HTTP request sent, awaiting response... 200 OK
Length: 3208 (3,1K) [application/x-xz]
Saving to: ‘pychromecast_0.8.1-1.debian.tar.xz’

pychromecast_0.8.1-1.debian.t 100%[=================================================>]   3,13K  --.-KB/s    in 0s      

2020-05-27 11:50:58 (50,8 MB/s) - ‘pychromecast_0.8.1-1.debian.tar.xz’ saved [3208/3208]

FINISHED --2020-05-27 11:50:58--
Total wall clock time: 0,2s
Downloaded: 3 files, 42K in 0,03s (1,53 MB/s)
$ dpkg-source -x pychromecast_0.8.1-1.dsc 
dpkg-source: info: extracting pychromecast in pychromecast-0.8.1
dpkg-source: info: unpacking pychromecast_0.8.1.orig.tar.gz
dpkg-source: info: unpacking pychromecast_0.8.1-1.debian.tar.xz

EDIT1:尝试构建:

$ debuild -i -us -uc -b
 dpkg-buildpackage -rfakeroot -D -us -uc -i -b
dpkg-buildpackage: source package pychromecast
dpkg-buildpackage: source version 0.8.1-1
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by Ruben Undheim <[email protected]>
 dpkg-source -i --before-build pychromecast-0.8.1
dpkg-buildpackage: host architecture i386
dpkg-checkbuilddeps: error: Unmet build dependencies: python3-protobuf
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
debuild: fatal error at line 1376:
dpkg-buildpackage -rfakeroot -D -us -uc -i -b failed
$ dpkg-checkbuilddeps
dpkg-checkbuilddeps: error: Unmet build dependencies: python3-protobuf
$ grep python3-protobuf debian/control 
               python3-protobuf,
Depends: ${python3:Depends}, ${misc:Depends}, python3-zeroconf, python3-protobuf (>= 3)

你能帮助我吗 ?

答案1

首先下载源档案:

wget http://archive.ubuntu.com/ubuntu/pool/universe/p/pychromecast/pychromecast_0.8.1.orig.tar.gz
tar -xf pychromecast_0.8.1.orig.tar.gz
cd pychromecast-0.8.1/

wget http://archive.ubuntu.com/ubuntu/pool/universe/p/pychromecast/pychromecast_0.8.1-1.debian.tar.xz
tar -xf pychromecast_0.8.1-1.debian.tar.xz

然后安装构建依赖项:

sudo apt-get install debhelper dh-python python-all python-setuptools python3-all python3-setuptools python3-protobuf python3-requests python3-zeroconf

但由于缺少python3-protobufdebian 包和 16.04 LTS 中的 Python 3.5,它将无法工作

然后使用以下命令构建包

dpkg-buildpackage -uc -us

所以我建议安装来自 PyPi 的包

sudo apt-get install python3-pip
sudo pip3 install PyChromecast

相关内容