我需要在各种过时的发行版上测试调试工具。它可以与 Debian Wheezy 配合使用,但似乎不可能使用 Debian Squeeze docker 镜像添加工作编译器和构建工具。我从 DockerHub 获取图像,然后修复apt
存储库以忽略日期并使用archive.debian.org:
docker run -it --rm debian:squeeze
$ echo "deb http://archive.debian.org/debian squeeze main" > /etc/apt/sources.list
$ echo "deb http://archive.debian.org/debian-security squeeze/updates main" >> /etc/apt/sources.list
$ echo "Acquire::Check-Valid-Until no;" > /etc/apt/apt.conf.d/99no-check-valid-until
之后我进行常规安装
apt-get update
apt-get install build-essential
但它失败并显示“E:损坏的软件包”,没有解决方案可以帮助解决它。是否有可能以某种方式解决这个问题?
root@01feb057d927:/# apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
E: Broken packages
root@01feb057d927:/#
答案1
您还需要 LTS 存储库,因为libc6
它来自squeeze-lts
Docker 镜像。
# apt-cache policy libc6-dev libc6
libc6:
Installed: 2.11.3-4+deb6u11
Candidate: 2.11.3-4+deb6u11
Version table:
*** 2.11.3-4+deb6u11 0
100 /var/lib/dpkg/status
和包裹追踪器说这个版本来自squeeze-lts
.
所以,我们需要又一个来源:
echo "deb http://archive.debian.org/debian squeeze-lts main" >> /etc/apt/sources.list
然后:
root@dca025522204:/# apt-get update
Get:1 http://archive.debian.org squeeze Release.gpg [1655 B]
Get:2 http://archive.debian.org squeeze/updates Release.gpg [836 B]
Get:3 http://archive.debian.org squeeze-lts Release.gpg [819 B]
Get:4 http://archive.debian.org squeeze Release [96.0 kB]
Get:5 http://archive.debian.org squeeze/updates Release [86.9 kB]
Ign http://archive.debian.org squeeze Release
Ign http://archive.debian.org squeeze/updates Release
Get:6 http://archive.debian.org squeeze-lts Release [34.3 kB]
Ign http://archive.debian.org squeeze-lts Release
Hit http://archive.debian.org squeeze/main amd64 Packages
Hit http://archive.debian.org squeeze/updates/main amd64 Packages
Get:7 http://archive.debian.org squeeze-lts/main amd64 Packages [390 kB]
Fetched 428 kB in 3s (142 kB/s)
Reading package lists... Done
W: GPG error: http://archive.debian.org squeeze Release: The following signatures were invalid: KEYEXPIRED 1520281423 KEYEXPIRED 1501892461
W: GPG error: http://archive.debian.org squeeze/updates Release: The following signatures were invalid: KEYEXPIRED 1520281423
W: GPG error: http://archive.debian.org squeeze-lts Release: The following signatures were invalid: KEYEXPIRED 1587841717
root@dca025522204:/# apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
binutils bzip2 cpp cpp-4.4 dpkg-dev fakeroot g++ g++-4.4 gcc gcc-4.4 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libc-dev-bin libc6-dev libdb4.7
libdpkg-perl libgdbm3 libgmp3c2 libgomp1 libmpfr4 libstdc++6-4.4-dev libtimedate-perl linux-libc-dev make manpages manpages-dev patch perl perl-modules
Suggested packages:
binutils-doc bzip2-doc cpp-doc gcc-4.4-locales debian-keyring g++-multilib g++-4.4-multilib gcc-4.4-doc libstdc++6-4.4-dbg gcc-multilib autoconf automake1.9 libtool flex bison gdb
gcc-doc gcc-4.4-multilib libmudflap0-4.4-dev libgcc1-dbg libgomp1-dbg libmudflap0-dbg libcloog-ppl0 libppl-c2 libppl7 glibc-doc libstdc++6-4.4-doc make-doc man-browser ed
diffutils-doc perl-doc libterm-readline-gnu-perl libterm-readline-perl-perl
The following NEW packages will be installed:
binutils build-essential bzip2 cpp cpp-4.4 dpkg-dev fakeroot g++ g++-4.4 gcc gcc-4.4 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libc-dev-bin libc6-dev
libdb4.7 libdpkg-perl libgdbm3 libgmp3c2 libgomp1 libmpfr4 libstdc++6-4.4-dev libtimedate-perl linux-libc-dev make manpages manpages-dev patch perl perl-modules
0 upgraded, 31 newly installed, 0 to remove and 0 not upgraded.
Need to get 35.4 MB of archives.
After this operation, 114 MB of additional disk space will be used.
Do you want to continue [Y/n]?