Error in install of converted deb print driver from Brother?

I’m trying to install a printer driver converted from a deb package for a Brother printer. I have posted a couple times concerning the general issue already but this time I’m trying to install the converted deb driver. The more test prints I look at the more it looks like the drivers do affect the quality in certain places.

Being unfamiliar with the language of an INSTALL file, it looks like the closing if statement of the post_install {…} is odd; but I don’t know for sure. The steps and output are provided below. Thank you for any direction you may be abe to provide.

Steps taken after downloading deb driver mfcl9610cdnpdrv-3.5.0-1.i386.deb:

  1. Installed debtap.
  2. sudo debtap -u
  3. debtap -s mfcl9610cdnpdrv-3.5.0-1.i386.deb
debtap -s mfcl9610cdnpdrv-3.5.0-1.i386.deb                                                                                                                                            
==> Extracting package data...
==> Fixing possible directories structure differencies...
==> Generating .PKGINFO file...

:: Enter Packager name (can be left blank):

:: Enter package license (can be left blank, you can enter multiple licenses comma separated):

*** Creation of .PKGINFO file in progress. It may take a few minutes, please wait...

==> Checking and generating .INSTALL file (if necessary)...

:: If you want to edit .PKGINFO and .INSTALL files (in this order), press (1) For vi (2) For nano (3) For default editor (4) For a custom editor or any other key to continue: 

==> Generating .MTREE file...

==> Creating final package...
==> Package successfully created!
==> Removing leftover files...

This generated a mfcl9610cdnpdrv-3.5.0-1-x86_64.pkg.tar.zst file and 4.

sudo pacman -U mfcl9610cdnpdrv-3.5.0-1-x86_64.pkg.tar.zst                                                                                                                               
[sudo] password for gary: 
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) mfcl9610cdnpdrv-3.5.0-1

Total Installed Size:  0.32 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                                                                                                 [############################################################################] 100%
(1/1) checking package integrity                                                                                               [############################################################################] 100%
(1/1) loading package files                                                                                                    [############################################################################] 100%
(1/1) checking for file conflicts                                                                                              [############################################################################] 100%
(1/1) checking available disk space                                                                                            [############################################################################] 100%
:: Processing package changes...
(1/1) installing mfcl9610cdnpdrv                                                                                               [############################################################################] 100%
/tmp/alpm_Vdd4CJ/.INSTALL: line 15: syntax error near unexpected token `}'
/tmp/alpm_Vdd4CJ/.INSTALL: line 15: `}'
/usr/bin/bash: line 1: post_install: command not found
error: command failed to execute correctly
:: Running post-transaction hooks...
(1/1) Refreshing PackageKit...

Then 5. to locate the error line …

debtap -s -P mfcl9610cdnpdrv-3.5.0-1.i386.deb                                                                                                                                    ✔  20s  
==> Extracting package data...
==> Fixing possible directories structure differencies...
==> Generating .PKGINFO file...

:: Enter Packager name (can be left blank):


:: Enter package license (can be left blank, you can enter multiple licenses comma separated):


*** Creation of .PKGINFO file in progress. It may take a few minutes, please wait...

==> Checking and generating .INSTALL file (if necessary)...

:: If you want to edit .PKGINFO and .INSTALL files (in this order), press (1) For vi (2) For nano (3) For default editor (4) For a custom editor or any other key to continue: 


==> Generating .MTREE file...

==> Generating PKGBUILD file...
==> PKGBUILD and mfcl9610cdnpdrv.install are now located in "/home/gary/Downloads/mfcl9610cdnpdrv" and ready to be edited
==> Removing leftover files...

The INSTALL is

post_install() {
	# ESP Package Manager v4.1
	if [ "$( uname -m | grep -i -e 'x86_64' -e 'amd64 ')" != '' ]; then
	ln -s /opt/brother/Printers/mfcl9610cdn/lpd/x86_64/brmfcl9610cdnfilter           /opt/brother/Printers/mfcl9610cdn/lpd/brmfcl9610cdnfilter
	ln -s /opt/brother/Printers/mfcl9610cdn/lpd/x86_64/brprintconf_mfcl9610cdn       /opt/brother/Printers/mfcl9610cdn/lpd/brprintconf_mfcl9610cdn
	else
	ln -s /opt/brother/Printers/mfcl9610cdn/lpd/i686/brmfcl9610cdnfilter           /opt/brother/Printers/mfcl9610cdn/lpd/brmfcl9610cdnfilter
	ln -s /opt/brother/Printers/mfcl9610cdn/lpd/i686/brprintconf_mfcl9610cdn       /opt/brother/Printers/mfcl9610cdn/lpd/brprintconf_mfcl9610cdn
	fi

	/opt/brother/Printers/mfcl9610cdn/inf/setupPrintcapij mfcl9610cdn -i  
	/opt/brother/Printers/mfcl9610cdn/cupswrapper/cupswrappermfcl9610cdn
	chmod 755 /opt/brother/Printers/mfcl9610cdn/cupswrapper
	if [ "$(which semanage 2> /dev/null)" != '' ];then
}

post_upgrade() {
	post_install
}

pre_remove() {
	# ESP Package Manager v4.1
	/opt/brother/Printers/mfcl9610cdn/cupswrapper/cupswrappermfcl9610cdn -e
	/opt/brother/Printers/mfcl9610cdn/inf/setupPrintcapij mfcl9610cdn -e
	unlink /opt/brother/Printers/mfcl9610cdn/lpd/brmfcl9610cdnfilter
	unlink /opt/brother/Printers/mfcl9610cdn/lpd/brprintconf_mfcl9610cdn
	unlink /usr/bin/brprintconf_mfcl9610cdn
}

post_remove() {
	# ESP Package Manager v4.1
	rm -f /tmp/mfcl9610cdn_latest_print_info
	if [ "$(which semanage 2> /dev/null)" != '' ];then
}

Line 15 is the closing } of the post_install. I don’t know what language this is but the "if […]; then " of line 14 doesn’t look like any I’ve seen in C, Tcl, JS, … but looks incomplete.

Is it an error and does anyone know what should be done to correct it?

Thank you.

:wink:

❯ shellcheck INSTALL

In INSTALL line 14:
	if [ "$(which semanage 2> /dev/null)" != '' ];then
        ^-- SC1009 (info): The mentioned syntax error was in this if expression.
                                                      ^-- SC1073 (error): Couldn't parse this then clause. Fix to allow more checks.


In INSTALL line 15:
}
 ^-- SC1072 (error): Unexpected keyword/token. Fix any mentioned problems and try again.

For more information:
  https://www.shellcheck.net/wiki/SC1072 -- Unexpected keyword/token. Fix any...
  https://www.shellcheck.net/wiki/SC1073 -- Couldn't parse this then clause. ...
  https://www.shellcheck.net/wiki/SC1009 -- The mentioned syntax error was in...
1 Like

Just install cups-browsed

1 Like

Thanks. I’m not sure but it appears that perhaps the if needs and ending fi and something between that and the then. Never messed with a bash script before, or used makepkg. It took a bit of messing with the PKGBUILD, also, to add a url (the sha sum was already there), a license, and to fix the path to the license of the driver.

It appears to have completed successfully …

==> Making package: mfcl9610cdnpdrv 3.5.0-1 (Thu 26 Sep 2024 12:16:38 AM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found mfcl9610cdnpdrv-3.5.0-1.i386.deb
==> Validating source files with sha512sums...
    mfcl9610cdnpdrv-3.5.0-1.i386.deb ... Passed
==> Extracting sources...
  -> Extracting mfcl9610cdnpdrv-3.5.0-1.i386.deb with bsdtar
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing empty directories...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "mfcl9610cdnpdrv"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: mfcl9610cdnpdrv 3.5.0-1 (Thu 26 Sep 2024 12:16:40 AM EDT)

and then tried to install that new package

sudo pacman -U mfcl9610cdnpdrv-3.5.0-1-x86_64.pkg.tar.zst                                                                                                            ✔   
loading packages...
warning: mfcl9610cdnpdrv-3.5.0-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) mfcl9610cdnpdrv-3.5.0-1

Total Installed Size:  0.35 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                                                                                                 [############################################################################] 100%
(1/1) checking package integrity                                                                                               [############################################################################] 100%
(1/1) loading package files                                                                                                    [############################################################################] 100%
(1/1) checking for file conflicts                                                                                              [############################################################################] 100%
(1/1) checking available disk space                                                                                            [############################################################################] 100%
:: Running pre-transaction hooks...
(1/1) Creating Timeshift snapshot before upgrade...
==> skipping timeshift-autosnap due skipRsyncAutosnap in /etc/timeshift-autosnap.conf set to TRUE.
:: Processing package changes...
(1/1) reinstalling mfcl9610cdnpdrv                                                                                             [############################################################################] 100%
ln: failed to create symbolic link '/opt/brother/Printers/mfcl9610cdn/lpd/brmfcl9610cdnfilter': File exists
ln: failed to create symbolic link '/opt/brother/Printers/mfcl9610cdn/lpd/brprintconf_mfcl9610cdn': File exists
mkdir: cannot create directory ‘/var/spool/lpd/mfcl9610cdn’: No such file or directory
chown: invalid user: ‘lp’
chgrp: cannot access '/var/spool/lpd/mfcl9610cdn': No such file or directory
chmod: cannot access '/var/spool/lpd/mfcl9610cdn': No such file or directory
lpadmin -p MFCL9610CDN -E -v dnssd://Brother%20MFC-L9610CDN%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-b42200d4cdeb -P /usr/share/cups/model/Brother/brother_mfcl9610cdn_printer_en.ppd
lpadmin: Printer drivers are deprecated and will stop working in a future version of CUPS.
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Refreshing PackageKit...

for which there are some messages that may or may not be errors; not completely sure about that.

Now, in CUPS I can see the driver and when add the printer with this driver, there are several more default options.

Now, hopefully this will improve the print quality.

Thanks again.

EDIT:

Although it was a bit interesting, for the intended purpose it was mostly another waste of time.

The deb driver provides options that better match the printer–those that can be accessed from the printer itself and which do not appear in the driverless IPP Everywhere–but IPP Everywhere seems to generate crisper text; at least black text.

There is also a driverless 2.0.0 something that appears for this printer and it prints about the same as the deb driver.

A question concerning the note at the end of the installing of the converted deb driver that reads “lpadmin: Printer drivers are deprecated and will stop working in a future version of CUPS.”–Will these ever provide default options specific to each printer and, if not, will the selections set in the printer itself be over-riden by whatever options may be selected in the print job itself?

Thank you.

Just install cups-browsed

Thanks. I did this but I do not see that it made any difference. I made sure to start the service also. There do not appear to be any other drivers in the list provided in CUPS that there were before installing it.

What was to be gained by this? Did I miss it? Is it supposed to be a driver or the equivalent of the deb driver from Brother?

I installed Kubuntu on a laptop yesterday to test the deb driver (unconverted) on a debian machine; and, after installing Manjaro back on it today, I cannot get the IPP Everywhere option to appear again. It’s an old machine but I don’t see why that would make a difference.

Perhaps, installing cups-browsed will “make it appear” again.

Your printer should work with Print Anywhere, see this link for details Adding cups-browsed to all Manjaro ISO

A long as your printer is on your network, it should detect and install the printer every time you start to computer.

Just for testing, download my DeLinuxCo ISO it will boott into Live mode automatically like Manjaro Cinnamon and will detect any printers on your network, as long as your connected to your network. If it detects the printers, it’s a configuration issue on your pc, if it does not, read this thread

https://forum.manjaro.org/t/adding-brother-dcp7065dn-as-a-network-printer-in-home/167180

You should really only need cups cups-filters and gutenprint for most printers.
(gutenprint will provide a bunch of extra drivers for various models)
Additionally print-manager for KDE if you want a fancy KCM for management.
(as shown below)
I just checked and at least the ‘9600’ series is supported.

Imgur

PS.

I often find one of the easiest methods is to just ascertain the printer IP and add that. Many printers will show this to you somehow on the printer interface, or by printing a page, or you can scrape it one way or another from your network.
Anyways, once you have that its simple to just add

ipp://192.168.68.101/ipp/print

Or similar.

Brother printers usually use these standard ports,

ipp://192.168.1.2/BINARY_P1

ksnip_20240930-071508

If you still can’t get the printer to install, you can always try cupsbrowsed, I know there is a big security flaw right now, but that only applies to systems that are directly on the public internet. If you are behind a router, the exploit cannot work.

Quick comment regarding one comical side effect of cups-browed: this is installed by default on Mint Cinnamon. Whenever my mother is visiting (Wifi…), my Mint machine auto adds all 243523 printers she has flying around on her Macbook that are all auto shared :crazy_face:

2 Likes

It can inside the same network.
As the poster above shows. :wink:

Well yes, but the average individual on their home network, cannot be attacked by someone from the internet. Grandma, down the hall, now she might be a legit threat.