I found one bug report:
https://bugs.launchpad.net/ubuntu/+s...ps/+bug/997040
In a short: after a reboot do
and try to print.
If it was helpful, the module can be blacklisted in "/etc/modprobe.d/blacklist.conf".
There is a command to add a printer, instead of navigating through http://...:631 GUI:
Code:
lpinfo -m | grep "your printer model part or index or else" # Will show a PPD file name; like 'HP-LaserJet_1020.ppd.gz'
lpadmin -p test_prn -E -v "usb://HP/LaserJet%201020?serial=XXXXXXX" -m HP-LaserJet_1020.ppd.gz
I have a script for "printing hard reset". It allows me in a single click reset all this painful staff. But be aware: the script is highly Ubuntu and version centric, created with a pain printer HP LJ 1020 in mind, seems to be specific to my installed packages list. It should NOT be used until you understand in details every action to be performed by the script.
Code:
#!/bin/bash
#
# Copyright 2012 Al Stat at UbuntuForums.Org
#
# This file is part of PHR - Printing Hard Resetter.
#
# PHR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PHR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PHR. If not, see <http://www.gnu.org/licenses/>.
#
##
#
# This cript intended to assist in wars between Foo2Zjs and HP.
# It will reinstall CUPS and some drivers for ZjsStream painfull printers.
#
# It is DR - quick and dirty. It is bounded to concrete packages managment
# system - Apt, concrete OS - Ubuntu, and concrete painfull printer. You shoud
# NOT rely on it, if you in details do not understand actions to be perfomed
# by PHR.
#
# However, it is easy to adopt this script for your unique needs.
#
# This script may be launched as root by ordinary user, in case of proper
# sudoers policy. Pay attention - source code and firmware source must not
# accessible for a user. You must have third user account for compilation of
# the sources and a storage of firmware, or compile it as root. Build as root
# is highly NOT recommended. Use and substitude in corresponding places
# 'su -l ... -c ...'.
#
##
declare -ra ruinedCUPSPackagesNamesArray=(\
"cups" \
"cups-driver-gutenprint" \
"cups-pdf" \
"printer-driver-gutenprint" \
)
declare -ra ruinedFoo2ZjsPackagesNamesArray=(\
"foo2zjs" \
"hannah-foo2zjs" \
"printer-driver-foo2zjs" \
)
declare -ra dirsToBeErasedArray=(
"/usr/share/foo2zjs" \
"/usr/share/foo2qpdl/crd" \
"/lib/firmware/hp" \
"/usr/share/doc/foo2zjs" \
)
declare -r urlOfDrivers="http://foo2zjs.rkkda.com"
declare -r dirWorking="$( pwd )"
declare -r fileWithPackagedSourceREMOTE="${urlOfDrivers}/foo2zjs.tar.gz"
declare dirUnpackedSource=""
declare -r filePackageWithDriversLOCAL="${dirWorking}/foo2zjs.tar.gz"
declare -r firmwareId="1020"
declare -r fileWithPACKEDFirmwareShortName="sihp${firmwareId}.tar.gz"
#declare -r fileWithFirmware="sihp1020.img"
declare -r filesWithFirmwareNameTemplate="sihp${firmwareId}*"
declare -r fileExeFirmwareDownloaderShortName="getweb"
function requestUserAgreement {
local -r messageText="${@}"
local userFeedback=""
echo -ne "\n"
echo "${messageText}" "[Yes/no]"
read userFeedback
[ "${userFeedback,,}" == "yes" ] \
|| [ "${userFeedback,,}" == "y" ] \
&& return 0
echo "Got negative answer. Bailing out." >&2
exit ${?}
}
function downloadPackagedSource {
local -r objectDonor="${1}"
local -r fileAcceptor="${2}"
[ -f "${fileAcceptor}" ] \
&& reportThat "INFORMATION:${0}:${LINENO}: Will skip download as already have file named '${fileAcceptor}'." >&2 \
&& return 0
wget -O "${fileAcceptor}" "${objectDonor}" \
; isDoneWithError "${LINENO}"
return ${?}
}
function isDoneWithError {
local -r obtainedByLuckyStrikeErrorCode="${?}" # Must be the first line - the first strike.
#local -r obtainedErrorCode="${1}" # XXX - it is not evident, it is so in all possible realisations.
local -r thisInstanceCallLineNumber="${1}"
local -ri codeToBeSuccess=0
local lineNumberForOutput=""
lineNumberForOutput="${LINENO}"
[ -n "thisInstanceCallLineNumber" ] \
&& lineNumberForOutput="${thisInstanceCallLineNumber}"
[ "${obtainedByLuckyStrikeErrorCode}" == "${codeToBeSuccess}" ] \
&& return ${codeToBeSuccess}
echo "ERROR:${0}:${lineNumberForOutput}: Got feedback with error code '${obtainedByLuckyStrikeErrorCode}'. Bailing out." >&2
exit ${obtainedByLuckyStrikeErrorCode}
}
function reportThat {
local messageText="${1}"
#echo -ne "\n"
echo "${messageText}"
} >&2
function downloadFirmware {
local -r dirAcceptorAndCodeHolder="${1}"
local -r firmwareToBeObtainedId="${2}"
local -r downloaderExe="${dirAcceptorAndCodeHolder}/${fileExeFirmwareDownloaderShortName}"
local -r fileWithFirmwareNameTemplate="${dirAcceptorAndCodeHolder}/${filesWithFirmwareNameTemplate}"
local foundFile=""
[ -d "${dirAcceptorAndCodeHolder}" ] \
; isDoneWithError "${LINENO}"
[ -x "${downloaderExe}" ] \
; isDoneWithError "${LINENO}"
isAlreadyExist "${fileWithFirmwareNameTemplate}" \
&& echo "INFORMATION:${0}:${LINENO}: Will skip download as already have a file '${fileWithFirmwareNameTemplate}'." >&2 \
&& return 0
"${downloaderExe}" "${firmwareToBeObtainedId}" \
; isDoneWithError "${LINENO}"
return ${?}
}
function isAlreadyExist {
local -r targetNameTemplate="${1}"
local foundFile=""
foundFile="$( find "$( dirname "${fileWithFirmwareNameTemplate}" )" \
-name "$( basename "${fileWithFirmwareNameTemplate}" )" )"
[ -n "${foundFile}" ] \
&& return 0
return 1
}
function evaluateSubDirForUnpackedSource {
local packageWithFiles="${1}"
local firstFileNameInPackage=""
local sourceAcceptorDirectory=""
[ ! -f "${packageWithFiles}" ] \
&& isDoneWithError "${LINENO}"
shopt -s extglob
read firstFileNameInPackage <<< "$( tar tf "${packageWithFiles}" )"
sourceAcceptorDirectory="${firstFileNameInPackage/\/*/}"
echo "${sourceAcceptorDirectory}"
}
#
# #
# # #
# #
#
reportThat "INFORMATION:${0}:${LINENO}: Start. $( date ) See details at <${urlOfDrivers}>."
reportThat "INFORMATION:${0}:${LINENO}: Packages to be affected explicitly: ${ruinedCUPSPackagesNamesArray[*]}."
reportThat "INFORMATION:${0}:${LINENO}: Directories to be erased explicitly: ${dirsToBeErasedArray[*]}."
reportThat "INFORMATION:${0}:${LINENO}: You must have to be already installed development tools."
requestUserAgreement "Are you shure you want to continue?"
reportThat "INFORMATION:${0}:${LINENO}: Downloading Foo2Zjs driver. If not already have file '${filePackageWithDriversLOCAL}'."
downloadPackagedSource "${fileWithPackagedSourceREMOTE}" "${filePackageWithDriversLOCAL}" \
; isDoneWithError "${LINENO}"
requestUserAgreement "Packages and directories removing needs super user privileges. Are you shure you want to enter super user password later?"
sudo true \
; isDoneWithError "${LINENO}"
reportThat "INFORMATION:${0}:${LINENO}: Doing, in terms of apt-get, 'remove' and 'install' packages related to CUPS itself."
sudo apt-get remove "${ruinedCUPSPackagesNamesArray[@]}" \
; isDoneWithError "${LINENO}"
sudo apt-get install "${ruinedCUPSPackagesNamesArray[@]}" \
; isDoneWithError "${LINENO}"
reportThat "INFORMATION:${0}:${LINENO}: Doing, in terms of apt-get, 'purge' Foo2Zjs printer drivers."
sudo apt-get purge "${ruinedFoo2ZjsPackagesNamesArray[@]}" \
; isDoneWithError "${LINENO}"
sudo rm -rf "${dirsToBeErasedArray[@]}" \
; isDoneWithError "${LINENO}"
sudo -K
reportThat "INFORMATION:${0}:${LINENO}: Unpacking and compiling."
dirUnpackedSource="${dirWorking}/$( evaluateSubDirForUnpackedSource "${filePackageWithDriversLOCAL}" )"
mkdir -p "${dirUnpackedSource}" \
; isDoneWithError "${LINENO}"
# --directory "$( dirname "${dirUnpackedSource}" )"
tar zxf "${filePackageWithDriversLOCAL}" \
; isDoneWithError "${LINENO}"
pushd . >/dev/null
cd "${dirUnpackedSource}" \
; isDoneWithError "${LINENO}"
make \
; isDoneWithError "${LINENO}"
reportThat "INFORMATION:${0}:${LINENO}: Downloading firmware. If not already have in '${dirUnpackedSource}' file '${filesWithFirmwareNameTemplate}'."
downloadFirmware "${dirUnpackedSource}" "${firmwareId}" \
; isDoneWithError "${LINENO}"
requestUserAgreement "UNinstallation by 'make' job and subsecuent installation, both, needs super user access. Are you shure you want to enter super user password later?"
sudo true \
; isDoneWithError "${LINENO}"
reportThat "INFORMATION:${0}:${LINENO}: UNinstalling."
sudo make uninstall \
; isDoneWithError "${LINENO}"
reportThat "INFORMATION:${0}:${LINENO}: Installing."
sudo make install \
; isDoneWithError "${LINENO}"
requestUserAgreement "You do not need 'hotplug' for every printer model. You may read about 'hotplug' on <${urlOfDrivers}>. Or in file '${dirUnpackedSource}/INSTALL'. Install 'hotplug'?" \
&& sudo make install-hotplug \
|| isDoneWithError "${LINENO}"
reportThat "INFORMATION:${0}:${LINENO}: Manipulating with CUPS."
sudo make cups \
; isDoneWithError "${LINENO}"
sudo -K
popd >/dev/null
reportThat "INFORMATION:${0}:${LINENO}: Done. $( date )"
Bookmarks