[SOLVED] Best Way to Install HPLIP (HP Linux Imaging and Printing)
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I think there's some misunderstanding. I already built the most recent HPLIP and made a Slackware package out of it. Download it, install it and use it. Nothing more to do. Check out the links in my post above.
Yes, I definitely will try your hplip package. Thanks again for taking the time to build that.
I was just commenting on posting #12 to bassmadrigal. I just don't understand what is being conveyed with that post. That's all.
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 919
Rep:
Quote:
Originally Posted by bassmadrigal
What he meant is you can take the slackbuild that Pat has provided for Slackware and modify the version in it so it matches the one you need.
Hello bassmadrigal, that's it
The hplip Slackbuild is 'version free' since the version isn't hard coded.
I don't apply those patches and don't change the configure options, but my
printer is old. For a new one I think kikinovak's package is better solution.
Quote:
Originally Posted by kikinovak
There have been quite many obstacles recently, like a complete change of staff at my editor's and a suggested change to an Ubuntu base, but now the book is holding a steady course.
I can spare you the hassle of building it from source. According to Murphy's Law, I often have to deal with very recent HP printers supported by HPLIP, but a more recent version than the one shipping with Slackware. This just happened a couple weeks ago, and I had to upgrade HPLIP to the next minor version bump.
After reading your post, I decided to build the latest HPLIP and put it in my MLED repo.
32-bit:
Code:
Wed Oct 22 15:55:08 CEST 2014
ap/hplip-3.14.10-i486-1_microlinux.txz: Upgraded.
Following a request by user tb75252 on LQ.
+--------------------------+
64-bit:
Code:
Wed Oct 22 15:55:08 CEST 2014
ap/hplip-3.14.10-x86_64-1_microlinux.txz: Upgraded.
Following a request by user tb75252 on LQ.
+--------------------------+
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 919
Rep:
Run 'hp-setup' as root in a terminal, it will open the hplip setup window.
Another way is setup with CUPS http://localhost:631/
Sometimes I have another problem, the printer is disabled by some reason.
To re-enable you can run 'cupsenable <printer name>' as root (printer name you
get with 'lpstat -p'), or in the HP Device Manager-Printer Control tab,
there's is a button to stop or start the printer.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Not to be contentious but this is the way I install or update HPLIP (and, with Slackware, you already have HPLIP installed by default with a full install). The current version of HPLIP in Slackware is 3.13.10; the current version of HPLIP at HP's website is 3.14.10 -- all the below is for upgrading from 3.13.10 to 3.14.10 and is 64-bit. If you're using 32-bit, it doesn't matter because the SlackBuild determines that automatically; the source tarball will compile on either 32-bit or 64-bit.
You need to do this stuff as root -- I prefer su -, you may prefer sudo.
Note: if you go to http://hplipopensource.com/hplip-web/gethplip.html, the HPLIP page at the HP website, you want to click the link near the bottom of the page that says "Advanced users may wish to download the HPLIP tar package." and click the link, that will send you to the SourceForge page and you'll get the tarball automatically.
In the hplip directory, execute hplip.SlackBuild.
Code:
sh ./hplip.SlackBuild
Wait a while (maybe two-three minutes).
When that finishes, you'll have /tmp/hplip-3.14.10-x86_64-1.txz. That's your installable package.
Code:
upgradepkg /tmp/hplip-3.14.10-x86_64-1.txz
<wait a while>
mv /tmp/upgradepkg /tmp/hplip-3.14.10-x86_64-1.txz .
You move the package to the hplip directory so you've got it where you might need it.
That's it.
Make sure you've got CUPS started
Code:
chmod 755 /etc/rc.d/rc.cups
/etc/rc.d/rc.cups stop (just in case)
/etc/rc.d/rc.cups start
Exit from su - or sudo; you need to be "you" for the following.
Then execute'
Code:
hp-setup
You will be prompted for the administrative password (that would be the root password).
HPLIP does all the set up in CUPS for you with one exception: it does not set the printer as the system default and you may want to do that (if it's your "main" or only printer).
Open a browser and go to http://localhost:631 (that's the CUPS administrative page).
Click the Printers tab and click the printer name that you want to make the system default. Then click the Administration tab and click Set as Server Default in the drop-down.
What that does is let you lp filename and get it printed without any fuss or bother.
One nice thing about HPILIP: I had my lap top 200 miles from home and needed to print something. My daughter had an HP portable printer, little thing, that I connected to the lap top with a USB cable. Darned if HPLIP didn't configure the thing automagically all by itself -- added it to CUPS no fuss, no muss, no bother. I was impressed.
NOTE: The following is just to add to your information if you're interested. It'll give you a bit more in-depth view of how packages are built in slackware. I'm not sure of your current level of understanding, so if I dumb something down too much, don't take offense
Quote:
Originally Posted by tb75252
I don't understand Niki's remark about using only the first of the two patches, though... What patches?? :-)
That was in reference to the link that Paulo2 posted initially. I'll back up a bit.
Everything in Slackware's main tree is compiled using slackbuild scripts. This allows you to just run a single script which will take tarball of source code, unpack it, add any patches needed, run configure, make, make install, and install it into a temporary directory. From this directory, you're able to use the makepkg command, which will generate a slackware package that you can install using the normal package management tools in slackware (installpkg, upgradepkg, removepkg).
If a version of software that you need, like hplip, is included with Slackware, but you need a newer version, you can usually take that newer source code (downloaded from the developer's website) along with the other files that Pat includes in the source directory (this would include the slackbuild itself, a slack-desc file (which provides the text used to describe the package to you during the install), any patches needed, and possibly doinst.sh, which is a post install script.
If you take all those files, along with the new source tarball, you can usually run the slackbuild, and you will eventually have an updated package waiting for you to install.
Sometimes, like with hplip here, patches may not be needed any more (or new patches might be needed), but this isn't too common. A good chunk of slackbuilds don't need anything additional.
To better show you, let's use a different example of a program, gimp.
This link is to the source tree of Slackware, specifically for gimp. If you look in there, you'll see 3 files: gimp-2.8.10.tar.xz | gimp.SlackBuild | slack-desc
gimp-2.8.10.tar.xz - This is the actual source code tarball. This contains all the lines of code that will eventually make the program. You could download this, run tar -xvf gimp-2.8.10.tar.xz and it will uncompress the tarball into a folder, where you'd be able to go in and manually compile your program. Luckily, because of gimp.Slackbuild, you won't have to do this.
gimp.SlackBuild - This is a shell script, and it will do everything you need, automagically, to provide you with a gimp-2.8.10-x86_64-1.txz file that you can then use upgradepkg/installpkg to upgrade/install the program to Slackware. If you're familiar with compiling, you can look in there and see some common things, including the ./configure with various configuration options, make, and make install. (I was mistaken before, and Paulo2 corrected me -- the slackbuild will automatically get the file version, so that wouldn't need to be edited with official Slackware slackbuilds)
slack-desc - This contains the description of gimp, which is displayed to you when you install/upgrade this program (this is the same thing that would come up on the screen of each package you installed when you initially installed Slackware.
Now, if you wanted to update gimp to a newer version, say 2.8.14 (the latest stable release right now), you would just download the gimp.Slackbuild and the slack-desc files and put them in the same folder as the gimp-2.8.14 tarball you downloaded from http://www.gimp.org, then you'd just run gimp.Slackbuild as root, and after some time (depending on the complexity of the program), if everything goes right, you'll have a new gimp-2.8.14-x86_64-1.txz file in /tmp. You would just issue upgradepkg /tmp/gimp-2.8.14-x86_64-1.txz and it would uninstall your old version and install the newer one.
Some programs, like hplip, require patches to properly compile. Sometimes these patches are only needed for specific versions. So in the case of hplip, 3.13.10, that comes with Slackware 14.1, requires 2 patches (both of which are included in the source directory for hplip in the slackware tree. As Niki mentioned, with version 3.14.10, the first patch is only one needed for the 3.14.x series of hplip. Sometimes this is just a trial and error process to figure it out. Luckily, with this one, you had niki who could provide you with an updated package. But if you run into other programs that need updates, hopefully this information I provided can give you some insight on how to do this yourself if needed.
NOTE: The following is just to add to your information if you're interested. It'll give you a bit more in-depth view of how packages are built in slackware. I'm not sure of your current level of understanding, so if I dumb something down too much, don't take offense
That was in reference to the link that Paulo2 posted initially. I'll back up a bit.
Everything in Slackware's main tree is compiled using slackbuild scripts. This allows you to just run a single script which will take tarball of source code, unpack it, add any patches needed, run configure, make, make install, and install it into a temporary directory. From this directory, you're able to use the makepkg command, which will generate a slackware package that you can install using the normal package management tools in slackware (installpkg, upgradepkg, removepkg).
If a version of software that you need, like hplip, is included with Slackware, but you need a newer version, you can usually take that newer source code (downloaded from the developer's website) along with the other files that Pat includes in the source directory (this would include the slackbuild itself, a slack-desc file (which provides the text used to describe the package to you during the install), any patches needed, and possibly doinst.sh, which is a post install script.
If you take all those files, along with the new source tarball, you can usually run the slackbuild, and you will eventually have an updated package waiting for you to install.
Sometimes, like with hplip here, patches may not be needed any more (or new patches might be needed), but this isn't too common. A good chunk of slackbuilds don't need anything additional.
To better show you, let's use a different example of a program, gimp.
This link is to the source tree of Slackware, specifically for gimp. If you look in there, you'll see 3 files: gimp-2.8.10.tar.xz | gimp.SlackBuild | slack-desc
gimp-2.8.10.tar.xz - This is the actual source code tarball. This contains all the lines of code that will eventually make the program. You could download this, run tar -xvf gimp-2.8.10.tar.xz and it will uncompress the tarball into a folder, where you'd be able to go in and manually compile your program. Luckily, because of gimp.Slackbuild, you won't have to do this.
gimp.SlackBuild - This is a shell script, and it will do everything you need, automagically, to provide you with a gimp-2.8.10-x86_64-1.txz file that you can then use upgradepkg/installpkg to upgrade/install the program to Slackware. If you're familiar with compiling, you can look in there and see some common things, including the ./configure with various configuration options, make, and make install. (I was mistaken before, and Paulo2 corrected me -- the slackbuild will automatically get the file version, so that wouldn't need to be edited with official Slackware slackbuilds)
slack-desc - This contains the description of gimp, which is displayed to you when you install/upgrade this program (this is the same thing that would come up on the screen of each package you installed when you initially installed Slackware.
Now, if you wanted to update gimp to a newer version, say 2.8.14 (the latest stable release right now), you would just download the gimp.Slackbuild and the slack-desc files and put them in the same folder as the gimp-2.8.14 tarball you downloaded from http://www.gimp.org, then you'd just run gimp.Slackbuild as root, and after some time (depending on the complexity of the program), if everything goes right, you'll have a new gimp-2.8.14-x86_64-1.txz file in /tmp. You would just issue upgradepkg /tmp/gimp-2.8.14-x86_64-1.txz and it would uninstall your old version and install the newer one.
Some programs, like hplip, require patches to properly compile. Sometimes these patches are only needed for specific versions. So in the case of hplip, 3.13.10, that comes with Slackware 14.1, requires 2 patches (both of which are included in the source directory for hplip in the slackware tree. As Niki mentioned, with version 3.14.10, the first patch is only one needed for the 3.14.x series of hplip. Sometimes this is just a trial and error process to figure it out. Luckily, with this one, you had niki who could provide you with an updated package. But if you run into other programs that need updates, hopefully this information I provided can give you some insight on how to do this yourself if needed.
Thank you very much for the exhaustive explanation. I really appreciate it.
Not to be contentious but this is the way I install or update HPLIP (and, with Slackware, you already have HPLIP installed by default with a full install). The current version of HPLIP in Slackware is 3.13.10; the current version of HPLIP at HP's website is 3.14.10 -- all the below is for upgrading from 3.13.10 to 3.14.10 and is 64-bit. If you're using 32-bit, it doesn't matter because the SlackBuild determines that automatically; the source tarball will compile on either 32-bit or 64-bit.
You need to do this stuff as root -- I prefer su -, you may prefer sudo.
Note: if you go to http://hplipopensource.com/hplip-web/gethplip.html, the HPLIP page at the HP website, you want to click the link near the bottom of the page that says "Advanced users may wish to download the HPLIP tar package." and click the link, that will send you to the SourceForge page and you'll get the tarball automatically.
In the hplip directory, execute hplip.SlackBuild.
Code:
sh ./hplip.SlackBuild
Wait a while (maybe two-three minutes).
When that finishes, you'll have /tmp/hplip-3.14.10-x86_64-1.txz. That's your installable package.
Code:
upgradepkg /tmp/hplip-3.14.10-x86_64-1.txz
<wait a while>
mv /tmp/upgradepkg /tmp/hplip-3.14.10-x86_64-1.txz .
You move the package to the hplip directory so you've got it where you might need it.
That's it.
Make sure you've got CUPS started
Code:
chmod 755 /etc/rc.d/rc.cups
/etc/rc.d/rc.cups stop (just in case)
/etc/rc.d/rc.cups start
Exit from su - or sudo; you need to be "you" for the following.
Then execute'
Code:
hp-setup
You will be prompted for the administrative password (that would be the root password).
HPLIP does all the set up in CUPS for you with one exception: it does not set the printer as the system default and you may want to do that (if it's your "main" or only printer).
Open a browser and go to http://localhost:631 (that's the CUPS administrative page).
Click the Printers tab and click the printer name that you want to make the system default. Then click the Administration tab and click Set as Server Default in the drop-down.
What that does is let you lp filename and get it printed without any fuss or bother.
One nice thing about HPILIP: I had my lap top 200 miles from home and needed to print something. My daughter had an HP portable printer, little thing, that I connected to the lap top with a USB cable. Darned if HPLIP didn't configure the thing automagically all by itself -- added it to CUPS no fuss, no muss, no bother. I was impressed.
Hope this helps some.
Thank you very much for your suggestion.
I tried kikinovak's suggestions (see messages #3 and #20) but I kept getting the error described in my message #18.
I then tried your suggestion and was able to install HPLIP 3.14.10 and set up the printer. The only thing that did not work was this part:
Quote:
hp-setup
as I kept on getting an error towards the end of the printer setup process. I ended up rebooting and was able to complete the set up process without further problems.
Now I have a question with hplip and slackpkg. For that I will open a new thread.
I ended up rebooting and was able to complete the set up process without further problems.
Just a reminder ...
It looks like your problem/question has been solved/answered. If so please use the Thread Tools at the top of the LQ page to mark this thread as solved.
It looks like your problem/question has been solved/answered. If so please use the Thread Tools at the top of the LQ page to mark this thread as solved.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.