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

Can you please explain this joke: "I'm going bananas is what I tell my bananas before I leave the house"?

Does any lore text explain why the planes of Acheron, Gehenna, and Carceri are the alignment they are?

What is the Process for Re-certifying Flight Hardware?

How can I offer a test ride while selling a bike?

Short story written from alien perspective with this line: "It's too bright to look at, so they don't"

GFCI Outlet in Bathroom, Lights not working

Accidentally cashed a check twice

When leasing/renting out an owned property, is there a standard ratio between monthly rent and the mortgage?

Is there any Biblical Basis for 400 years of silence between Old and New Testament?

What is the right way to float a home lab?

Chopin: marche funèbre bar 15 impossible place

How do I remove hundreds of automatically added network printers?

Initialize an array of doubles at compile time

Concise way to draw this pyramid

How can Iron Man's suit withstand this?

Metal bar on DMM PCB

Why does MS SQL allow you to create an illegal column?

Creating Fictional Slavic Place Names

Explain Ant-Man's "not it" scene from Avengers: Endgame

Unconventional Opposites

How to apply the "glow" effect to a rectangle with tcolorbox?

Can The Malloreon be read without first reading The Belgariad?

Pros and cons of writing a book review?

Are there practical reasons to NOT use a stepper motor with lead screw for the X and or Y axes?



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;








5















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.



Image of printer dialogue showing a very long scroll bar



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.










share|improve this question









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
    8 hours ago






  • 1





    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
    7 hours ago











  • Understood, retracted :)

    – NGRhodes
    7 hours ago

















5















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.



Image of printer dialogue showing a very long scroll bar



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.










share|improve this question









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
    8 hours ago






  • 1





    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
    7 hours ago











  • Understood, retracted :)

    – NGRhodes
    7 hours ago













5












5








5








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.



Image of printer dialogue showing a very long scroll bar



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.










share|improve this question









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.



Image of printer dialogue showing a very long scroll bar



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






share|improve this question









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.










share|improve this question









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.








share|improve this question




share|improve this question








edited 9 hours ago









George Udosen

22.4k104875




22.4k104875






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 9 hours ago









jonaslbjonaslb

282




282




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
    8 hours ago






  • 1





    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
    7 hours ago











  • Understood, retracted :)

    – NGRhodes
    7 hours ago












  • 1





    see /etc/cups/printers.conf. stop cups and then remove the printers from the file.

    – Rinzwind
    8 hours ago






  • 1





    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
    7 hours ago











  • Understood, retracted :)

    – NGRhodes
    7 hours ago







1




1





see /etc/cups/printers.conf. stop cups and then remove the printers from the file.

– Rinzwind
8 hours ago





see /etc/cups/printers.conf. stop cups and then remove the printers from the file.

– Rinzwind
8 hours ago




1




1





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
7 hours ago





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
7 hours ago













Understood, retracted :)

– NGRhodes
7 hours ago





Understood, retracted :)

– NGRhodes
7 hours ago










1 Answer
1






active

oldest

votes


















5














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:




  1. 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 printers


      • cut -d" " -f1: return only the names of the printers


      • sed -E '/<NAME_OF_PRINTER>/d': remove the name of the printer to keep from the output of the previous commands


      • grep <NAME_OF_PRINTER>: make sure the desired printer is not on the list




  2. 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'






share|improve this answer

























  • 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
    6 hours ago











  • 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
    6 hours ago












  • 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
    6 hours ago











  • Great work and glad it worked!

    – George Udosen
    6 hours ago











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.









draft saved

draft discarded


















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









5














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:




  1. 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 printers


      • cut -d" " -f1: return only the names of the printers


      • sed -E '/<NAME_OF_PRINTER>/d': remove the name of the printer to keep from the output of the previous commands


      • grep <NAME_OF_PRINTER>: make sure the desired printer is not on the list




  2. 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'






share|improve this answer

























  • 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
    6 hours ago











  • 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
    6 hours ago












  • 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
    6 hours ago











  • Great work and glad it worked!

    – George Udosen
    6 hours ago















5














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:




  1. 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 printers


      • cut -d" " -f1: return only the names of the printers


      • sed -E '/<NAME_OF_PRINTER>/d': remove the name of the printer to keep from the output of the previous commands


      • grep <NAME_OF_PRINTER>: make sure the desired printer is not on the list




  2. 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'






share|improve this answer

























  • 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
    6 hours ago











  • 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
    6 hours ago












  • 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
    6 hours ago











  • Great work and glad it worked!

    – George Udosen
    6 hours ago













5












5








5







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:




  1. 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 printers


      • cut -d" " -f1: return only the names of the printers


      • sed -E '/<NAME_OF_PRINTER>/d': remove the name of the printer to keep from the output of the previous commands


      • grep <NAME_OF_PRINTER>: make sure the desired printer is not on the list




  2. 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'






share|improve this answer















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:




  1. 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 printers


      • cut -d" " -f1: return only the names of the printers


      • sed -E '/<NAME_OF_PRINTER>/d': remove the name of the printer to keep from the output of the previous commands


      • grep <NAME_OF_PRINTER>: make sure the desired printer is not on the list




  2. 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'







share|improve this answer














share|improve this answer



share|improve this answer








edited 6 hours ago









Jos

15.1k54554




15.1k54554










answered 8 hours ago









George UdosenGeorge Udosen

22.4k104875




22.4k104875












  • 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
    6 hours ago











  • 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
    6 hours ago












  • 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
    6 hours ago











  • Great work and glad it worked!

    – George Udosen
    6 hours ago

















  • 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
    6 hours ago











  • 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
    6 hours ago












  • 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
    6 hours ago











  • Great work and glad it worked!

    – George Udosen
    6 hours ago
















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
6 hours ago





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
6 hours ago













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
6 hours ago






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
6 hours ago














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
6 hours ago





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
6 hours ago













Great work and glad it worked!

– George Udosen
6 hours ago





Great work and glad it worked!

– George Udosen
6 hours ago










jonaslb is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її