Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular Dependency Problem (Working on updated guide) #7

Open
tcreek opened this issue Jan 9, 2020 · 6 comments
Open

Circular Dependency Problem (Working on updated guide) #7

tcreek opened this issue Jan 9, 2020 · 6 comments

Comments

@tcreek
Copy link

tcreek commented Jan 9, 2020

Following your guide

Then, we will need to install one package first in a partial way

dpkg - i (LOCATION_OF_libgcc1)

In return, we get this:

(Reading database ... 369 files and directories currently installed.)
Preparing to unpack libgcc1_8.3.0-6_amd64.deb ...
Unpacking libgcc1:amd64 (1:8.3.0-6) over (1:8.3.0-6) ...
dpkg: dependency problems prevent configuration of libgcc1:amd64:
 libgcc1:amd64 depends on gcc-8-base (= 8.3.0-6); however:
  Version of gcc-8-base:amd64 on system is 8.3.0-26.
 libgcc1:amd64 depends on libc6 (>= 2.14); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libgcc1:amd64 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libgcc1:amd64

So, let's try the libc deb file.

(Reading database ... 369 files and directories currently installed.)
Preparing to unpack libc6_2.28-10_amd64.deb ...
/var/lib/dpkg/tmp.ci/preinst: line 270: which: command not found
Unpacking libc6:amd64 (2.28-10) over (2.28-10) ...
dpkg: dependency problems prevent configuration of libc6:amd64:
 libc6:amd64 depends on libgcc1; however:
  Package libgcc1:amd64 is not configured yet.

dpkg: error processing package libc6:amd64 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libc6:amd64

So, I went back into LFS v9 to get libc6 (Section 6.3) installed, then did the ldconfig, then tried to install libgcc1_8.3.0-6_amd64.deb again

That did not work out, and still getting the dependency problem.

Any clues on this?

@scottwilliambeasley
Copy link
Owner

Following your guide

Then, we will need to install one package first in a partial way
dpkg - i (LOCATION_OF_libgcc1)

In return, we get this:

(Reading database ... 369 files and directories currently installed.)
Preparing to unpack libgcc1_8.3.0-6_amd64.deb ...
Unpacking libgcc1:amd64 (1:8.3.0-6) over (1:8.3.0-6) ...
dpkg: dependency problems prevent configuration of libgcc1:amd64:
 libgcc1:amd64 depends on gcc-8-base (= 8.3.0-6); however:
  Version of gcc-8-base:amd64 on system is 8.3.0-26.
 libgcc1:amd64 depends on libc6 (>= 2.14); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libgcc1:amd64 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libgcc1:amd64

So, let's try the libc deb file.

(Reading database ... 369 files and directories currently installed.)
Preparing to unpack libc6_2.28-10_amd64.deb ...
/var/lib/dpkg/tmp.ci/preinst: line 270: which: command not found
Unpacking libc6:amd64 (2.28-10) over (2.28-10) ...
dpkg: dependency problems prevent configuration of libc6:amd64:
 libc6:amd64 depends on libgcc1; however:
  Package libgcc1:amd64 is not configured yet.

dpkg: error processing package libc6:amd64 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libc6:amd64

So, I went back into LFS v9 to get libc6 (Section 6.3) installed, then did the ldconfig, then tried to install libgcc1_8.3.0-6_amd64.deb again

That did not work out, and still getting the dependency problem.

Any clues on this?

That's actually normal, given what you are trying to do. You are unpacking/installing the package in a partial state and can't expect to completely install it without bumping into said dependency issue. It's a pretty lame dependency issue that forces you to hack around with the dpkg database to overcome.

You can't fully install the package using dpkg currently - the best that you will be able to do is have the package installed, but left in a partial / unconfigured state. The dpkg database would show that that's the state the package is in if you query it.

In this case, you should proceed with the sed command that follows to manipulate the dpkg database at /var/lib/dpkg/status into thinking that said package -was- completely installed.

Now that you have that dependency, you should be able to proceed to install the other parts of the circular dependency tree. Once you've installed the other parts, reinstall libgcc as per the guide to ensure that everything's set up properly.

This looks like another opportunity for clarifying the language within the guide. To me this seemed rather obvious, but to others using the guide clearly it leaves some room for confusion.

Also, please be careful when attempting to pulling parts from more recent versions of Debian or LFS. You may encounter packages which require very specific versions of other libraries/dependencies not included in this guide, or these may have modified dependency trees that look very different to what you see currently in the guide.

In those cases, you'd have to figure those out yourself. It's pretty easy though - when dpkg complains, it usually tells you exactly what it's looking for, and you just need to map those out.

@tcreek
Copy link
Author

tcreek commented Jan 9, 2020

Okay got you.

Your guide did not explicitly say one would get an error when trying to install.

One other issue is the command you placed in there.

sed -ri 's/(Package: libgcc1)/\1\nDescription: test\nMaintainer: test\nVersion: 2.19/' /var/lib/dpkg/status

Specifically you have "Version: 2.19"

What is that referring to? I am not seeing anything with version 2.19 elsewhere.

I just want make sure I am clear on this.

Thanks for all the help so far,

@scottwilliambeasley
Copy link
Owner

scottwilliambeasley commented Jan 10, 2020

Okay got you.

Your guide did not explicitly say one would get an error when trying to install.

One other issue is the command you placed in there.

sed -ri 's/(Package: libgcc1)/\1\nDescription: test\nMaintainer: test\nVersion: 2.19/' /var/lib/dpkg/status

Specifically you have "Version: 2.19"

What is that referring to? I am not seeing anything with version 2.19 elsewhere.

I just want make sure I am clear on this.

Thanks for all the help so far,

I believe that this was simply the version of libgcc1 present in the repos at the time I wrote the guide.

EDIT: There doesn't seem to be a version in the Jessie repos matching this. I must have just made up a value for this during the time that I figured out how to do this.

The value shouldn't be terribly important as long as it satisfies the version required by the other packages in the circular dependency chain.

Remember, what you're trying to do is essentially force dpkg into giving you the ability to install the other packages in the chain fully.

@tcreek
Copy link
Author

tcreek commented Jan 10, 2020

It seems

sed -ri 's/(Package: libgcc1)/\1\nDescription: test\nMaintainer: test\nVersion: 2.19/' /var/lib/dpkg/status

needs to be updated. It appears to have corrupted the file /var/lib/dpkg/status

dpkg: error: parsing file '/var/lib/dpkg/status' near line 25 package 'libgcc1':
duplicate value for 'Maintainer' field

Adding the contents:

Package: gcc-8-base
Status: install ok installed
Priority: required
Section: libs
Installed-Size: 250
Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Architecture: amd64
Multi-Arch: same
Source: gcc-8
Version: 8.3.0-26
Breaks: gnat (<< 7), gnat-6 (<< 6.4)
Description: GCC, the GNU Compiler Collection (base package)
 This package contains files common to all languages and libraries
 contained in the GNU Compiler Collection (GCC).
Homepage: http://gcc.gnu.org/

Package: libgcc1
Description: test
Maintainer: test
Version: 2.19
Status: install ok unpacked
Priority: optional
Section: libs
Installed-Size: 116
Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Architecture: amd64
Multi-Arch: same
Source: gcc-8 (8.3.0-6)
Version: 1:8.3.0-6
Depends: gcc-8-base (= 8.3.0-6), libc6 (>= 2.14)
Breaks: gcc-4.3 (<< 4.3.6-1), gcc-4.4 (<< 4.4.6-4), gcc-4.5 (<< 4.5.3-2)
Description: GCC support library
 Shared version of the support library, a library of internal subroutines
 that GCC uses to overcome shortcomings of particular machines, or
 special needs for some langua

So I went in and removed the "official" Maintainer line.

Repeated:

dpkg: error: parsing file '/var/lib/dpkg/status' near line 29:
duplicate value for 'Version' field

Removed "Version: 1:8.3.0-6"

Repeated:

dpkg: error: parsing file '/var/lib/dpkg/status' near line 33 package 'libgcc1:amd64':
duplicate value for 'Description' field

So it seems the second sed command is not even needed

With all that, I am still getting the dependency problem from this line (which seems to be incorrect also).

pkg -i (location_of_multiarch) dpkg -i (location_of_libc6)

becomes

dpkg -i multiarch-support_2.28-10_amd64.deb dpkg -i libc6_2.28-10_amd64.deb

[ I have no name!@DFS]/sources
$ dpkg -i multiarch-support_2.28-10_amd64.deb dpkg -i libc6_2.28-10_amd64.deb
dpkg: error: cannot access archive 'dpkg': No such file or directory
[ I have no name!@DFS]/sources
$ dpkg -i multiarch-support_2.28-10_amd64.deb
Selecting previously unselected package multiarch-support.
(Reading database ... 20 files and directories currently installed.)
Preparing to unpack multiarch-support_2.28-10_amd64.deb ...
Unpacking multiarch-support (2.28-10) ...
dpkg: dependency problems prevent configuration of multiarch-support:
multiarch-support depends on libc6 (>= 2.3.6-2); however:
Package libc6 is not installed.

dpkg: error processing package multiarch-support (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
multiarch-support

@scottwilliambeasley
Copy link
Owner

It seems

sed -ri 's/(Package: libgcc1)/\1\nDescription: test\nMaintainer: test\nVersion: 2.19/' /var/lib/dpkg/status

needs to be updated. It appears to have corrupted the file /var/lib/dpkg/status

dpkg: error: parsing file '/var/lib/dpkg/status' near line 25 package 'libgcc1':
duplicate value for 'Maintainer' field

I fully agree.

Based on your input, the entries for "Maintainer" and "Version" appear to have already existed and so it does appear to have been an unnecessary change.

dpkg -i multiarch-support_2.28-10_amd64.deb dpkg -i libc6_2.28-10_amd64.deb

This was intended to be two lines in the guide - another typo.

Executing the commands in this way makes dpkg think you're trying to install another file called dpkg, which obviously doesn't exist.

multiarch-support depends on libc6 (>= 2.3.6-2); however:
Package libc6 is not installed.

It appears that we actually need to repeat the partial installation and tricking the database, but this time for libc6 and so that would come first before multiarch-support.

With that in mind, we would also need to reinstall libc6 as well after being able to install multiarch-support. Obviously this is something that I had missed while writing the original guide.

I'll be going through some of these typos shortly, creating an issue and then creating new commits to the master branch to fix them.

This would make your pull request obsolete and so a rebase will have to be done - I'll work with you on that later on.

@tcreek
Copy link
Author

tcreek commented Jan 11, 2020

I'll be going through some of these typos shortly, creating an issue and then creating new commits to the master branch to fix them.

Looking forward to that.

This would make your pull request obsolete and so a rebase will have to be done - I'll work with you on that later on.

My pull request actually fixes everything to enable at least get the first package installed, but yes, I see your point if you made those changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants