Quantcast
Channel: How to correct auto/manual installation flags of installed packages? - Ask Ubuntu
Viewing all articles
Browse latest Browse all 3

How to correct auto/manual installation flags of installed packages?

$
0
0

I have installed Ubuntu on the new Lenovo T470. To have the same packages as on the old notebook installed I have created a list of installed packages on the old notebook and I installed those on new Lenovo using How to list all installed packages.

Now I have almost all packages marked as installed manually (I read the some comments too late) - autoremove will not work correctly.

I would like to correct the manual/auto flags of dependent packages to auto.

I'm thinking I need to take the following steps:

  1. Create a list of all installed packages

    apt-mark showmanual >installed_packages.txtapt-mark showauto >>installed_packages.txt
  2. Retrieve the dependencies (quite a long process)

    for PACKAGE in $( sort installed_packages.txt ); do    apt-cache depends ${PACKAGE} --important -q --installed | awk '/epends:/ {print $2}'>>dependencies_all.txtdonesort -u dependencies_all.txt > dependencies_uniq.txt

    Note the --important option of apt-cache. AWK will print only a package name of Depends: and PreDepends:

  3. Set the auto flag for all dependent packages

    cat dependencies_uniq.txt | xargs sudo apt-mark auto

Are these steps correct?Are the dependencies retrieved by apt-cache depends --important the same as selected for installation by APT when a package is installed?

Is there a better way to correct these flags?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images