Fetch newest routeros with architecture

Hello,

how can I download the latest version of the router on the switch?

that does not work

:global platform [/system resource get architecture-name];
/tool fetch url=“sftp://192.168.111.254/routeosVERSION.npk” dst-path=“routeosVERSION.npk” user=“test” password=“test”;

{
:local vers "7.1.2";
:local arc [/system resource get architecture-name];
/tool fetch mode=https url="https://download.mikrotik.com/routeros/$vers/routeros-$vers-$arc.npk"
}

Of course if you don’t want to manually set the $vers variable, some other shenanigans will be required
The usual

/system package update install

is not sufficient?

If you are looking for rOS version 6.x, change places of the $vers and $arc, as for some reason they are reversed there:

.../routeros/$vers/routeros-$arc-$vers.npk"