|
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 |
| 635 |
using:</para> |
635 |
and 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 |
| 647 |
called <emphasis>automatic</emphasis> packages. Non automatic |
| 648 |
packages, i.e the packages that were explicity installed not |
| 649 |
as a dependency to another package, can be listed |
| 650 |
using:</para> |
| 651 |
|
| 652 |
<screen>&prompt.root; <userinput>pkg prime-list</userinput> |
| 653 |
nginx |
| 654 |
openvpn |
| 655 |
sudo</screen> |
| 656 |
|
| 657 |
<para><command>pkg prime-list</command> is an alias command |
| 658 |
declared in <filename>/usr/local/etc/pkg.conf</filename>. |
| 659 |
There are many others that can be used to query the package |
| 660 |
database of the system. For instance, command |
| 661 |
<command>pkg prime-origins</command>can be used to get the |
| 662 |
origin port directory of the list mentioned above:</para> |
| 663 |
|
| 664 |
<screen>&prompt.root; <userinput>pkg prime-origins</userinput> |
| 665 |
www/nginx |
| 666 |
security/openvpn |
| 667 |
security/sudo</screen> |
| 668 |
|
| 669 |
<para>This list can be used to rebuild all packages |
| 670 |
installed on a system using build tools such as <package> |
| 671 |
ports-mgmt/poudriere</package> or <package> |
| 672 |
ports-mgmt/synth</package></para> |
| 673 |
|
| 674 |
<para>Marking an installed package as automatic can be |
| 675 |
done using:</para> |
| 676 |
|
| 677 |
<screen>&prompt.root; <userinput>pkg set -A 1 devel/cmake</userinput></screen> |
| 678 |
|
| 679 |
<para>Once a package is a leaf package and is marked |
| 680 |
as automatic, it gets selected by |
| 681 |
<command>pkg autoremove</command>.</para> |
| 682 |
|
| 683 |
<para>Marking an installed package as NOT automatic can be |
| 684 |
done using:</para> |
| 685 |
|
| 686 |
<screen>&prompt.root; <userinput>pkg set -A 0 devel/cmake</userinput></screen> |
| 687 |
|
| 645 |
</sect2> |
688 |
</sect2> |
| 646 |
|
689 |
|
| 647 |
<sect2 xml:id="pkgng-backup"> |
690 |
<sect2 xml:id="pkgng-backup"> |