Often system administrators need to add new printer or install printer to Ubuntu system. It is advisable to do this using GUI since it provides an easy to use, step by step wizard. But if your system does not have a GUI and you only have a terminal then you may need to install printer in Ubuntu through terminal. Here are the steps to do it.
How to Install Printer in Ubuntu Through Terminal
Here are the steps to install printer in Ubuntu using terminal. First, you need to find and install printer drivers for Ubuntu. They are also known as PPD files and are often installed in /usr/share/ppd location.
You can install printer drivers using the following command.
$ sudo apt install cups
Once it is installed, you can use lpadmin command to add new printer, with the following command.
lpadmin -p '{name}' -v 'socket://{ip}' -m '{make}{model}' -P '{path/to/the/printer.ppd}'
Here is an example
$ sudo lpadmin -p printername -E -v ipp://192.168.1.111/ipp/print -m everywhere
That’s it. In this short article, we have learnt how to install printer in ubuntu through terminal. However, it is advisable to add printer via GUI. In many cases, they are auto detected, requiring no setup.
Also read:
How to Unlock User Account in MySQL
How to Lock User Account in MySQL
How to Create Cartesian Product of Python Lists
How to Disable Triggers in PostgreSQL
Convert Text File to Excel Using Shell Script
Sreeram has more than 10 years of experience in web development, Python, Linux, SQL and database programming.