How do I remove hundreds of automatically added network printers?Why is it necessary to add locally attached printers?How to re-share a printer (adding extra queue?)Lack of printer driversall network printers are automatically listedlubuntu 16.04 add network printercannot stop network printers are being automatically addedprinting using a HP Deskjet 1000 j110a connected via USB to a Starbridge 1531 Router using Ubuntu 16.04Canon Printer “Does not accept Jobs” on Ubuntu 18.04Can't Detect HP Printer with HPLIPDoubled Printers in Settings/Devices/Printers
Are there any important biographies of nobodies?
How to hide an urban landmark?
Generate basis elements of the Steenrod algebra
Pre-1972 sci-fi short story or novel: alien(?) tunnel where people try new moves and get destroyed if they're not the correct ones
How to tell your grandparent to not come to fetch you with their car?
How can I end combat quickly when the outcome is inevitable?
Mathematically, why does mass matrix / load vector lumping work?
Using "subway" as name for London Underground?
How to manually rewind film?
Were Alexander the Great and Hephaestion lovers?
Soft question: Examples where lack of mathematical rigour cause security breaches?
How to produce milk that's similar to blood?
Is it legal for a bar bouncer to confiscate a fake ID
Cascading Switches. Will it affect performance?
Is a lack of character descriptions a problem?
1980s live-action movie where individually-coloured nations on clouds fight
Which languages would be most useful in Europe at the end of the 19th century?
Applying Graph Theory to Linear Algebra (not the other way around)
How come the nude protesters were not arrested?
What makes Ada the language of choice for the ISS's safety-critical systems?
How to communicate to my GM that not being allowed to use stealth isn't fun for me?
Fixing obscure 8080 emulator bug?
Arriving at the same result with the opposite hypotheses
You have (3^2 + 2^3 + 2^2) Guesses Left. Figure out the Last one
How do I remove hundreds of automatically added network printers?
Why is it necessary to add locally attached printers?How to re-share a printer (adding extra queue?)Lack of printer driversall network printers are automatically listedlubuntu 16.04 add network printercannot stop network printers are being automatically addedprinting using a HP Deskjet 1000 j110a connected via USB to a Starbridge 1531 Router using Ubuntu 16.04Canon Printer “Does not accept Jobs” on Ubuntu 18.04Can't Detect HP Printer with HPLIPDoubled Printers in Settings/Devices/Printers
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
It is very difficult for me to perform printing, because the printer dialogue is full of hundreds of automatically added printers, so I can't find the one I want to use, see screenshot below.

The printers stem from my work network, where apparently lots of people (including students, I guess) are "sharing" their home printers, which my laptop then picks up automatically. (coincidentally I sometimes disable the avahi-daemon at work, simply because it is using a large amount of CPU).
When I go to http://localhost:631/printers/, it says there are 131 printers, and they are all of Make and Model 'Local Raw Printer'. With two exceptions: 1 is a network printer at work that I manually configured. Another is a network printer at my parents', which was also automatically added and which I am on the same network as right now. But the rest are just garbage that I would really like to avoid. Tips on how to do that would be appreciated.
I will not be going back to my work place for a bit of time though, so for now, I would just like these printers (that would be the 129/130 automatically added printers) to be removed. Is there a way to do that? I guess I could do it by clicking through in the cups web interface, but for 129 printers, that is a bit much. So I am looking for a single command or tips on how to achieve it with a script of sorts.
networking printing avahi
New contributor
jonaslb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
It is very difficult for me to perform printing, because the printer dialogue is full of hundreds of automatically added printers, so I can't find the one I want to use, see screenshot below.

The printers stem from my work network, where apparently lots of people (including students, I guess) are "sharing" their home printers, which my laptop then picks up automatically. (coincidentally I sometimes disable the avahi-daemon at work, simply because it is using a large amount of CPU).
When I go to http://localhost:631/printers/, it says there are 131 printers, and they are all of Make and Model 'Local Raw Printer'. With two exceptions: 1 is a network printer at work that I manually configured. Another is a network printer at my parents', which was also automatically added and which I am on the same network as right now. But the rest are just garbage that I would really like to avoid. Tips on how to do that would be appreciated.
I will not be going back to my work place for a bit of time though, so for now, I would just like these printers (that would be the 129/130 automatically added printers) to be removed. Is there a way to do that? I guess I could do it by clicking through in the cups web interface, but for 129 printers, that is a bit much. So I am looking for a single command or tips on how to achieve it with a script of sorts.
networking printing avahi
New contributor
jonaslb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
see /etc/cups/printers.conf. stop cups and then remove the printers from the file.
– Rinzwind
May 30 at 19:05
2
It's not a duplicate because I am asking how to remove already installed printers, while that other question is about preventing their installation. Also, it's a question which has a hot mess of outdated answers which don't work. I know this because I've seen it before and tried some of it.
– jonaslb
May 30 at 19:56
1
Understood, retracted :)
– NGRhodes
May 30 at 20:08
add a comment |
It is very difficult for me to perform printing, because the printer dialogue is full of hundreds of automatically added printers, so I can't find the one I want to use, see screenshot below.

The printers stem from my work network, where apparently lots of people (including students, I guess) are "sharing" their home printers, which my laptop then picks up automatically. (coincidentally I sometimes disable the avahi-daemon at work, simply because it is using a large amount of CPU).
When I go to http://localhost:631/printers/, it says there are 131 printers, and they are all of Make and Model 'Local Raw Printer'. With two exceptions: 1 is a network printer at work that I manually configured. Another is a network printer at my parents', which was also automatically added and which I am on the same network as right now. But the rest are just garbage that I would really like to avoid. Tips on how to do that would be appreciated.
I will not be going back to my work place for a bit of time though, so for now, I would just like these printers (that would be the 129/130 automatically added printers) to be removed. Is there a way to do that? I guess I could do it by clicking through in the cups web interface, but for 129 printers, that is a bit much. So I am looking for a single command or tips on how to achieve it with a script of sorts.
networking printing avahi
New contributor
jonaslb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
It is very difficult for me to perform printing, because the printer dialogue is full of hundreds of automatically added printers, so I can't find the one I want to use, see screenshot below.

The printers stem from my work network, where apparently lots of people (including students, I guess) are "sharing" their home printers, which my laptop then picks up automatically. (coincidentally I sometimes disable the avahi-daemon at work, simply because it is using a large amount of CPU).
When I go to http://localhost:631/printers/, it says there are 131 printers, and they are all of Make and Model 'Local Raw Printer'. With two exceptions: 1 is a network printer at work that I manually configured. Another is a network printer at my parents', which was also automatically added and which I am on the same network as right now. But the rest are just garbage that I would really like to avoid. Tips on how to do that would be appreciated.
I will not be going back to my work place for a bit of time though, so for now, I would just like these printers (that would be the 129/130 automatically added printers) to be removed. Is there a way to do that? I guess I could do it by clicking through in the cups web interface, but for 129 printers, that is a bit much. So I am looking for a single command or tips on how to achieve it with a script of sorts.
networking printing avahi
networking printing avahi
New contributor
jonaslb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
jonaslb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited May 30 at 18:41
George Udosen
22.6k104976
22.6k104976
New contributor
jonaslb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked May 30 at 18:39
jonaslbjonaslb
834
834
New contributor
jonaslb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
jonaslb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
see /etc/cups/printers.conf. stop cups and then remove the printers from the file.
– Rinzwind
May 30 at 19:05
2
It's not a duplicate because I am asking how to remove already installed printers, while that other question is about preventing their installation. Also, it's a question which has a hot mess of outdated answers which don't work. I know this because I've seen it before and tried some of it.
– jonaslb
May 30 at 19:56
1
Understood, retracted :)
– NGRhodes
May 30 at 20:08
add a comment |
1
see /etc/cups/printers.conf. stop cups and then remove the printers from the file.
– Rinzwind
May 30 at 19:05
2
It's not a duplicate because I am asking how to remove already installed printers, while that other question is about preventing their installation. Also, it's a question which has a hot mess of outdated answers which don't work. I know this because I've seen it before and tried some of it.
– jonaslb
May 30 at 19:56
1
Understood, retracted :)
– NGRhodes
May 30 at 20:08
1
1
see /etc/cups/printers.conf. stop cups and then remove the printers from the file.
– Rinzwind
May 30 at 19:05
see /etc/cups/printers.conf. stop cups and then remove the printers from the file.
– Rinzwind
May 30 at 19:05
2
2
It's not a duplicate because I am asking how to remove already installed printers, while that other question is about preventing their installation. Also, it's a question which has a hot mess of outdated answers which don't work. I know this because I've seen it before and tried some of it.
– jonaslb
May 30 at 19:56
It's not a duplicate because I am asking how to remove already installed printers, while that other question is about preventing their installation. Also, it's a question which has a hot mess of outdated answers which don't work. I know this because I've seen it before and tried some of it.
– jonaslb
May 30 at 19:56
1
1
Understood, retracted :)
– NGRhodes
May 30 at 20:08
Understood, retracted :)
– NGRhodes
May 30 at 20:08
add a comment |
1 Answer
1
active
oldest
votes
Using this command: lpstat -a we can see the installed printers and identify the name of the desired printer to keep, we can use the grep command also to filter the results like so: lpstat -a | grep <probable_name_of_printer>.
Then this little script can help:
Run this command to check that the desired printer is not listed:
lpstat -a | cut -d" " -f1 | sed -E '/<NAME_OF_PRINTER>/d' | grep <NAME_OF_PRINTER>This should return nothing as it does the following:
lpstat -a: list installed printerscut -d" " -f1: return only the names of the printerssed -E '/<NAME_OF_PRINTER>/d': remove the name of the printer to keep from the output of the previous commandsgrep <NAME_OF_PRINTER>: make sure the desired printer is not on the list
If the above checks out; then run this command to remove every other printer that you don't need:
sudo bash -c 'for i in $(lpstat -a | cut -d" " -f1 | sed -E '/<NAME_OF_PRINTER>/d'); do lpadmin -x "$i"; done'
This looks promising. I think there might be an issue though (with the listing command so presumably also the last command).lpstat -aresults in<printer_name> not accepting request since <some date> -n reason unknown(withreason unknownon a new line!). So using your listing command I get a lot of "printers" named ` reason` (there's an indentation).
– jonaslb
May 30 at 20:42
Please which part of the steps are you having issues and add any results to your question so I can follow! What does the commandlpstat -agive you?
– George Udosen
May 30 at 20:46
1
It worked fine, but I added anothersedcommand in the "pipe chain":sed -E /reason/dto be rid of the extra lines.
– jonaslb
May 30 at 20:56
Great work and glad it worked!
– George Udosen
May 30 at 20:57
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
jonaslb is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147493%2fhow-do-i-remove-hundreds-of-automatically-added-network-printers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Using this command: lpstat -a we can see the installed printers and identify the name of the desired printer to keep, we can use the grep command also to filter the results like so: lpstat -a | grep <probable_name_of_printer>.
Then this little script can help:
Run this command to check that the desired printer is not listed:
lpstat -a | cut -d" " -f1 | sed -E '/<NAME_OF_PRINTER>/d' | grep <NAME_OF_PRINTER>This should return nothing as it does the following:
lpstat -a: list installed printerscut -d" " -f1: return only the names of the printerssed -E '/<NAME_OF_PRINTER>/d': remove the name of the printer to keep from the output of the previous commandsgrep <NAME_OF_PRINTER>: make sure the desired printer is not on the list
If the above checks out; then run this command to remove every other printer that you don't need:
sudo bash -c 'for i in $(lpstat -a | cut -d" " -f1 | sed -E '/<NAME_OF_PRINTER>/d'); do lpadmin -x "$i"; done'
This looks promising. I think there might be an issue though (with the listing command so presumably also the last command).lpstat -aresults in<printer_name> not accepting request since <some date> -n reason unknown(withreason unknownon a new line!). So using your listing command I get a lot of "printers" named ` reason` (there's an indentation).
– jonaslb
May 30 at 20:42
Please which part of the steps are you having issues and add any results to your question so I can follow! What does the commandlpstat -agive you?
– George Udosen
May 30 at 20:46
1
It worked fine, but I added anothersedcommand in the "pipe chain":sed -E /reason/dto be rid of the extra lines.
– jonaslb
May 30 at 20:56
Great work and glad it worked!
– George Udosen
May 30 at 20:57
add a comment |
Using this command: lpstat -a we can see the installed printers and identify the name of the desired printer to keep, we can use the grep command also to filter the results like so: lpstat -a | grep <probable_name_of_printer>.
Then this little script can help:
Run this command to check that the desired printer is not listed:
lpstat -a | cut -d" " -f1 | sed -E '/<NAME_OF_PRINTER>/d' | grep <NAME_OF_PRINTER>This should return nothing as it does the following:
lpstat -a: list installed printerscut -d" " -f1: return only the names of the printerssed -E '/<NAME_OF_PRINTER>/d': remove the name of the printer to keep from the output of the previous commandsgrep <NAME_OF_PRINTER>: make sure the desired printer is not on the list
If the above checks out; then run this command to remove every other printer that you don't need:
sudo bash -c 'for i in $(lpstat -a | cut -d" " -f1 | sed -E '/<NAME_OF_PRINTER>/d'); do lpadmin -x "$i"; done'
This looks promising. I think there might be an issue though (with the listing command so presumably also the last command).lpstat -aresults in<printer_name> not accepting request since <some date> -n reason unknown(withreason unknownon a new line!). So using your listing command I get a lot of "printers" named ` reason` (there's an indentation).
– jonaslb
May 30 at 20:42
Please which part of the steps are you having issues and add any results to your question so I can follow! What does the commandlpstat -agive you?
– George Udosen
May 30 at 20:46
1
It worked fine, but I added anothersedcommand in the "pipe chain":sed -E /reason/dto be rid of the extra lines.
– jonaslb
May 30 at 20:56
Great work and glad it worked!
– George Udosen
May 30 at 20:57
add a comment |
Using this command: lpstat -a we can see the installed printers and identify the name of the desired printer to keep, we can use the grep command also to filter the results like so: lpstat -a | grep <probable_name_of_printer>.
Then this little script can help:
Run this command to check that the desired printer is not listed:
lpstat -a | cut -d" " -f1 | sed -E '/<NAME_OF_PRINTER>/d' | grep <NAME_OF_PRINTER>This should return nothing as it does the following:
lpstat -a: list installed printerscut -d" " -f1: return only the names of the printerssed -E '/<NAME_OF_PRINTER>/d': remove the name of the printer to keep from the output of the previous commandsgrep <NAME_OF_PRINTER>: make sure the desired printer is not on the list
If the above checks out; then run this command to remove every other printer that you don't need:
sudo bash -c 'for i in $(lpstat -a | cut -d" " -f1 | sed -E '/<NAME_OF_PRINTER>/d'); do lpadmin -x "$i"; done'
Using this command: lpstat -a we can see the installed printers and identify the name of the desired printer to keep, we can use the grep command also to filter the results like so: lpstat -a | grep <probable_name_of_printer>.
Then this little script can help:
Run this command to check that the desired printer is not listed:
lpstat -a | cut -d" " -f1 | sed -E '/<NAME_OF_PRINTER>/d' | grep <NAME_OF_PRINTER>This should return nothing as it does the following:
lpstat -a: list installed printerscut -d" " -f1: return only the names of the printerssed -E '/<NAME_OF_PRINTER>/d': remove the name of the printer to keep from the output of the previous commandsgrep <NAME_OF_PRINTER>: make sure the desired printer is not on the list
If the above checks out; then run this command to remove every other printer that you don't need:
sudo bash -c 'for i in $(lpstat -a | cut -d" " -f1 | sed -E '/<NAME_OF_PRINTER>/d'); do lpadmin -x "$i"; done'
edited May 30 at 21:19
Jos
15.2k54554
15.2k54554
answered May 30 at 19:28
George UdosenGeorge Udosen
22.6k104976
22.6k104976
This looks promising. I think there might be an issue though (with the listing command so presumably also the last command).lpstat -aresults in<printer_name> not accepting request since <some date> -n reason unknown(withreason unknownon a new line!). So using your listing command I get a lot of "printers" named ` reason` (there's an indentation).
– jonaslb
May 30 at 20:42
Please which part of the steps are you having issues and add any results to your question so I can follow! What does the commandlpstat -agive you?
– George Udosen
May 30 at 20:46
1
It worked fine, but I added anothersedcommand in the "pipe chain":sed -E /reason/dto be rid of the extra lines.
– jonaslb
May 30 at 20:56
Great work and glad it worked!
– George Udosen
May 30 at 20:57
add a comment |
This looks promising. I think there might be an issue though (with the listing command so presumably also the last command).lpstat -aresults in<printer_name> not accepting request since <some date> -n reason unknown(withreason unknownon a new line!). So using your listing command I get a lot of "printers" named ` reason` (there's an indentation).
– jonaslb
May 30 at 20:42
Please which part of the steps are you having issues and add any results to your question so I can follow! What does the commandlpstat -agive you?
– George Udosen
May 30 at 20:46
1
It worked fine, but I added anothersedcommand in the "pipe chain":sed -E /reason/dto be rid of the extra lines.
– jonaslb
May 30 at 20:56
Great work and glad it worked!
– George Udosen
May 30 at 20:57
This looks promising. I think there might be an issue though (with the listing command so presumably also the last command).
lpstat -a results in <printer_name> not accepting request since <some date> -n reason unknown (with reason unknown on a new line!). So using your listing command I get a lot of "printers" named ` reason` (there's an indentation).– jonaslb
May 30 at 20:42
This looks promising. I think there might be an issue though (with the listing command so presumably also the last command).
lpstat -a results in <printer_name> not accepting request since <some date> -n reason unknown (with reason unknown on a new line!). So using your listing command I get a lot of "printers" named ` reason` (there's an indentation).– jonaslb
May 30 at 20:42
Please which part of the steps are you having issues and add any results to your question so I can follow! What does the command
lpstat -a give you?– George Udosen
May 30 at 20:46
Please which part of the steps are you having issues and add any results to your question so I can follow! What does the command
lpstat -a give you?– George Udosen
May 30 at 20:46
1
1
It worked fine, but I added another
sed command in the "pipe chain": sed -E /reason/d to be rid of the extra lines.– jonaslb
May 30 at 20:56
It worked fine, but I added another
sed command in the "pipe chain": sed -E /reason/d to be rid of the extra lines.– jonaslb
May 30 at 20:56
Great work and glad it worked!
– George Udosen
May 30 at 20:57
Great work and glad it worked!
– George Udosen
May 30 at 20:57
add a comment |
jonaslb is a new contributor. Be nice, and check out our Code of Conduct.
jonaslb is a new contributor. Be nice, and check out our Code of Conduct.
jonaslb is a new contributor. Be nice, and check out our Code of Conduct.
jonaslb is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147493%2fhow-do-i-remove-hundreds-of-automatically-added-network-printers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
see /etc/cups/printers.conf. stop cups and then remove the printers from the file.
– Rinzwind
May 30 at 19:05
2
It's not a duplicate because I am asking how to remove already installed printers, while that other question is about preventing their installation. Also, it's a question which has a hot mess of outdated answers which don't work. I know this because I've seen it before and tried some of it.
– jonaslb
May 30 at 19:56
1
Understood, retracted :)
– NGRhodes
May 30 at 20:08