Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] Python 3 upgrade forces removal of hplip & friends  (Read 57162 times)

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.477
    • Land of the Buckeye
[EN] Re: Python 3 upgrade forces removal of hplip & friends
« Reply #30 on: 2025/01/24, 23:32:08 »
.
If you don't want to wait you can test the patch script on the iso live image in a couple of days.

The workaround that @Teriarch made, described in post #10 on this thread, is working perfectly for my HP LaserJet Pro p1606dn, for 2 siduction systems in my home.
System76 Oryx Pro, Intel Core i7-11800H, ASRock B860 Pro-A, Intel Core Ultra 7 265KF, Nvidia GTX-1060, SSD 990 EVO Plus.

Offline Teriarch

  • User
  • Posts: 168
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #31 on: 2025/01/25, 02:16:59 »
Please,please check the script first on the live shine-on iso image before you proceed.

If something fails you can always restart and report the failure. Be sure to have sudo
configured for the current user and don't worry if the hplip packages will get removed in
the process, you will get them back in a blink of an eye even before the script ends.

Have fun!

Code: [Select]
#!/usr/bin/bash

pushd .
sudo apt-get update
mkdir /tmp/hplip
mkdir /tmp/hptmp
cd /tmp/hplip
sudo apt-get install python3 python3.12
apt-get download python3
dpkg-deb -x /tmp/hplip/python3_3.13.1-2_amd64.deb /tmp/hptmp
dpkg-deb --control python3_3.13.1-2_amd64.deb /tmp/hptmp/DEBIAN
sed -i -e 's/python3-profiler/python3 (= 3.12), python3-profiler/g' /tmp/hptmp/DEBIAN/control
sed -i -e 's/Version: 3.13.1-2/Version: 3.13.1-2b/g' /tmp/hptmp/DEBIAN/control
dpkg-deb --root-owner-group -b /tmp/hptmp /tmp/hplip/python3_3.13.1-2b_amd64.deb
rm /tmp/hplip/python3_3.13.1-2_amd64.deb
sudo dpkg -i /tmp/hplip/*.deb
cd /tmp
rm -rf /tmp/hptmp /tmp/hplip

sudo apt-get install hplip hplip-data hplip-gui
grep -r '#!/usr/bin/python3' /usr/share/hplip /usr/lib/cups/backend 2>/dev/null|sed -e 's/:#!\/usr\/bin\/python3//g'|xargs -n1 sudo sed -i -e 's/\#\!\/usr\/bin\/python3/\#\!\/usr\/bin\/python3.12/g'
# grep -r '#!/usr/bin/python3' /usr/share/hplip /usr/lib/cups/backend 2>/dev/null|sed -e 's/:#!\/usr\/bin\/python3.12//g'|xargs -n1 sudo sed -i -e 's/\#\!\/usr\/bin\/python3.12/\#\!\/usr\/bin\/python3/g'
/usr/bin/hp-systray -x&
popd


Offline Teriarch

  • User
  • Posts: 168
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #32 on: 2025/01/25, 15:37:29 »
A minor improvement to get rid of the version tracking in case
Python3 is getting an update (and don't forget to chmod 755 the
script before execution):

Code: [Select]
#!/usr/bin/bash

pushd .
sudo apt-get update
mkdir /tmp/hplip
mkdir /tmp/hptmp
cd /tmp/hplip
sudo apt-get install python3 python3.12
apt-get download python3
py3tmp=$(ls /tmp/hplip/*.deb)
py3tmpb=$(ls /tmp/hplip/*.deb|sed -e 's/_amd/b_amd/g')
py3ver=$(ls /tmp/hplip/*.deb|sed -e 's/\/tmp\/hplip\/python3_//g'|sed -e 's/_amd64.deb//g')
py3verb=$(ls /tmp/hplip/*.deb|sed -e 's/\/tmp\/hplip\/python3_//g'|sed -e 's/_amd64.deb/b/g')
dpkg-deb -x $py3tmp /tmp/hptmp
dpkg-deb --control $py3tmp /tmp/hptmp/DEBIAN
sed -i -e 's/python3-profiler/python3 (= 3.12), python3-profiler/g' /tmp/hptmp/DEBIAN/control
sed -i -e 's/Version: '$py3ver'/Version: '$py3verb'/g' /tmp/hptmp/DEBIAN/control
dpkg-deb --root-owner-group -b /tmp/hptmp $py3tmpb
rm $py3tmp
sudo dpkg -i $py3tmpb
cd /tmp
rm -rf /tmp/hptmp /tmp/hplip

sudo apt-get install hplip hplip-data hplip-gui
grep -r '#!/usr/bin/python3' /usr/share/hplip /usr/lib/cups/backend 2>/dev/null|sed -e 's/:#!\/usr\/bin\/python3//g'|xargs -n1 sudo sed -i -e 's/\#\!\/usr\/bin\/python3/\#\!\/usr\/bin\/python3.12/g'
# grep -r '#!/usr/bin/python3' /usr/share/hplip /usr/lib/cups/backend 2>/dev/null|sed -e 's/:#!\/usr\/bin\/python3.12//g'|xargs -n1 sudo sed -i -e 's/\#\!\/usr\/bin\/python3.12/\#\!\/usr\/bin\/python3/g'
/usr/bin/hp-systray -x&
popd


Offline sidemmc

  • User
  • Posts: 27
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #33 on: 2025/01/28, 00:07:55 »
Nice! I have fun.

Offline finotti

  • User
  • Posts: 331
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #34 on: 2025/01/29, 11:00:35 »
A minor improvement to get rid of the version tracking in case
Python3 is getting an update (and don't forget to chmod 755 the
script before execution):

[snip]

How will this affect future updates?  Will the modified hplip be replaced by the new official version when it is released?  Do we need to remove anything later on or take any special actions in the future?

I've been trying to hold for an official fix, as it makes me worried to hack packages like this (since I am not familiar with how it all works), but it is taking so long...

Offline Teriarch

  • User
  • Posts: 168
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #35 on: 2025/01/29, 19:20:53 »
@finotti
 
> [...], as it makes me worried to hack packages like this

To the less experienced the script might look a little scary, but I assure you:
There is nothing to be scared of (That's what they mean, when they say: "Minimally invasive").

> How will this affect future updates?

It won't. If hplip get's an update, so be it. The patched files will be replaced by the new ones (which
hopefully will work this time) and that's it. And the package manager is not aware of the previous
changes, since we patched after the install.

If python3 gets an update before hplip does, hplip will be removed in the process. But you can run
the script again to allow for another life cycle of ancient hplip (as long as python3 remains compatible
with python3.12 nothing happens).

> Will the modified hplip be replaced by the new official version when it is released?

Yes it will. As soon as there is a new release available. Not a single trace will remain.

> Do we need to remove anything later on or take any special actions in the future?

No, we don't. As soon as new releases will be available the old ones will be replaced
and the twilight disappears.

Rest assured that the main concern is always the regular course of events.

Offline finotti

  • User
  • Posts: 331
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #36 on: 2025/01/29, 21:46:21 »
Thanks @Teriarch for the clarifications and reassurances.  (And, mostly, for the fix!)  I will try your script tomorrow morning.

Offline Teriarch

  • User
  • Posts: 168
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #37 on: 2025/01/29, 22:46:52 »
@finotti

Lest the script get the user executed,
for all the love of Betsy I would suggest you give it
one more try on the life shine-on iso image until
you feel more uncomfortable with it for the final go, ;-)
 

Offline finotti

  • User
  • Posts: 331
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #38 on: 2025/01/31, 16:16:32 »
@finotti

Lest the script get the user executed,
for all the love of Betsy I would suggest you give it
one more try on the life shine-on iso image until
you feel more uncomfortable with it for the final go, ;-)

FWIW: I ran the script yesterday, and so far, so good.  Thanks for your help!

Offline Teriarch

  • User
  • Posts: 168
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #39 on: 2025/01/31, 17:22:20 »
Perfect! You're welcome.

Offline Biram

  • Newbie
  • Posts: 4
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #40 on: 2025/01/31, 21:47:44 »
I’ve run into the same problem before with updates breaking stuff like printers or specific packages I rely on. I had to hold off on upgrading a few things myself to keep my printer working, which is an old HP LaserJet. It’s frustrating, but holding packages back has been a good workaround for now. Hopefully, they’ll fix the dependency issue soon, but I agree—definitely something to watch out for if you’re relying on hplip.


Offline Teriarch

  • User
  • Posts: 168
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #41 on: 2025/02/01, 15:26:46 »
@Biram

> , which is an old HP LaserJet.

I've got myself an old HP 2300 Laser Jet with almost 30k pages of output.
It's reliable as hell. These machines are indestructible. But nowadays they
don't build them like this anymore. Anyway, do you know about the advantage
of hplip over cups? My printer is running fine with cups. Is hplip worthwhile
considering?

Offline seasons

  • User
  • Posts: 299
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #42 on: 2025/02/06, 23:30:33 »
For those of you who removed hplip, a fixed version is available today.

Offline debsid

  • User
  • Posts: 37
Re: Python 3 upgrade forces removal of hplip & friends
« Reply #43 on: 2025/02/10, 10:25:05 »
Just FYI. I am one of those who let hplip go, as the printer on my system had stopped working with my Linux laptop. I installed the fixed hplip a couple of days ago, but have noticed that my HP LaserJet still does not print on my laptop.