Wifi only connects only after logging in... | Wifi breaks after apt-get upgrade

Uploaded Debian Xfce image, disabled Desktop enviroment:
sudo systemctl set-default graphical.target
And wifi is not connecting automatically until i login to tty…
Is there any way to fix that?

Also if i run apt-get upgrade and after reboot wlan0 interface disappears…

You cannot use apt-get upgrade, as this command will not remove packages. We constantly need to refactor our packages to support newer products, which means some times a single large package will be spitted into multiple smaller packages to improve code reuse. When you run apt-get upgrade, some of those packages will stay at their old versions, which will not work correctly with the newer packages.

This is a common issue in Debian derivatives. For example, Proxmox VE also can’t be upgraded with apt-get upgrade.

The supported upgrade method is via rsetup.