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

sed command to change dkpg database results in db corruption #10

Closed
scottwilliambeasley opened this issue Jan 11, 2020 · 0 comments
Closed

Comments

@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

Adding the contents:

Package: gcc-8-base
Status: install ok installed
Priority: required
Section: libs
Installed-Size: 250
Maintainer: Debian GCC Maintainers <[email protected]>
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 <[email protected]>
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

Originally posted by @tcreek in #7 (comment)

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

1 participant