Advertisement
Broken_Dynamo

Untitled

Sep 21st, 2023
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. To get a list of all installed Arch/AUR packages that aren't libraries or dependencies, i.e., they aren't required by any other packages, you can use the `pacman` command with the `-Qent` flag. This will list all explicitly installed native packages that are not direct or optional dependencies:
  2.  
  3. ```bash
  4. pacman -Qent
  5. ```
  6.  
  7. However, this command will only list packages from the official repositories and not the AUR packages. To get a list of all installed AUR packages, you can use the `pacman -Qmq` command:
  8.  
  9. ```bash
  10. pacman -Qmq
  11. ```
  12.  
  13. To filter out AUR packages that are not required by any other packages, you can combine the output of the above commands with some additional scripting. Here's an example of how you can achieve this:
  14.  
  15. ```bash
  16. comm -23 <(pacman -Qmq | sort) <(pacman -Qqg base | sort -u)
  17. ```
  18.  
  19. This command will list all installed AUR packages that are not required by any other packages. Note that this command assumes that you have the `comm` utility installed on your system. If you don't have it, you can install it by installing the `coreutils` package:
  20.  
  21. ```bash
  22. sudo pacman -S coreutils
  23. ```
  24.  
  25. Keep in mind that this approach might not be perfect, as it may still include some packages that are indirectly required by other packages. However, it should give you a good starting point for identifying packages that are not libraries or dependencies.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement