I don't know about the rest of you, but I prefer to install Electrum on my Linux machines using the python package tarball. I recently installed Debian 12 Bookworm on one of my laptops, but was surprised to find an error when attempting to install Electrum.
More info on the error and resolution can be found in the issue I submitted on Github.
It appears that Debian isn't the only OS with changes that broke the python installation instructions found on Electrum's website. Another, earlier issue was reported in regards to Ubuntu 23.
Below are the instructions on how to install the Python version of Electrum on newer Linux distros with kernel versions of 6.0 and above. If you installed the new version of Linux on a freshly formatted hard drive you can proceed with the installation instructions. If you upgraded from a previous version of Linux you'll want to uninstall Electrum first. Make sure to backup your wallet files.
To uninstall previous versions of Electrum (make sure to backup your wallet files first):
sudo apt remove electrum
Install ElectrumIf you have previously used this method to install Electrum and you want to upgrade to a newer version, only steps 4 through 6 are required, and optionally, step 9 to clean up. Make sure to substitute the file names for the desired package.
1. Perform an update.
sudo apt update
2. Install the required dependencies:
sudo apt install -y libsecp256k1-dev python3.11-venv python3-pyqt5
3. Create the environment folder for Electrum:
sudo python3 -m venv --system-site-packages /opt/electrum
4. From the user home directory (not important, but cleaner) download the required package and signature files:
wget https://download.electrum.org/4.5.5/Electrum-4.5.5.tar.gz https://download.electrum.org/4.5.5/Electrum-4.5.5.tar.gz.asc
5. Verify the package (more info
here):
gpg --verify Electrum-4.5.5.tar.gz.asc
6. From the same directory where you downloaded the tarball you can now install Electrum with this command:
sudo /opt/electrum/bin/pip install Electrum-4.5.5.tar.gz
7. A symlink to the binary is needed for the app drawer launcher and to simplify CLI commands:
sudo ln -s /opt/electrum/bin/electrum /usr/bin/electrum
8. Create the app drawer launcher file, "electrum.desktop," and update it's link to the icon image location:
sudo desktop-file-install /opt/electrum/share/applications/electrum.desktop
sudo sed -i -e 's+Icon=electrum+Icon=/opt/electrum/share/icons/hicolor/128x128/apps/electrum.png+' /usr/share/applications/electrum.desktop
9. Clean up by removing unneeded files:
rm Electrum-4.5.5.tar.gz Electrum-4.5.5.tar.gz.asc
And that's it. You should find the Electrum icon in your app drawer or applications list, and it should start Electrum without any issues. You should also be able to interact with Electrum using the CLI commands.
**Note: If you have previously used this method to install Electrum and you want to upgrade to a newer version, only steps 4 through 6 are required, and optionally, step 9 to clean up. Make sure to substitute the file names for the desired package.