How to fix E: Sub-process /usr/lib/apt/methods/https received a segmentation fault in APT
The HTTPS method in APT crashes during package operations with a segmentation fault, preventing apt-get update and upgrades. This usually stems from missing transport packages, corrupted cache files, or libc issues.
Quick fix
Fixes E: Sub-process /usr/lib/apt/methods/https received a segmentation fault
sudo apt-get install apt-transport-https- Install apt-transport-https package
- Clear corrupted APT cache files
- Check for problematic HTTPS repository entries
- Increase APT cache allocation (memory-constrained systems)
sudo apt-get install apt-transport-httpsE: Sub-process /usr/lib/apt/methods/https received a segmentation fault
What this error means
This error occurs when APT's HTTPS method handler crashes unexpectedly. The /usr/lib/apt/methods/https process is responsible for handling secure connections to package repositories. When it receives a segmentation fault (SIGSEGV), it means the process encountered a memory access violation and terminated. This prevents APT from downloading and installing packages over HTTPS.
Typical symptoms
- apt-get update fails immediately when processing HTTPS repositories
- apt-get upgrade crashes before downloading packages
- apt commands fail with 'Method https has died unexpectedly'
- Works with HTTP repositories but not HTTPS
- Error appears in WSL2, Docker containers, or Raspberry Pi systems
Common causes
- Missing apt-transport-https package (most common on minimal installations)
- Corrupted APT cache files in /var/cache/apt/*.bin
- HTTPS repository misconfiguration or corrupted repository metadata
- Memory allocation issues or insufficient cache size
- System libc or libstdc++ corruption
- WSL2 or Docker environment-specific transport issues
How to fix "E: Sub-process /usr/lib/apt/methods/https received a segmentation fault"
The most common fix is installing the HTTPS transport handler:
sudo apt-get install apt-transport-httpsThis package provides the actual HTTPS method implementation. If apt-get itself is broken, you may need to bootstrap it with HTTP first by temporarily switching HTTPS repositories to HTTP.
Remove the binary cache files that may be corrupted:
sudo rm /var/cache/apt/*.bin
sudo apt-get updateThis forces APT to rebuild its cache from scratch. The *.bin files are memory-mapped caches that can become corrupted if the system crashes or runs out of memory.
Review your sources lists for HTTPS repositories that may be causing issues:
cat /etc/apt/sources.list
ls /etc/apt/sources.list.d/Temporarily comment out any HTTPS repositories you added, keeping only the official Ubuntu/Debian ones. You can re-add them after apt-transport-https is installed:
sudo nano /etc/apt/sources.list
# Change: deb https://... to # deb https://...
sudo apt-get updateIf you're on a system with limited memory (Raspberry Pi, embedded systems), increase the cache size:
echo 'APT::Cache-start 200000000;' | sudo tee -a /etc/apt/apt.confThis tells APT to allocate 200MB instead of the default, preventing segfaults on memory-constrained systems.
As a last resort, manually download and reinstall APT:
# On another working system or using wget:
wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt_*.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-*.deb
# Then on the broken system:
sudo dpkg -i apt_*.deb libapt_*.deb
sudo apt-get install -f # Fix any broken dependenciesMatch the version numbers to your Ubuntu/Debian release.
If you're in a Docker container or WSL2, try installing apt-transport-https before adding HTTPS repositories:
RUN apt-get update && apt-get install -y apt-transport-httpsFor Docker, ensure your Dockerfile doesn't mix HTTPS repositories with the initial apt-get update. In WSL2, verify your system clock is synchronized (time skew can cause HTTPS issues):
sudo ntpdate -s time.nist.govAdvanced notes
The underlying bug was fixed in Debian APT in 2009 for HTTP but the HTTPS method handler received the fix much later, affecting Ubuntu Trusty and older Raspberry Pi distributions. On resource-constrained systems, APT may fail to allocate enough memory for the package index, causing segfaults before it even connects to HTTPS. WSL2 has environment-specific issues with HTTPS transport that sometimes require using the Microsoft-provided package manager (apt-utils) or upgrading WSL2 kernel. If you see 'Problem with MergeList' errors, your /var/lib/dpkg/status file may be corrupted—in that case, you'll need to recover from a backup or reinstall the system.
Frequently asked questions
- What does "E: Sub-process /usr/lib/apt/methods/https received a segmentation faul" mean?
- This error occurs when APT's HTTPS method handler crashes unexpectedly. The /usr/lib/apt/methods/https process is responsible for handling secure connections to package repositories. When it receives a segmentation fault (SIGSEGV), it means the process encountered a memory access violation and terminated.
- How do I fix "E: Sub-process /usr/lib/apt/methods/https received a segmentation faul"?
- The HTTPS method in APT crashes during package operations with a segmentation fault, preventing apt-get update and upgrades. This usually stems from missing transport packages, corrupted cache files, or libc issues.
- What causes "E: Sub-process /usr/lib/apt/methods/https received a segmentation faul"?
- Missing apt-transport-https package (most common on minimal installations) Corrupted APT cache files in /var/cache/apt/*.bin HTTPS repository misconfiguration or corrupted repository metadata
- Is the "E: Sub-process /usr/lib/apt/methods/https received a segmentation faul" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.