See that an update is available (in RStudio by selecting Help then Check for updates, same as karel's answer).
You then navigate to https://www.rstudio.com/products/rstudio/download/ and under Installers for Supported Platforms go to the one for your OS (mine is same as question, Ubuntu 16.04 +) and click on it.
When faced with the open or download option, select open with the Software Installer (actually the default option).
The file will open with the 'Ubuntu Software' program and will prompt you to install R-studio via a blue button. Click that blue button marked install.
Next time you open R-Studio it will be the most up to date version.
You can check for new versions of RStudio from within RStudio by going to the Help menu and clicking Check for Updates.
To check for package updates select Tools -> Check for Package Updates. You can also check for package updates another way by selecting Packages tab -> click Update.
Easy way via GUI:
Next time you open R-Studio it will be the most up to date version.
You can check for new versions of RStudio from within RStudio by going to the Help menu and clicking Check for Updates.
To check for package updates select Tools -> Check for Package Updates. You can also check for package updates another way by selecting Packages tab -> click Update.
The Installer could not open the file. I just used the command line:
(or whatever is your version)
sudo apt install ./rstudio-2022.02.3-492-amd64.deb