Ubuntu 18.04 (Bionic) and Ubuntu 20.04 (Focal)

This command works as expected and installs Qt 5.12 (or similar) from the official Ubuntu repositories.

sudo apt install qt5-default qtbase5-dev qtchooser qttools5-dev-tools
sudo apt-get install -y libqt5svg5-dev
sudo apt-get install -y libqt5x11extras5-dev
sudo apt install libqt5charts5-dev

Ubuntu 22.04 (Jammy) and later

sudo apt install qtbase5-dev qtchooser qttools5-dev-tools qttools5-dev