How to install a network printer on your personal Linux - UNIX computer

The method of adding a printer will vary depending on your Linux distribution. The following example will be for reference only.

  • Server — printhost.math.ias.edu:631

  • Path — /printers/s0d (Click here for a list of our current network printers.)

If you need to download and install drivers, click on the appropriate link:

For HP printers, you will need HPLIP. If it is not installed on your system, you can install it with:

$ sudo yum install hplip ( for RedHat-based machines)

$ sudo apt-get install hplip ( for Debian-based machines)

Most modern UNIX's have fairly intelligent printing commands. You will probably not have to do any configuration to print to our print server. To print from your laptop, you will need to provide both a queue name and a print server name for lpr. To print the file filename.ps to the printer s0d you would type the following:

help@mymachine[1]: lpr -Ps0d@printhost filename.ps 

or

help@mymachine[2]: lpr -Ps0d@printhost.math.ias.edu filename.ps 

Typing this every time might become troublesome, so we should probably make s0d@printhost our default printer by setting the environment variable PRINTER. First check your SHELL setting with the following:

help@mymachine[3]: echo $SHELL /bin/csh 

Our shell is csh (or tcsh), we'll set the PRINTER variable with the following:

help@mymachine[4]: setenv PRINTER s0d@printhost.math.ias.edu  

We can now print to s0d@printhost.math.ias.edu by typing lpr. Now lets assume that we are using bash (or sh), we can set our PRINTER variable with slightly different syntax:

help@mymachine[5]: echo $SHELL /bin/bash help@mymachine[6]: PRINTER=s0d@printhost.math.ias.edu  help@mymachine[7]: export PRINTER 

or

help@mymachine[8]: export PRINTER=s0d@printhost.math.ias.edu