Broken Pkg-Config-Hook-Config File

New to Debian (Or Linux in general)? Ask your questions here!

Broken Pkg-Config-Hook-Config File

Postby CoolDude2 » 2020-04-05 13:24

Hello, I recently ran a sudo sh -c "echo 'foreign architecture i386' > 'etc//dpkg/dpkg.cfg.d/pkg-config-hook-config" command in an attempt to install steam on a amd64 architecture platform. However due to recent studies its seems it wasn't necessary to do that because 32-bit processing is already available in 64-bit architecture. The only reason I did it originally was because all the package manager could find was steam-devices. Yes, I am a total newb. Now, I'm trying to fix the configuration file and I don't know how to do that. I'll keep looking though. All in all its a Dpkg configuration error.

dpkg: error: configuration error: /etc/dpkg/dpkg.cfg.d/pkg-config-hook-config:1: unknown option '(it now states "amd64" in random unknowing attempts) E: Sub-process /usr/bin/dpkg returned an error code (2)
CoolDude2
 
Posts: 7
Joined: 2020-03-27 23:21

Re: Broken Pkg-Config-Hook-Config File

Postby Head_on_a_Stick » 2020-04-05 13:42

Here are the original file contents:
Code: Select all
post-invoke=if { test "$DPKG_HOOK_ACTION" = add-architecture || test "$DPKG_HOOK_ACTION" = remove-architecture; } && test -x /usr/share/pkg-config-dpkghook; then /usr/share/pkg-config-dpkghook update; fi

If you ever do something this stupid again and are stuck without an internet connection then check /var/cache/apt/archives/ for a copy of the dpkg .deb file and use this to unpack it so you can restore any files:
Code: Select all
ar x dpkg*.deb
tar xf data.tar.xz
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12609
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Broken Pkg-Config-Hook-Config File

Postby CoolDude2 » 2020-04-05 14:36

Thank you, you are my hero, it's my dream to be able to handle the system as well as you. However using this command

post-invoke=if { test "$DPKG_HOOK_ACTION" = add-architecture || test "$DPKG_HOOK_ACTION" = remove-architecture; } && test -x /usr/share/pkg-config-dpkghook; then /usr/share/pkg-config-dpkghook update; fi

I recieved and error message.

bash: syntax error near unexpected token `}'

Which is referring to the '}' located before && and after ;

I don't know how to correct that error. Also, thank you for the information about possible future errors, I've downloaded the post so I'll have it if needed.
CoolDude2
 
Posts: 7
Joined: 2020-03-27 23:21

Re: Broken Pkg-Config-Hook-Config File

Postby Head_on_a_Stick » 2020-04-05 14:49

CoolDude2 wrote:using this command

It's not a command, I posted the full content of /etc/dpkg/dpkg.cfg.d/pkg-config-hook-config for you to copy over.

Use this command to achieve that:
Code: Select all
sudo tee /etc/dpkg/dpkg.cfg.d/pkg-config-hook-config <<<'post-invoke=if { test "$DPKG_HOOK_ACTION" = add-architecture || test "$DPKG_HOOK_ACTION" = remove-architecture; } && test -x /usr/share/pkg-config-dpkghook; then /usr/share/pkg-config-dpkghook update; fi'

Probably best to copy&paste that into your terminal to avoid transcription errors. If you don't have sudo installed then use 'su -' to get a root prompt then run the command without sudo.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12609
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Broken Pkg-Config-Hook-Config File

Postby CoolDude2 » 2020-04-05 14:54

Thank you, it works.
CoolDude2
 
Posts: 7
Joined: 2020-03-27 23:21


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable