PPA: Install old version

I am trying to install package qelectrotech on ubuntu 18.04.
After installing I got (old) version 0.5-2. So I added a PPA (sudo add-apt-repository ppa:scorpio/qelectrotech-dev) source to get the newer version. But they don't work automatically. Now I need to manually force "downgrade" and look for the version to get a new version of 0.90.
After checking, I realised that my ubuntu system added some version info before the actual version!
I see old (original 0.5-2 ) the old version 1:0.5-2 and the version in PPA (new 0.90.r7446) as 0.90.r7446.

As 0.90.r7664 seems older than 1:0.5-2, I always get the old version installed instead of the new. So how to get rid of that 1:, as this is not the part of the original version?

Thank you


First, create a new folder, and enter it.

mkdir qelectrotech && cd qelectrotech

Then, download the relevant packages from the PPA.

wget https://launchpad.net/~scorpio/+archive/ubuntu/qelectrotech-dev/+files/qelectrotech_0.90.r7446-1ubuntu1_amd64.deb
wget https://launchpad.net/~scorpio/+archive/ubuntu/qelectrotech-dev/+files/qelectrotech-data_0.90.r7446-1ubuntu1_all.deb
wget https://launchpad.net/~scorpio/+archive/ubuntu/qelectrotech-dev/+files/qelectrotech-examples_0.90.r7446-1ubuntu1_all.deb

Now, remove the version installed from the official repositories, and install the .deb packages

sudo apt remove qelectrotech
sudo apt remove qelectrotech-data
sudo apt remove qelectrotech-examples
sudo dpkg -i *.deb

Now install any missing dependencies

sudo apt install -f

Finally, hold the packages in apt, so that it does not update to the "new version" which is actually older.

sudo apt-mark hold qelectrotech qelectrotech-data qelectrotech-examples

The bad moment here is that you do not want to read QElectroTech-dev PPA description on its page.
The developer clearly states:

QElectroTech Ubuntu Repository for 0.9 devel version.

Ubuntu pinning
The following entry assigns a high priority to all versions of the QElectroTech package beginning with 0.80. :
This way, your system will download the higher package version from the ppa and not those from the official Ubuntu repositories.

Create manually the file 40qelectrotech-devel in /etc/apt/preferences.d/ and add these 3 lines:

Package: qelectrotech*
Pin: version 0.90.*
Pin-Priority: 1001

https://qelectrotech.org/wiki_new/start?id=en/doc/install_ubuntu

apt-get install qelectrotech qelectrotech-data qelectrotech-examples qet-tb-generator

So you need to really create such file with relevant version by using command below:

cat <<EOF | sudo tee /etc/apt/preferences.d/40qelectrotech-devel
Package: qelectrotech*
Pin: version 0.90.*
Pin-Priority: 1001
EOF

and then install these 0.90 versioned packages by:

sudo apt-get install qelectrotech qelectrotech-data qelectrotech-examples