{"id":153,"date":"2017-01-10T03:04:18","date_gmt":"2017-01-10T03:04:18","guid":{"rendered":"http:\/\/marshallpdavis.com\/?page_id=153"},"modified":"2019-09-22T02:47:34","modified_gmt":"2019-09-22T02:47:34","slug":"arch-show-only-packages-from-aur-with-packer","status":"publish","type":"page","link":"https:\/\/marshallpdavis.com\/?page_id=153","title":{"rendered":"Show only packages from AUR"},"content":{"rendered":"<p><code>for pkg in `pacman -Qqm`; do if [[ `pacman -Ssq $pkg | grep -E '^'\"$pkg\"'$' | wc -l` -eq 0 ]]; then echo $pkg; fi; done<\/code><\/p>\n<p>NOTE: This assumes that the AUR packages were installed via pacman -U.<\/p>\n<p>Breaking it down:<br \/>\n<code>for pkg in `...`<\/code><br \/>\nUse the output of `&#8230;` as input for the loop<br \/>\n<code>pacman -Qqm<\/code><br \/>\nList all locally installed, foreign packages quietly<br \/>\nStart of the loop &#8211; Only include the package name<br \/>\n<code>if [[ `pacman -Ssq $pkg | grep -E '^'\"$pkg\"'$' | wc -l` -eq 0 ]]<\/code><br \/>\nIf the line count (wc -l) of a pacman search for the specific package name is 0, we found an installed, foreign, package that is not in the normal repos, so print it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>for pkg in `pacman -Qqm`; do if [[ `pacman -Ssq $pkg | grep -E &#8216;^'&#8221;$pkg&#8221;&#8216;$&#8217; | wc -l` -eq 0 ]]; then echo $pkg; fi; done NOTE: This assumes that the AUR packages were installed via pacman -U. Breaking it down: for pkg in `&#8230;` Use the output of `&#8230;` as input for the loop &hellip; <a href=\"https:\/\/marshallpdavis.com\/?page_id=153\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Show only packages from AUR<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-153","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=153"}],"version-history":[{"count":5,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages\/153\/revisions"}],"predecessor-version":[{"id":178,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages\/153\/revisions\/178"}],"up":[{"embeddable":true,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages\/2"}],"wp:attachment":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}