If you want to upgrade Android Studio to the latest version on Linux, follow these step-by-step instructions.
If you installed Android Studio manually (not via Snap or APT), remove it first to avoid conflicts. Open a terminal and run:
rm -rf ~/android-studio
rm -rf ~/.local/share/Google/AndroidStudio*
rm -rf ~/.config/Google/AndroidStudio*
rm -rf ~/.cache/Google/AndroidStudio*If you installed via Snap, remove it with:
sudo snap remove android-studio1οΈβ£ Open the terminal and go to your Downloads folder:
cd ~/Downloads2οΈβ£ Extract the tar.gz file:
tar -xvf android-studio-<new-version>-linux.tar.gzFor Example : tar -xvf android-studio-2024.2.2.13-linux.tar.gz
3οΈβ£ Move the extracted folder to /opt/ (recommended for global access):
sudo mv android-studio /opt/Run the installer using the following command:
/opt/android-studio/bin/studio.shWhen prompted, select "Do not import settings" if asked.
Now, follow the setup wizard and update SDK & plugins as required.
To add Android Studio to your application menu:
1οΈβ£ Open a terminal and run:
nano ~/.local/share/applications/android-studio.desktop2οΈβ£ Add the following content:
[Desktop Entry]
Version=1.0
Type=Application
Name=Android Studio
Exec=/opt/android-studio/bin/studio.sh
Icon=/opt/android-studio/bin/studio.png
Terminal=false
Categories=Development;IDE;3οΈβ£ Save the file (Ctrl + X, then Y, then Enter).
4οΈβ£ Make the shortcut executable:
chmod +x ~/.local/share/applications/android-studio.desktopRun Android Studio using:
/opt/android-studio/bin/studio.shOR
Search for "Android Studio" in your application menu.
If the app doesn't open, install missing dependencies:
sudo apt update && sudo apt install libxcb-xinerama0Now your Android Studio is successfully updated! ππ
π‘ Enjoy coding with the latest Android Studio! π₯οΈβ¨