Install AnyDesk on Ubuntu 24
Install AnyDesk on Ubuntu 24.04
This tutorial shows how to install AnyDesk on an Ubuntu 24 system using a Bash script. The script adds the AnyDesk repository, installs the package, updates the GDM configuration, and then asks you to reboot the system.
What the Script Does
- Adds the AnyDesk GPG key.
- Adds the AnyDesk APT repository.
- Updates the Ubuntu package list.
- Installs AnyDesk.
- Backs up the existing GDM configuration.
- Writes the new GDM configuration.
- Asks you to reboot the system.
1. Save the Script
Save the following file as install-anydesk.sh:
#!/bin/bash
set -e
echo ">>> Adding AnyDesk GPG key..."
wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | sudo gpg --dearmor -o /usr/share/keyrings/anydesk.gpg
echo ">>> Adding AnyDesk repository..."
echo "deb [signed-by=/usr/share/keyrings/anydesk.gpg] http://deb.anydesk.com/ all main" | sudo tee /etc/apt/sources.list.d/anydesk.list
echo ">>> Updating package list..."
sudo apt update
echo ">>> Installing AnyDesk..."
sudo apt install -y anydesk
echo ">>> Backing up and replacing GDM config..."
sudo mv /etc/gdm3/custom.conf /etc/gdm3/custom.conf-bkp
echo ">>> Writing new GDM config..."
sudo bash -c "cat > /etc/gdm3/custom.conf << 'EOF'
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.
[daemon]
# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false
# Enabling automatic login
AutomaticLoginEnable = true
AutomaticLogin = \$USERNAME
# Enabling timed login
# TimedLoginEnable = true
# TimedLogin = user1
# TimedLoginDelay = 10
[security]
[xdmcp]
[chooser]
[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true
EOF"
echo "✅ Done. Reboot your system to apply GDM and AnyDesk changes."
2. Make the Script Executable
chmod +x install-anydesk.sh3. Run the Script
sudo ./install-anydesk.sh4. What Each Part Does
Add the AnyDesk GPG Key
wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | sudo gpg --dearmor -o /usr/share/keyrings/anydesk.gpgDownloads the repository signing key and stores it in the system keyring.
Add the AnyDesk Repository
echo "deb [signed-by=/usr/share/keyrings/anydesk.gpg] http://deb.anydesk.com/ all main" | sudo tee /etc/apt/sources.list.d/anydesk.listAdds the AnyDesk package repository to the Ubuntu system.
Install AnyDesk
sudo apt update
sudo apt install -y anydeskRefreshes the package list and installs AnyDesk.
Back Up the GDM Configuration
sudo mv /etc/gdm3/custom.conf /etc/gdm3/custom.conf-bkpMoves the existing GDM configuration to a backup file before the new configuration is written.
Update GDM
The script creates a new /etc/gdm3/custom.conf file containing the GDM settings used by the script.
5. Reboot the System
sudo rebootThe script itself only displays the message asking you to reboot. Run the command above after reviewing the changes.
Quick Reference
chmod +x install-anydesk.sh
sudo ./install-anydesk.sh
sudo rebootImportant Note
The script provided in this tutorial is reproduced from the supplied setup script. Test it on a non-production system first and review the GDM automatic login settings before applying it to a production or shared machine.
Conclusion
This Bash script provides a quick way to install AnyDesk on Ubuntu 24 and apply the supplied GDM configuration changes in one step.
Discussion (0)