How to install wine stable from winehq on Linux Mint 20 or Ubuntu

The wine package in the Ubuntu Linux repository is version 5, but running applications from it, cannot connect to the internet. It was found that upgrading to wine version in the winehq repository solved this error. To install wine from winehq, open a terminal window and enter the following commands:

$ sudo dpkg --add-architecture i386 <enter>

$ wget -nc <enter>
$ sudo apt-key add winehq.key <enter>

Add the repository
$ sudo add-apt-repository 'deb focal main' <enter>

$ sudo apt-get update <enter>

$ sudo apt install --install-recommends winehq-stable <enter>

After installing wine version from the winehq repository, the network error is resolved.