Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Broken Pkg-Config-Hook-Config File

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
CoolDude2
Posts: 7
Joined: 2020-03-27 23:21

Broken Pkg-Config-Hook-Config File

#1 Post by CoolDude2 »

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)

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Broken Pkg-Config-Hook-Config File

#2 Post by Head_on_a_Stick »

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
deadbang

CoolDude2
Posts: 7
Joined: 2020-03-27 23:21

Re: Broken Pkg-Config-Hook-Config File

#3 Post by CoolDude2 »

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.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Broken Pkg-Config-Hook-Config File

#4 Post by Head_on_a_Stick »

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.
deadbang

CoolDude2
Posts: 7
Joined: 2020-03-27 23:21

Re: Broken Pkg-Config-Hook-Config File

#5 Post by CoolDude2 »

Thank you, it works.

Post Reply