5

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

Error404
  • 7,440
eSlavko
  • 163

2 Answers2

6

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
Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
  • 3
    All good, but APT-pinning is more reliable. See https://askubuntu.com/q/1002703/66509 . – N0rbert Nov 20 '21 at 10:10
  • I use synaptic package manager. And I can force correct version. But I need to lock version too as if I don't do that the next update will downgrade version. And I like to have unlocked version so they will be updated when new one is available. – eSlavko Nov 20 '21 at 13:26
  • @N0rbert I am not much familiar with APT-pinning. Please feel free to edit or add your own answer (whichever one you prefer). – Archisman Panigrahi Nov 20 '21 at 13:55
  • @eSlavko please add the output apt-cache policy qelectrotech to the question by editing it. This will allow us to create pinning file. – N0rbert Nov 20 '21 at 14:05
5

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
N0rbert
  • 99,918