0

Directly on my Debian box, I can run the following command to show manually installed packages:

aptitude search '!~M ~i'

This works great. If I SSH in from a remote box, and run the command, I also get the same result.

However, when I run the command as a batch, it does not produce the same result.

ssh user@server aptitude search '!~M ~i'

Since the process takes a bit of time to run, I execute ps aux | grep aptitude while running both variants, and the result appears to be the same.

What am I doing wrong?

PS. I am aware that dpkg -L can produce this information, but this is just the smallest example of what is broken, I intend to use !~pstandard !~pimportant !~prequired to filter out base packages as well, which I don't believe dpkg can do (but if it can, a solution with dpkg is welcome.)

Martin
  • 5,945
  • 7
  • 50
  • 77

2 Answers2

1

Using information from Bash - Escaping SSH commands, I was able to create a command that worked:

ssh user@server $(printf '%q ' aptitude search '!~M ~i')
Community
  • 1
  • 1
Martin
  • 5,945
  • 7
  • 50
  • 77
1

If target is a more recent debian/ubuntu you can use:

ssh user@server apt-mark showmanual

taur
  • 169
  • 1
  • 7