Essentially, versions of Electrum prior to 3.3.4 contained a feature which allowed a server to send a message to connected users in the event of there being an error with their transaction. Attackers used this to their advantage, hijacked the error message, and turned it in to the fake "Update Required" message you saw, with a link to a fake Electrum website containing their malicious version of Electrum to be downloaded. Lots of people have fallen victim to this scam, and you certainly won't be the last. This has been patched since version 3.3.4 so it is no longer possible, but many users are still using older version of Electrum, and older versions are still bundled in many packages such as Linux distros.
As I mentioned above, to avoid this you should only ever download from https://electrum.org/#download or https://github.com/spesmilo/electrum, and verify your download before installing.