When you create a new network namespace, the corresponding command gets stuck and does not continue. Dmesg message: "unregister_netdevice: waiting for lo to become free. Usage count = 1"
This problem is caused by a bug in the kernel. The following kernel versions have this bug:
Upgrade the kernel to version 4.4.0-98-generic. In this version, the bug has already been fixed.
sudo apt-get update sudo apt-cache search linux-image-4.4.0-98-generic
If the following information is displayed, it means this version exists in the source and is available for upgrade.
linux-image-4.4.0-98-generic - Linux kernel image for version 4.4.0 on 64 bit x86 SMP
sudo apt-get install linux-image-4.4.0-98-generic linux-headers-4.4.0-98-generic
If the following result is displayed, it means the version upgrade is successful: