How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9?

Moderator: Forum moderators

Post Reply
keniv
Posts: 694
Joined: Mon Jul 13, 2020 2:18 pm
Location: Scotland
Has thanked: 124 times
Been thanked: 72 times

How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9?

Post by keniv »

I have one of the above mentioned printer/scanners. I am not so much interested in printing but I would like to be able to scan and for this reason I'm not sure if I need cups. I've downloaded two versions of the linux drivers for this machine via the HP site. These were supposed to be for debian but they do not end in .deb. They're named as follows, hplip-3.16.7.run and hplip-3.24.4.run. They look to be executable but I've not clicked on them. I've tried Menu>Graphics>Document Scanner but the scanner is not recognised. Can anybody tell me if one or other of the above drivers have to be installed and if so which one and how this is done. If I'm going along the wrong lines here can somebody point me in the right direction to get this working.

Regards,

Ken,

Last edited by Flash on Sun Feb 09, 2025 7:06 pm, edited 1 time in total.
Reason: Added question mark to a question
Geek3579
Posts: 299
Joined: Sat Jul 18, 2020 1:07 pm
Has thanked: 85 times
Been thanked: 77 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9

Post by Geek3579 »

I have the same model printer running in BookwormPup_10.0.3.

First, update apt ( sudo apt update )
Then Install the driver package: sudo apt-get install hplip (You might also try the package manager)
I think the Hplip version is a bit older, but it should be OK for an older printer.
Simple-scan (Document scanner) is already installed, as I recall Menu --> Graphic --> Document Scanner

You will then need to install the printer via cups, which should also be found here: Menu --> Setup --> CUPS Printer Wizard

keniv
Posts: 694
Joined: Mon Jul 13, 2020 2:18 pm
Location: Scotland
Has thanked: 124 times
Been thanked: 72 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9

Post by keniv »

Geek3579 wrote: Sun Feb 09, 2025 9:00 am

I have the same model printer running in BookwormPup_10.0.3.

First, update apt ( sudo apt update )
Then Install the driver package: sudo apt-get install hplip (You might also try the package manager)
I think the Hplip version is a bit older, but it should be OK for an older printer.
Simple-scan (Document scanner) is already installed, as I recall Menu --> Graphic --> Document Scanner

You will then need to install the printer via cups, which should also be found here: Menu --> Setup --> CUPS Printer Wizard

Thanks for the above which I'll try and report back.

Ken.

keniv
Posts: 694
Joined: Mon Jul 13, 2020 2:18 pm
Location: Scotland
Has thanked: 124 times
Been thanked: 72 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9

Post by keniv »

@Geek3579
I entered sudo apt update in a terminal and got an output telling me that 37 packages were upgradeable. I then tried sudo apt-get install hplip and got a message about broken packages. I then tried sudo apt upgrade. I got a message telling me that 37 packages had been held back. I was not surprised by this. I decided to try sudo apt-get install hplip again but this failed again. (not sure I really needed the "sudo" with the above commands). I decided to use synaptic and after reloading it I tried to install hplip but this failed in a similar way to apt. As a last resort I thought I would try the PPM and after updating it only got "no matching package name". Using pSearch I have found an .sfs for hplip dated April 2021 for Fossapup but the file is no longer available. I assume if an HP printer/scanner can be got to work in Bookworm 10.0.3 it should work in 10.0.9. If anybody can suggest anything else I could try or has got this working in Bookworm 10.0.9 or can tell me what I'm doing wrong I'd very much welcome their input.

Regards,

Ken.

radky
Posts: 377
Joined: Fri May 28, 2021 2:14 am
Has thanked: 42 times
Been thanked: 340 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9

Post by radky »

@keniv

BW64 point releases (currently 10.0.9) are generated at (approximately) 2-month intervals in sync with upstream Debian Bookworm point releases. Each BW64 point release contains the Debian binary updates that are current at that time.

BW64 10.0.9 was released 09 Dec 2024 and the upcoming 10.0.10 should be available in a couple of days in accordance with the 2-month release cycle. Although BW64 is not a rolling (continuously updated) distro, perhaps the 2-month release cycle provides advantages when compared to annual or biennial releases. Hopefully, the updated Debian packages of BW64 10.0.10 should address the package dependencies for your printer.

Thanks

keniv
Posts: 694
Joined: Mon Jul 13, 2020 2:18 pm
Location: Scotland
Has thanked: 124 times
Been thanked: 72 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9

Post by keniv »

@radky

Hopefully, the updated Debian packages of BW64 10.0.10 should address the package dependencies for your printer.

Thanks for your reply and explanation. I'll wait for 10.0.10 to arrive then try again with my printer.

Regards,

Ken.

User avatar
bigpup
Moderator
Posts: 7517
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 1022 times
Been thanked: 1682 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9?

Post by bigpup »

You could try this method.
viewtopic.php?t=2656

Be very slow and careful to do all that is needed.

Welcome to Linux software! :roll: :welcome:

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

keniv
Posts: 694
Joined: Mon Jul 13, 2020 2:18 pm
Location: Scotland
Has thanked: 124 times
Been thanked: 72 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9?

Post by keniv »

bigpup wrote: Mon Feb 10, 2025 12:45 pm

You could try this method.
viewtopic.php?t=2656

Be very slow and careful to do all that is needed.

Welcome to Linux software! :roll: :welcome:

Yeah, I found your post when I was searching the forum and I think that was the source of the downloads that I mentioned in my first post.

They're named as follows, hplip-3.16.7.run and hplip-3.24.4.run.

However, it was the fact that I selected Debian and expected .deb files but got .run files that looked executable that put me off. I did think of trying them and even got as far as making a new copy of my save folder in case I broke something but decided against it. The odd thing is that I'm fairly sure that I had this printer running on another older machine using an older pup though I don't remember which one. I don't remember it being too much hassle to set it up. I think the scanner worked using xsane. Can I ask if you tried one of these downloads and was the file executable when clicked on? I might try running the older version and see what happens.

Ken.

User avatar
bigpup
Moderator
Posts: 7517
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 1022 times
Been thanked: 1682 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9?

Post by bigpup »

run packages are a type of execute package.

You run them by entering the name of the run package in a terminal.

In BookwormPup64 you make the terminal entry: sh then the specific run package full name.

Example:
sh hplip-3.24.4.run

Use rox file manager
Open the terminal in the same location the run package is located.

--------------------------------------------------------------------------------------------------------------
I do not know why this should not be easy to do with apt or synaptic, but seems Debian repositories have issues.

--------------------------------------------------------------------------------------------------------------------------------------------------------

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

keniv
Posts: 694
Joined: Mon Jul 13, 2020 2:18 pm
Location: Scotland
Has thanked: 124 times
Been thanked: 72 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9?

Post by keniv »

@bigpup
Thanks for the information and the instructions which I have followed. I chose to use the older package as this is an oldish printer and I also thought that I might have les trouble with any dependences. Below is the output from the terminal.

Code: Select all

# sh hplip-3.16.7.run
Creating directory hplip-3.16.7
Verifying archive integrity... All good.
Uncompressing HPLIP 3.16.7 Self Extracting Archive...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
/mnt/mmcblk0p1/HPDrivers/hplip-3.16.7/base/utils.py:2039: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if weburl is "" or weburl is None:
warning: hplip-install should not be run as root.

HP Linux Imaging and Printing System (ver. 3.16.7)
HPLIP Installer ver. 5.1

Copyright (c) 2001-15 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Installer log saved in: hplip-install_Tue-11-Feb-2025_18:56:27.log

/mnt/mmcblk0p1/HPDrivers/hplip-3.16.7/installer/core_install.py:1899: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if home_dir is "":
Traceback (most recent call last):
  File "/mnt/mmcblk0p1/HPDrivers/hplip-3.16.7/./install.py", line 241, in <module>
    text_install.start(language, auto, test_depends, test_unknown, assume_network, max_retries, enable, disable)
  File "/mnt/mmcblk0p1/HPDrivers/hplip-3.16.7/installer/text_install.py", line 60, in start
    core =  CoreInstall(MODE_INSTALLER, INTERACTIVE_MODE)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/mmcblk0p1/HPDrivers/hplip-3.16.7/installer/core_install.py", line 225, in __init__
    self.passwordObj = password.Password(ui_mode)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/mmcblk0p1/HPDrivers/hplip-3.16.7/base/password.py", line 110, in __init__
    self.__readAuthType()  #self.__authType   
    ^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/mmcblk0p1/HPDrivers/hplip-3.16.7/base/password.py", line 133, in __readAuthType
    distro_name =  get_distro_name().lower()
                   ^^^^^^^^^^^^^^^^^
  File "/mnt/mmcblk0p1/HPDrivers/hplip-3.16.7/base/password.py", line 79, in get_distro_name
    os_name = platform.dist()[0]
              ^^^^^^^^^^^^^
AttributeError: module 'platform' has no attribute 'dist'
#

As you can see it has thrown up quite a lot of "errors". In particular this one warning: hplip-install should not be run as root. I'm not sure whether it's installed or not. As yet I haven’t had time to try it with the printer. Does this look like what I should expect?

Ken.

keniv
Posts: 694
Joined: Mon Jul 13, 2020 2:18 pm
Location: Scotland
Has thanked: 124 times
Been thanked: 72 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9?

Post by keniv »

I've now had time to try my printer. My printer was recognised however, I also seemed to have to select it again as I worked through the set up. So now in cups>printers I seem to have two printers (please see image below). The HP Deskjet 2540 series is my printer. I also have this HP DeskJet 1600CM Foomatic/Postscript (recommended) I do not know why I have this or how to remove it. As I said in my first post I'm not so much interested in printing but I would like to be able to scan documents. Using Graphics>Document Scanner my scanner wasn't detected. So all in all it hasn't been very successful. Any ideas as where I should go from here would be welcome.

Ken.

Attachments
Printers.png
Printers.png (67.59 KiB) Viewed 684 times
User avatar
bigpup
Moderator
Posts: 7517
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 1022 times
Been thanked: 1682 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9?

Post by bigpup »

hplip-install should not be run as root

Puppy gets that warning with about everything that was not specifically compiled for Puppy.

As long as the installer runs, it is no issue with Puppy Linux.

It just says you are running as root user.

Most all other Linux OS's are setup to run as a none root user.
Mainly so it takes changing to root user, to really be able to make internal operation settings, changes, etc......
They think not being root user makes it harder to mess stuff up.

Read this:
menu ->Help ->About root (administrator) and spot

Everything in Puppy is done with user as root user.

If something refuses to run as root.

We run it with run-as-spot command.

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
bigpup
Moderator
Posts: 7517
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 1022 times
Been thanked: 1682 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9?

Post by bigpup »

sorry, but I do not use printers with Puppy Linux.

Usually if you can get the correct driver installed, it setup with Cups, it works.

I think that HP DeskJet 1600CM Foomatic/Postscript (recommended) is telling you what driver is being used.

did you try to do a print test page?

Someone that knows more about this is going to need to help you.

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

keniv
Posts: 694
Joined: Mon Jul 13, 2020 2:18 pm
Location: Scotland
Has thanked: 124 times
Been thanked: 72 times

Re: How to install HP Deskjet 2540 All-in-One Printer/Scanner in Bookworm 10.0.9?

Post by keniv »

@bigpup

Everything in Puppy is done with user as root user.

If something refuses to run as root.

We run it with run-as-spot command.

Yes I did know about this and do run a browser as spot.

did you try to do a print test page?

No I didn’t as I don’t have a working printer cartridge. I don't need to do a lot of printing and for that reason cartridges seem to dry up before I use the contents. Last printing I did was in the local library. Four sides of A4 for 48p. My main interest for getting the printer scanner recognised was so as I could use the scanner however although the printer was recognise the scanner was not so I couldn’t test that. As I am in the process of moving over to Bookworm10.0.10 I deleted the 10.0.9 save folder in which I installed hplip-3.16.7 and replaced it with a backup. I may try again with 10.0.10 as was suggested in an earlier post. Thanks again for your help.

Ken.

Post Reply

Return to “BookwormPup”