Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

There are some similar questions, but here is precisely what I would like to achieve and the dots which I am having trouble connecting:

  1. Query a list of "Manually Installed" packages (apt-mark showmanual works)
  2. Check each package for installed dependents
  3. Mark each such package as "Automatically Installed" (apt-mark auto <pkg ...> works)

So I think my command will look something like:

apt-mark showmanual | <esoteric apt/bash magic> | apt-mark auto -

Would that be correct?

Related Questions

  1. How do I find which packages could be set as automatically installed?
  2. Why are almost all packages marked as manually installed? (See also https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/424643/comments/26)
share|improve this question
    
"There are some similar questions" ... you could provide links to the most relevant ones. –  user25656 Apr 6 '13 at 2:50

1 Answer 1

up vote 1 down vote accepted

You could use Aptitude's why command:

for x in $(apt-mark showmanual)
do
  aptitude why ${x} | grep -q ' Depends ' && apt-mark auto ${x}
done

Not tested, because it's not something I want to (have to un-)do on my machine.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.