|
Lines 627-638
Link Here
|
| 627 |
</sect2> |
627 |
</sect2> |
| 628 |
|
628 |
|
| 629 |
<sect2 xml:id="pkgng-autoremove"> |
629 |
<sect2 xml:id="pkgng-autoremove"> |
| 630 |
<title>Automatically Removing Leaf Dependencies</title> |
630 |
<title>Automatically Removing Unused packages</title> |
| 631 |
|
631 |
|
| 632 |
<para>Removing a package may leave behind dependencies which |
632 |
<para>Removing a package may leave behind dependencies which |
| 633 |
are no longer required. Unneeded packages that were installed |
633 |
are no longer required. Unneeded packages that were installed |
| 634 |
as dependencies can be automatically detected and removed |
634 |
as dependencies (leaf packages) can be automatically detected and |
| 635 |
using:</para> |
635 |
removed using:</para> |
| 636 |
|
636 |
|
| 637 |
<screen>&prompt.root; <userinput>pkg autoremove</userinput> |
637 |
<screen>&prompt.root; <userinput>pkg autoremove</userinput> |
| 638 |
Packages to be autoremoved: |
638 |
Packages to be autoremoved: |
|
Lines 642-647
Link Here
|
| 642 |
|
642 |
|
| 643 |
Proceed with autoremoval of packages [y/N]: <userinput>y</userinput> |
643 |
Proceed with autoremoval of packages [y/N]: <userinput>y</userinput> |
| 644 |
Deinstalling ca_root_nss-3.15.1_1... done</screen> |
644 |
Deinstalling ca_root_nss-3.15.1_1... done</screen> |
|
|
645 |
|
| 646 |
<para>Packages installed as dependencies are called <emphasis> |
| 647 |
automatic</emphasis> packages. Non automatic packages, i.e the |
| 648 |
packages that were explicity installed not as a dependency to |
| 649 |
another package, can be listed using:</para> |
| 650 |
|
| 651 |
<screen>&prompt.root; <userinput>pkg prime-list</userinput> |
| 652 |
nginx |
| 653 |
openvpn |
| 654 |
sudo</screen> |
| 655 |
|
| 656 |
<para><command>pkg prime-list</command> is an alias command |
| 657 |
declared in <filename>/usr/local/etc/pkg.conf</filename>. There |
| 658 |
are many others that can be used to query the package database of |
| 659 |
the system. For instance, command <command>pkg prime-origins |
| 660 |
</command> can be used to get the origin port directory of the |
| 661 |
list mentionned above:</para> |
| 662 |
|
| 663 |
<screen>&prompt.root; <userinput>pkg prime-origins</userinput> |
| 664 |
www/nginx |
| 665 |
security/openvpn |
| 666 |
security/sudo</screen> |
| 667 |
|
| 668 |
<para>This list can be used to rebuild all packages installed on |
| 669 |
a system using build tools such as <package> |
| 670 |
ports-mgmt/poudriere</package> or <package> |
| 671 |
ports-mgmt/synth</package></para> |
| 672 |
|
| 673 |
<para>Marking an installed package as automatic can be done |
| 674 |
using:</para> |
| 675 |
|
| 676 |
<screen>&prompt.root; <userinput>pkg set -A 1 devel/cmake</userinput></screen> |
| 677 |
|
| 678 |
<para>Once a package is a leaf package and is marked as automatic, it |
| 679 |
gets selected by <command>pkg autoremove</command>.</para> |
| 680 |
|
| 681 |
<para>Marking an installed package as NOT automatic can be done |
| 682 |
using:</para> |
| 683 |
|
| 684 |
<screen>&prompt.root; <userinput>pkg set -A 0 devel/cmake</userinput></screen> |
| 685 |
|
| 645 |
</sect2> |
686 |
</sect2> |
| 646 |
|
687 |
|
| 647 |
<sect2 xml:id="pkgng-backup"> |
688 |
<sect2 xml:id="pkgng-backup"> |