How to add bash auto completion in Ubuntu Linux

Originally published at: https://www.cyberciti.biz/faq/add-bash-auto-completion-in-ubuntu-linux/

I set up a new Ubuntu Linux LXD container, but my auto-completion of bash shell commands are not working. How do I enable autocomplete feature in Ubuntu Linux 18.04 LTS?