This error occurs when apt's HTTPS method crashes during package updates, usually due to CPU instruction incompatibility or corrupted binaries. Set GNUTLS_CPUID_OVERRIDE=0x1 or reinstall apt-transport-https to fix it.
When apt attempts to fetch packages from HTTPS repositories, it uses a method handler to manage the HTTPS connection. "Method https has died unexpectedly" indicates that the HTTPS handler process crashed or was terminated abnormally. This typically happens when the gnutls library (used for SSL/TLS connections) encounters instructions that your CPU doesn't support, causing an illegal instruction error. Alternatively, the apt methods binary may be corrupted or incompatible with your system architecture.
The quickest fix is to set an environment variable that tells GNUTLS to avoid problematic CPU instructions:
GNUTLS_CPUID_OVERRIDE=0x1 sudo apt updateIf this works, you can make it permanent so you don't need to set it each time.
Edit your system environment file to always apply the fix:
sudo nano /etc/environmentAdd this line at the end of the file:
GNUTLS_CPUID_OVERRIDE=0x1Save the file (Ctrl+O, Enter, Ctrl+X), then log out and log back in or reboot:
rebootAlternatively, add it to your shell profile for user-level changes:
echo "export GNUTLS_CPUID_OVERRIDE=0x1" >> ~/.bashrc
source ~/.bashrcIf the GNUTLS fix doesn't work, the binary may be corrupted. Reinstall the package:
GNUTLS_CPUID_OVERRIDE=0x1 sudo apt-get install --reinstall apt-transport-httpsNote: You may need to use the GNUTLS_CPUID_OVERRIDE environment variable even during reinstallation if the issue is CPU-related.
For Raspberry Pi or other ARM systems, you might need to specify the exact version:
sudo apt-get install --reinstall apt-transport-https=1.8.2.3_armhf.debIf reinstalling doesn't help, clear the apt cache and rebuild it:
GNUTLS_CPUID_OVERRIDE=0x1 sudo apt-get clean
GNUTLS_CPUID_OVERRIDE=0x1 sudo rm -rf /var/lib/apt/lists/*
GNUTLS_CPUID_OVERRIDE=0x1 sudo apt-get updateThis removes potentially corrupted metadata and downloads fresh package lists.
If apt is completely stuck, force-kill any running apt processes:
sudo killall apt apt-get
sudo rm /var/lib/apt/lists/lock
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/cache/apt/archives/lock
sudo dpkg --configure -aThen try apt again with the GNUTLS fix:
GNUTLS_CPUID_OVERRIDE=0x1 sudo apt updateIf HTTPS continues to fail and you cannot apply the fixes, temporarily use HTTP repositories instead:
sudo nano /etc/apt/sources.listReplace https:// with http:// in all lines. For example, change:
deb https://deb.debian.org/debian bullseye mainto:
deb http://deb.debian.org/debian bullseye mainAlso check and update any files in /etc/apt/sources.list.d/. After making changes:
sudo apt updateNote: This reduces security, so resolve the GNUTLS issue when possible and switch back to HTTPS.
The "Method https died unexpectedly" error is strongly associated with GNUTLS (GNU Transport Layer Security) library version mismatches or CPU instruction compatibility issues. This is especially common in cloud VMs, containers (Docker, LXC), and Raspberry Pi systems where CPU capabilities may be restricted. Signal 4 (Illegal Instruction) indicates the gnutls binary was compiled with instructions your CPU doesn't support. The GNUTLS_CPUID_OVERRIDE=0x1 environment variable disables certain CPU feature detection, allowing gnutls to use a more compatible instruction set. For virtual machines, check hypervisor settings for CPU feature flags. In Docker, ensure your base image includes compatible gnutls packages. Some distributions provide precompiled apt-transport-https packages for specific architectures; verify your system architecture with dpkg --print-architecture before manual installation.
dpkg: serious warning: files list file for package 'package-name' contains empty filename
How to fix "files list file contains empty filename" in APT
E: Sub-process /usr/bin/dpkg returned an error code (2)
How to fix "Sub-process /usr/bin/dpkg returned an error code (2)" in APT
dpkg-divert: error: rename involves overwriting 'path' with different file
How to fix dpkg-divert rename conflicts in APT
E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel installation
How to fix "dpkg returned an error code (1)" in APT kernel installation
dpkg: dependency problems prevent configuration of triggers
dpkg: dependency problems prevent configuration of triggers in apt