Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3546

Raspberry Pi OS • Re: AirPrint in Trixie

$
0
0
Say what you want about it, but ChatGPT helped to solve where CUPS failed - it was not really Avahi related issue.
Problem was that CUPS web interfrace won't save "Share this printer" option, so here are the steps I took to make it work:

------------
IMPORTANT:
potentially manually changing "Shared" to "Yes" in /etc/cups/printers.conf can be enough - give it a try :)

If not - here's more:


1. Build avahi from source (https://github.com/avahi/avahi) and then set it up as mentioned here:

Code:

*** Quick install instructions (tested on Debian/Ubuntu only!) ***While "configure" and "make" may be run as normal user all other commandsneed to be run as root.Configure the build system:$ autoreconf -if$ ./configure \            --libdir="/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" \            --localstatedir=/var \            --prefix=/usr \            --runstatedir=/run \            --sysconfdir=/etcIt should be noted that it's suitable for testing purposes only.The script configuring the actual Debian package can be found athttps://salsa.debian.org/utopia-team/avahi/-/blob/debian/master/debian/rules?ref_type=heads.Among other things it also turns on the hardening flags described athttps://wiki.debian.org/Hardening.Build and install avahi:$ make# make install# ldconfigAdd a user and a group for avahi. (Debian specific)# addgroup --system avahi# adduser --system --no-create-home --ingroup avahi avahiAsk D-Bus to re-read its policies:# systemctl reload dbusNow start the Avahi daemon:# systemctl start avahi-daemonOptionally start the unicast DNS configuration daemon:# systemctl start avahi-dnsconfdTo start the two daemons at boot time on Debian based distributions:# systemctl enable avahi-daemon# systemctl enable avahi-dnsconfdIf you plan to use avahi-autoipd you have to create the user/group"avahi-autoipd" much the same way as "avahi".
2. Install printer-driver-splix (it installs CUPS and all required deps):

Code:

sudo apt install printer-driver-splix
and setup CUPS:

Code:

sudo usermod -a -G lpadmin (your user)sudo cupsctl --remote-anysudo /etc/init.d/cups restart3. Added my printer using [url]http://localhost:631[/url]4. [b]The root issue - let's make sure printer gets shared by using proper configs:[/b][code]sudo nano /etc/cups/printers.conf
and check that

Code:

Shared Yes
then

Code:

sudo nano /etc/cups/cupsd.conf
and use the following as a reference:

Code:

# /etc/cups/cupsd.conf — updated versionLogLevel warnPageLogFormatMaxLogSize 0ErrorPolicy retry-job# Listen for HTTP and IPP on port 631 (all interfaces)Port 631Listen /run/cups/cups.sockBrowsing YesBrowseLocalProtocols allDefaultShared YesDefaultAuthType BasicWebInterface YesIdleExitTimeout 60<Location />  Order allow,deny  Allow @LOCAL  Allow all</Location><Location /admin>  AuthType Default  Require user @SYSTEM  Order allow,deny  Allow @LOCAL</Location><Location /admin/conf>  AuthType Default  Require user @SYSTEM  Order allow,deny  Allow @LOCAL</Location><Location /admin/log>  AuthType Default  Require user @SYSTEM  Order allow,deny  Allow @LOCAL</Location><Policy default>  JobPrivateAccess default  JobPrivateValues default  SubscriptionPrivateAccess default  SubscriptionPrivateValues default  <Limit Create-Job Print-Job Print-URI Validate-Job>    Order deny,allow  </Limit>  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Current-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>    Require user @OWNER @SYSTEM    Order deny,allow  </Limit>  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>    AuthType Default    Require user @SYSTEM    Order deny,allow  </Limit>  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>    AuthType Default    Require user @SYSTEM    Order deny,allow  </Limit>  <Limit Cancel-Job CUPS-Authenticate-Job>    AuthType Default    Require user @OWNER @SYSTEM    Order deny,allow  </Limit>  <Limit All>    Order deny,allow  </Limit></Policy># End of file
after editing the file use this to check if the config has no errors:

Code:

sudo cupsd -t
finally

Code:

sudo systemctl daemon-reloadsudo systemctl restart cups.service

Statistics: Posted by in_sympathy — Fri Nov 14, 2025 4:14 pm



Viewing all articles
Browse latest Browse all 3546

Trending Articles