How to test PPA packages (safely)

Hi, I would like to know how do you test packages from PPA (safely). Do you only test on virtual machine or also on baremetal? If on physical device, what method do you use?

For ex., just today @Wimpy updated ubuntu-mate-artwork package and we would be testing it. I have already added his playground PPA and updated the package. But I was wondering if we can install the package momentarily (using -t option) for testing and then revert to released package via 'apt pinning'. I tried, but it did not work.

My pinning file is as below.

Package: *
Pin: release o=LP-PPA-flexiondotorg-playground
Pin-Priority: 500

But if I do apt policy, it still gives higher priority to PPA.

[email protected]:/etc/apt/apt.conf.d$ apt policy ubuntu-mate-artwork 
ubuntu-mate-artwork:
  Installed: 21.04.3
  Candidate: 21.04.4~hirsute1.0
  Version table:
     21.04.4~hirsute1.0 500
        500 http://ppa.launchpad.net/flexiondotorg/playground/ubuntu hirsute/main amd64 Packages
        500 http://ppa.launchpad.net/flexiondotorg/playground/ubuntu hirsute/main i386 Packages
 *** 21.04.3 500
        500 http://archive.ubuntu.com/ubuntu devel/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu devel/universe i386 Packages
        100 /var/lib/dpkg/status

What am I doing wrong?

P.S.: I'm on devel branch (rolling rhino) on my laptop.

I managed to get it working with following lines in preferences file.

Package: *
Pin: release o=ubuntu
Pin-Priority: 1000

Package: *
Pin: release o=LP-PPA-flexiondotorg-playground
Pin-Priority: 500

I had actually put the first three lines before, but the difference was, I had n=hirsute first, later a=hirsute both of which did not work, while latest entry o=ubuntu worked. If I check apt policy now, I get as below,

[email protected]:/etc/apt/preferences.d$ apt policy ubuntu-mate-artwork 
ubuntu-mate-artwork:
  Installed: 21.04.4~hirsute1.0
  Candidate: 21.04.3
  Version table:
 *** 21.04.4~hirsute1.0 500
        500 http://ppa.launchpad.net/flexiondotorg/playground/ubuntu hirsute/main amd64 Packages
        500 http://ppa.launchpad.net/flexiondotorg/playground/ubuntu hirsute/main i386 Packages
        100 /var/lib/dpkg/status
     21.04.3 1000
       1000 http://archive.ubuntu.com/ubuntu devel/universe amd64 Packages
       1000 http://archive.ubuntu.com/ubuntu devel/universe i386 Packages

which is what I'm expecting, so I can install ppa package on purpose and not by default.

Two questions.

  1. what difference o=ubuntu makes over a=hirsute when trying to override ppa for hirsute?
  2. Is my approach still correct or there would be issues with it? Is there a better way?