Hi everyone,

Ran into a issue yesterday when trying to install Mingw-w64 on kali 4.13.0 adm64 (VMware version)
As per download on https://www.offensive-security.com/k...mage-download/
Managed to solve it so figured I share it with you all, should you run into a similar issue.

The problem:
When I tryed to install mingw-w64 I got the following error message:
Code:
root@kali:~# apt-get install mingw-w64 -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 g++-mingw-w64
  g++-mingw-w64-i686 g++-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-base
  gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 gfortran-mingw-w64
  gfortran-mingw-w64-i686 gfortran-mingw-w64-x86-64 gnat-mingw-w64
  gnat-mingw-w64-base gnat-mingw-w64-i686 gnat-mingw-w64-x86-64
  mingw-w64-common mingw-w64-i686-dev mingw-w64-x86-64-dev
Suggested packages:
  gcc-6-locales
The following NEW packages will be installed:
  binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 g++-mingw-w64
  g++-mingw-w64-i686 g++-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-base
  gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 gfortran-mingw-w64
  gfortran-mingw-w64-i686 gfortran-mingw-w64-x86-64 gnat-mingw-w64
  gnat-mingw-w64-base gnat-mingw-w64-i686 gnat-mingw-w64-x86-64 mingw-w64
  mingw-w64-common mingw-w64-i686-dev mingw-w64-x86-64-dev
0 upgraded, 20 newly installed, 0 to remove and 0 not upgraded.
Need to get 208 MB of archives.
After this operation, 1,174 MB of additional disk space will be used.
Err:1 http://http.kali.org/kali kali-rolling/main amd64 binutils-mingw-w64-i686 amd64 2.28-5+7.4+b4
  404  Not Found
---lots of errors 404  Not Found
E: Failed to fetch http://http.kali.org/kali/pool/main/m/mingw-w64/mingw-w64_5.0.2-2_all.deb  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Kali would return a 404 error, so I did as the line suggest and ran the update.

After running apt-get update the following would happen:
Code:
root@kali:~# apt-get update
Get:1 http://ftp1.nluug.nl/os/Linux/distr/kali kali-rolling InRelease [30.5 kB]
Err:1 http://ftp1.nluug.nl/os/Linux/distr/kali kali-rolling InRelease
  The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <[email protected]>
Fetched 30.5 kB in 0s (46.8 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp1.nluug.nl/os/Linux/distr/kali kali-rolling InRelease: The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <[email protected]>
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease  The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <[email protected]>
W: Some index files failed to download. They have been ignored, or old ones used instead.
Turns out the keyring package is outdated.
so running apt-get install mingw-w64 -y would just return the same 404 errors.

The fix:
Run the following command
Code:
root@kali:~# wget -q -O - https://archive.kali.org/archive-key.asc  | apt-key add
OK
root@kali:~# apt-get update
Get:1 http://ftp1.nluug.nl/os/Linux/distr/kali kali-rolling InRelease [30.5 kB]
Get:2 http://ftp1.nluug.nl/os/Linux/distr/kali kali-rolling/main i386 Packages [15.7 MB]
Get:3 http://ftp1.nluug.nl/os/Linux/distr/kali kali-rolling/main amd64 Packages [15.8 MB]
Get:4 http://ftp1.nluug.nl/os/Linux/distr/kali kali-rolling/non-free i386 Packages [145 kB]
Get:5 http://ftp1.nluug.nl/os/Linux/distr/kali kali-rolling/non-free amd64 Packages [163 kB]
Get:6 http://ftp1.nluug.nl/os/Linux/distr/kali kali-rolling/contrib i386 Packages [109 kB]
Get:7 http://ftp1.nluug.nl/os/Linux/distr/kali kali-rolling/contrib amd64 Packages [115 kB]
Fetched 32.0 MB in 4s (6,864 kB/s)                   
Reading package lists... Done
Now re-run the installation of mingw-w64 and it should succeed
Code:
root@kali:~# apt-get install mingw-w64 -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 g++-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-base gcc-mingw-w64-i686 gcc-mingw-w64-x86-64
  mingw-w64-common mingw-w64-i686-dev mingw-w64-x86-64-dev
Suggested packages:
  gcc-7-locales
The following NEW packages will be installed:
  binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 g++-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-base gcc-mingw-w64-i686 gcc-mingw-w64-x86-64
  mingw-w64 mingw-w64-common mingw-w64-i686-dev mingw-w64-x86-64-dev
0 upgraded, 13 newly installed, 0 to remove and 1147 not upgraded.
Need to get 127 MB of archives.
After this operation, 743 MB of additional disk space will be used.
Get:1 http://ftp2.nluug.nl/os/Linux/distr/kali kali-rolling/main amd64 binutils-mingw-w64-i686 amd64 2.29.1-13+8 [2,287 kB]
--downloading
Setting up g++-mingw-w64 (7.2.0-19+20.1) ...
Setting up mingw-w64 (5.0.3-1) ...
note, you can add 32bit architecture using the following line.
Code:
dpkg --add-architecture i386
apt-get update
you can check your architecture with following command lines:
Code:
dpkg --print-architecture
dpkg --print-foreign-architectures