9

I am having a problem when trying to add any additional repositories in my Ubuntu Desktop 22.04 LTS running on a VM in ESXi 7. The installation is fresh.

I'm facing the below problem when I try to sudo apt update

...
Reading package lists... Done                        
E: Method https has died unexpectedly!
E: Sub-process https received signal 4.

This happens whenever I try to add repositories. I was trying to add Docker and Sublime text repositories as below:

echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

When I remove the contents of sources.list.d, sudo apt update works fine.

Any help would be appreciated! Thanks

Edit:

On a related note, I also can't clone any repo. I tried using curl, wget and git clone. All these commands, give me the error:

error: git-remote-https died of signal 4
SM1312
  • 193

4 Answers4

16
sudo GNUTLS_CPUID_OVERRIDE=0x1 apt-get update 

this works for me

according to this https://groups.google.com/g/linux.debian.bugs.dist/c/ItKoVDieSow

and you need to add ~/.bashrc with this

export  GNUTLS_CPUID_OVERRIDE=0x1 

for long-term use

andrew.46
  • 39,479
unkonwn
  • 192
  • I've added export GNUTLS_CPUID_OVERRIDE=0x1 in both /root/.bashrc and theuser/.bashrc and even I've restared the vm. But the problem exists. It's ok when I login as root and do apt commands without sudo but with sudo it give the error again. – Emad Helmi Apr 17 '23 at 14:08
  • @EmadHelmi that's likely because sudo is configured with env_reset by default - you'd need to use sudo -E or sudo --preserve-env=GNUTLS_CPUID_OVERRIDE to pass the value from an external environment – steeldriver May 08 '25 at 16:25
3

None of the above solutions even the accepted answer did not work for long-term use. You can use sudo GNUTLS_CPUID_OVERRIDE=0x1 apt-get update (sudo is necessary even if you are logged in as root) every time you want to update packages, but if you're going to make it permanent and system-wide, you must add GNUTLS_CPUID_OVERRIDE=0x1 to the /etc/environment file. After this change, you can update the apt with sudo or without sudo with every user.

homebrand
  • 942
1
  • Update VMware in ESXi from 7.0.0 to 7.0.3.
  • Reboot the guest VM.

It solved the problem for me. Hope this can help.

0

Please try creating the VM under Compatibility mode - ESXi 6.0 virtual machine. I had to do this on another Ubuntu-based image.

Paul
  • 1