{"id":2738,"date":"2013-08-01T14:04:39","date_gmt":"2013-08-01T13:04:39","guid":{"rendered":"http:\/\/blog.ed.gs\/?p=2738"},"modified":"2013-08-01T14:04:39","modified_gmt":"2013-08-01T13:04:39","slug":"purge-old-apt-packages-using-dpkg","status":"publish","type":"post","link":"https:\/\/ed.gs\/2013\/08\/01\/purge-old-apt-packages-using-dpkg\/","title":{"rendered":"Purge Old apt Packages Using dpkg"},"content":{"rendered":"

When you apt-get remove packages it can still leave behind old configs and other crap you’d probably want to get rid of, here’s how you do it.<\/p>\n

Firstly you can have a look at what’s been removed but not completely by running the following:<\/p>\n

dpkg -l | grep "^rc"<\/pre>\n

You can then extract the names from the list using:<\/p>\n

dpkg -l | grep "^rc" | cut -d " " -f 3<\/pre>\n

If we want to purge them all then we just run:<\/p>\n

dpkg -l | grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge<\/pre>\n","protected":false},"excerpt":{"rendered":"

When you apt-get remove packages it can still leave behind old configs and other crap you’d probably want to get rid of, here’s how you do it. Firstly you can have a look at what’s been removed but not completely by running the following: dpkg -l | grep "^rc" You can then extract the names […]<\/p>\n","protected":false},"author":2,"featured_media":3479,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false},"categories":[32,41],"tags":[],"yoast_head":"\nPurge Old apt Packages Using dpkg - E<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ed.gs\/2013\/08\/01\/purge-old-apt-packages-using-dpkg\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Purge Old apt Packages Using dpkg - E\" \/>\n<meta property=\"og:description\" content=\"When you apt-get remove packages it can still leave behind old configs and other crap you’d probably want to get rid of, here’s how you do it. Firstly you can have a look at what’s been removed but not completely by running the following: dpkg -l | grep "^rc" You can then extract the names […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ed.gs\/2013\/08\/01\/purge-old-apt-packages-using-dpkg\/\" \/>\n<meta property=\"og:site_name\" content=\"E\" \/>\n<meta property=\"article:published_time\" content=\"2013-08-01T13:04:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.ed.gs\/wp-content\/uploads\/2013\/08\/2015-09-01-oscarkeys-barnimages-004.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2048\" \/>\n\t<meta property=\"og:image:height\" content=\"1152\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ed\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ed\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ed.gs\/2013\/08\/01\/purge-old-apt-packages-using-dpkg\/\",\"url\":\"https:\/\/ed.gs\/2013\/08\/01\/purge-old-apt-packages-using-dpkg\/\",\"name\":\"Purge Old apt Packages Using dpkg - E\",\"isPartOf\":{\"@id\":\"https:\/\/ed.gs\/#website\"},\"datePublished\":\"2013-08-01T13:04:39+00:00\",\"dateModified\":\"2013-08-01T13:04:39+00:00\",\"author\":{\"@id\":\"https:\/\/ed.gs\/#\/schema\/person\/d775615f2296ad0129fa3ea66346c628\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ed.gs\/2013\/08\/01\/purge-old-apt-packages-using-dpkg\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ed.gs\/#website\",\"url\":\"https:\/\/ed.gs\/\",\"name\":\"E\",\"description\":\"automation, consultancy, project management, web\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ed.gs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/ed.gs\/#\/schema\/person\/d775615f2296ad0129fa3ea66346c628\",\"name\":\"Ed\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/ed.gs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4fe1dfaed09e6bdceb557d3008f5cc47?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4fe1dfaed09e6bdceb557d3008f5cc47?s=96&d=mm&r=g\",\"caption\":\"Ed\"},\"url\":\"https:\/\/ed.gs\/author\/ed\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Purge Old apt Packages Using dpkg - E","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ed.gs\/2013\/08\/01\/purge-old-apt-packages-using-dpkg\/","og_locale":"en_GB","og_type":"article","og_title":"Purge Old apt Packages Using dpkg - E","og_description":"When you apt-get remove packages it can still leave behind old configs and other crap you’d probably want to get rid of, here’s how you do it. Firstly you can have a look at what’s been removed but not completely by running the following: dpkg -l | grep "^rc" You can then extract the names […]","og_url":"https:\/\/ed.gs\/2013\/08\/01\/purge-old-apt-packages-using-dpkg\/","og_site_name":"E","article_published_time":"2013-08-01T13:04:39+00:00","og_image":[{"width":2048,"height":1152,"url":"https:\/\/static.ed.gs\/wp-content\/uploads\/2013\/08\/2015-09-01-oscarkeys-barnimages-004.jpg","type":"image\/jpeg"}],"author":"Ed","twitter_misc":{"Written by":"Ed"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/ed.gs\/2013\/08\/01\/purge-old-apt-packages-using-dpkg\/","url":"https:\/\/ed.gs\/2013\/08\/01\/purge-old-apt-packages-using-dpkg\/","name":"Purge Old apt Packages Using dpkg - E","isPartOf":{"@id":"https:\/\/ed.gs\/#website"},"datePublished":"2013-08-01T13:04:39+00:00","dateModified":"2013-08-01T13:04:39+00:00","author":{"@id":"https:\/\/ed.gs\/#\/schema\/person\/d775615f2296ad0129fa3ea66346c628"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ed.gs\/2013\/08\/01\/purge-old-apt-packages-using-dpkg\/"]}]},{"@type":"WebSite","@id":"https:\/\/ed.gs\/#website","url":"https:\/\/ed.gs\/","name":"E","description":"automation, consultancy, project management, web","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ed.gs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/ed.gs\/#\/schema\/person\/d775615f2296ad0129fa3ea66346c628","name":"Ed","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/ed.gs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4fe1dfaed09e6bdceb557d3008f5cc47?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4fe1dfaed09e6bdceb557d3008f5cc47?s=96&d=mm&r=g","caption":"Ed"},"url":"https:\/\/ed.gs\/author\/ed\/"}]}},"_links":{"self":[{"href":"https:\/\/ed.gs\/wp-json\/wp\/v2\/posts\/2738"}],"collection":[{"href":"https:\/\/ed.gs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ed.gs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ed.gs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ed.gs\/wp-json\/wp\/v2\/comments?post=2738"}],"version-history":[{"count":0,"href":"https:\/\/ed.gs\/wp-json\/wp\/v2\/posts\/2738\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ed.gs\/wp-json\/wp\/v2\/media\/3479"}],"wp:attachment":[{"href":"https:\/\/ed.gs\/wp-json\/wp\/v2\/media?parent=2738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ed.gs\/wp-json\/wp\/v2\/categories?post=2738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ed.gs\/wp-json\/wp\/v2\/tags?post=2738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}