cannot build source on debian 10

Asked by Thierry Vilmart on 2020-06-15

I cannot build from source on Debian 10 buster, because the package depends on itself in a strange way.
I can fix the g++ dependency I am worried more about the openjdk-8-jdk that depends ona package of same name.

I created a new chroot.
reconfigured the locales
and now I get this error:

Code: Select all
    apt build-dep openjdk-8-jdk
    Reading package lists... Done
    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:
     builddeps:openjdk-8-jdk : Depends: g++-9 but it is not installable
                               Depends: openjdk-8-jdk but it is not installable or
                                        openjdk-7-jdk but it is not installable
    E: Unable to correct problems, you have held broken packages.

This is how I created the chroot.

3642 [2020-06-15 13:40:04] sudo mkdir /stable-chroot
3643 [2020-06-15 13:40:13] sudo debootstrap stable /stable-chroot
3653 [2020-06-15 13:41:30] cd /stable-chroot/
3654 [2020-06-15 13:41:30] sudo mount -t proc proc proc/
3655 [2020-06-15 13:41:30] sudo mount --rbind /sys sys/
3656 [2020-06-15 13:41:31] sudo mount --rbind /dev dev/
sudo chroot /stable-chroot/ /bin/bash

then dpkg-reconfigure locales which worked well

Here are my sources.list and preferences:

deb stable main
deb-src stable main

# stretch-backports, pinned 100 by default so that it does not install by default
deb stretch-backports main contrib non-free

# Testing repository - main, contrib and non-free branches
deb testing main contrib non-free
deb-src testing main contrib non-free

# Testing security updates repository
deb testing-security main contrib non-free
deb-src testing-security main contrib non-free

# Unstable repo main, contrib and non-free branches, no security updates here
deb unstable main non-free contrib
deb-src unstable main non-free contrib


#backports are pinnined at 100 by default
# if this is not negative, a dist-upgrade can move too many packages to the backports versions
Package: *
Pin: release a=stretch-backports
Pin-Priority: -4

Package: *
Pin: release a=testing
Pin-Priority: -5

Package: *
Pin: release a=unstable
Pin-Priority: -10

Question information

English Edit question
Ubuntu openjdk-8 Edit question
No assignee Edit question
Solved by:
Manfred Hampl
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

This is support only for Ubuntu, and not for Debian or other related operating systems.

Please see or for Debian support

Thierry Vilmart (magicpoulp) said : #2

But Ubuntu is based on debian, and the repository is stored here, and they package it to debian for future Ubuntu releases.

Maybe this circular dependency should be explained or corrected.

Manfred Hampl (m-hampl) said : #4

This is a Debian problem, and not an Ubuntu one.
A similar request would be "I want to build openjdk-8 on Windows from the Ubuntu source, but I fail"

What is the output of
apt-cache policy openjdk-8-jdk g++-9 openjdk-7-jdk
(if such command exists on Debian)

Why don't you take the source from the Debian repositories (for stretch or sid)

Manfred Hampl (m-hampl) said : #5

You are misunderstanding the link
This has nothing to do with Ubuntu, but belongs to the "OpenJDK team" that also used the launchpad servers (the same server systems as Ubuntu does).

Thierry Vilmart (magicpoulp) said : #6

Since openjdk-8 lies in the ubuntu repo, you cannot get this error since the build-dep will get openjdk itself.
The package has a dependency to itself. And it is bad. Even for Ubuntu, packages have to respect structure.

just open the source, go in debian/rules, and you will see the bd_bootstrap += \ openjdk-8-djk

here is the cache policy:
  Installerad: (ingen)
  Kandidat: (ingen)
     8u252-b09-1 -10
        -10 unstable/main amd64 Packages
  Installerad: (ingen)
  Kandidat: (ingen)
     9.3.0-13 -10
        -10 unstable/main amd64 Packages
  Installerad: (ingen)
  Kandidat: (ingen)

Best Manfred Hampl (m-hampl) said : #7

"... Since openjdk-8 lies in the ubuntu repo ..." is not the Ubuntu repo, or do you see the string "Ubuntu" somewhere in this URL?

Thierry Vilmart (magicpoulp) said : #8

Here lies the package in the Ubuntu repo:

Thierry Vilmart (magicpoulp) said : #9

Here lies the package in the Ubuntu repo:

the sources.list still contain things called repositories.

Thierry Vilmart (magicpoulp) said : #10

And this is why build-dep will not see the problem with a circular dependency on Ubuntu

Manfred Hampl (m-hampl) said : #11

The cyclical dependency (even if it is only with an "or" clasue) should be reported to the provider of the software, i.e.

Manfred Hampl (m-hampl) said : #12

And by the wy, it is the same for the version in Debian, e.g.

Thierry Vilmart (magicpoulp) said : #13

ok thanks I will report it to the right place since I see here is more for Ubuntu support.

But since Ubuntu is made from debian usntable, it is always good to help each other.

Thierry Vilmart (magicpoulp) said : #14

And in fact I was wrong, building Java 8 requires a boot JDK that can only be provided by the rule dapendency taht java8 or 7 is installed