ello! i'm trying to enable 32 bit architecture so i can install wine using this guide, but whenever i run
sudo dpkg --add-architecture i386
i get the error message
Odd number of elements in hash assignment at /usr/share/pkg-config-dpkghook line 30.
i've looked online and have seen others with this issue, but seemingly no solution. i'm running 64bit zorin 15.3. if you need any other information about this issue, please ask. ty in advance
Can you please open a terminal and run
sudo nano /usr/share/pkg-config-dpkghook
Copy from below the line use strict
and paste it here, please.
The warning sounds like a typo was made at some point in adding the arch.
underneath use strict
it says:
use Dpkg::Arch qw(debarch_to_gnutriplet);
use Dpkg::ErrorHandling qw(error);
my $crosswrapper = "/usr/share/pkg-config-crosswrapper";
my $action = $ARGV[0];```
I am sorry I was unclear... I meant to copy the full text below that line. I was just trying to avoid the hashed portions at the top.
oh, it's no issue! here
use strict;
use warnings;
use Dpkg::Arch qw(debarch_to_gnutriplet);
use Dpkg::ErrorHandling qw(error);
my $crosswrapper = "/usr/share/pkg-config-crosswrapper";
my $action = $ARGV[0];
error("parameter must be 'remove' or 'update'")
unless defined $action && ($action eq "remove" || $action eq "update");
my $arch = `dpkg --print-architecture`;
error('dpkg --print-architecture failed') if $? >> 8;
my @architectures = `dpkg --print-foreign-architectures`;
error('dpkg --print-foreign-architectures failed') if $? >> 8;
push @architectures, $arch;
chomp @architectures;```
This line... Can you backspace the ``` out of there so it looks like
chomp @architectures;
Then hit ctrl+x to exit, hit the y
key to say yes to save, then hit the enter
key to save as current configuration.
Log out, then back in.
Open a terminal and run
sudo dpkg --add-architecture i386
again and see if anything changes.
just tried that, still getting the error about line 30.
Ok.
Let's go full GUI for an easier time of it.
Can you open terminal and run sudo -i
enter your pw, then when it reverts to Root Term, type in nautilus
(Zorin 15.3 Core. If using Zorin Lite XFCE, type in tthunar
).
A file Manager with Elevated Privileges will open.
For Nautilus, in the Sidebar tree, choose "Other Locations" Then choose "computer" then choose the Root Directory. From there, navigate to /usr then /share then scroll all the way to the bottom.
In Thunar (Zorin Lite)... Hit the Up arrow on the toolbar twice. From there, navigate to /usr then /share then scroll all the way to the bottom. (LOL)
Double click the file to open it (choose Display
not run
.)
Should be starting around line 11 or so, click and drag to highlight all text starting from the beginning of use strict
and backspace it out.
Then paste the following into its place:
use strict;
use warnings;
use Dpkg::Arch qw(debarch_to_gnutriplet);
use Dpkg::ErrorHandling qw(error warning);
my $crosswrapper = "/usr/share/pkg-config-crosswrapper";
my $action = $ARGV[0];
error("parameter must be 'remove' or 'update'")
unless defined $action && ($action eq "remove" || $action eq "update");
my $arch = dpkg --print-architecture
;
error('dpkg --print-architecture failed') if $? >> 8;
my @architectures = dpkg --print-foreign-architectures
;
error('dpkg --print-foreign-architectures failed') if $? >> 8;
push @architectures, $arch;
chomp @architectures;
my %gnutriplets;
foreach my $arch (@architectures) {
my $triplet = debarch_to_gnutriplet($arch);
if (not defined($triplet)) {
warning("Architecture $arch not defined in architecture tables, ignored");
next;
}
$gnutriplets{$triplet} = 1;
}
my %symlinks = map { $_ => 1 } </usr/bin/*-pkg-config>;
foreach my $symlink (keys %symlinks) {
$symlink =~ m,^/usr/bin/([^-]+-[^-]+-[^-]+)-pkg-config, or next;
next if exists $gnutriplets{$1} && $action eq "update";
next unless -l $symlink;
next unless readlink $symlink eq $crosswrapper;
unlink $symlink or
error("failed to remove symlink $symlink: $!");
}
if ($action eq 'update') {
foreach (keys %gnutriplets) {
my $linktarget = "/usr/bin/${_}-pkg-config";
next if exists $symlinks{$linktarget};
next if -e $linktarget;
symlink $crosswrapper, $linktarget or
error("failed to create symlink $linktarget to $crosswrapper: $!");
}
}
Once done, save the file. Check if you have a file in that directory next to pkg-config-dpkghook named pkg-config-crosswrapper
. IF so, Log out, in - test.
sorry, which file? i'm on core, and scrolled all the way to the bottom of /usr/share and there's no files, just folders.
hmmm...
It must be there as you were able to access it in terminal earlier with the sudo nano /usr/share/pkg-config-dpkghook
command...
If it is not showing up, you can perform that same command again and paste it in through the terminal.
i managed to find the file using ctrl+f, and i pasted what you told me to into pkg-config-dpkghook. after rebooting and trying to run the i386 command again, i now get
syntax error at /usr/share/pkg-config-dpkghook line 23, near "--print"
syntax error at /usr/share/pkg-config-dpkghook line 25, near "--print"
BEGIN not safe after errors--compilation aborted at /usr/share/pkg-config-dpkghook line 40.
dpkg: error: error executing hook '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', exit code 65280
also, crosswrapper is there.
That is very strange.
Are you running in VirtualBox or on VMWare?
If not; Can you run in terminal:
sudo dpkg --configure -a
What is the output in terminal of that -If Any?
Then
sudo apt update && sudo apt full-upgrade
nope. running zorin installed directly to my SSD.
sudo dpkg --configure -a
gives no output.
sudo apt update && sudo apt full-upgrade
seemingly does nothing.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
What does
sudo dpkg --print-foreign-architectures
show?
i386
ic86
ic86, eh? What have you been up to?
It looks like 32bit Arch is already installed.
If you want to install Wine on Zorin, the best way is with
sudo apt install zorin-windows-app-support
oh i see, thank you! also, thank you for bearing with me with this.
It's still odd... Running the sudo dpkg --add-architecture i386
should not put out those errors. Even if you have i386 arch installed already, then the terminal would not have any output from that command.
So, please do update this thread if you run into trouble with Wine (Zorin Windows App Support).