|
Lines 1967-1972
Link Here
|
| 1967 |
</listitem> |
1967 |
</listitem> |
| 1968 |
|
1968 |
|
| 1969 |
<listitem> |
1969 |
<listitem> |
|
|
1970 |
<para><command>make <maketarget>delete-old</maketarget></command></para> |
| 1971 |
|
| 1972 |
<para>This target deletes old (obsolete) files. This is important |
| 1973 |
because sometimes they cause problems if left on the disk, for |
| 1974 |
example the presence of the old <filename>utmp.h</filename> causes |
| 1975 |
problems in some ports when the new |
| 1976 |
<filename>utmpx.h</filename> is installed.</para> |
| 1977 |
</listitem> |
| 1978 |
|
| 1979 |
<listitem> |
| 1970 |
<para><command>mergemaster</command></para> |
1980 |
<para><command>mergemaster</command></para> |
| 1971 |
|
1981 |
|
| 1972 |
<para>Now you can update the remaining configuration files, since |
1982 |
<para>Now you can update the remaining configuration files, since |
|
Lines 1979-1984
Link Here
|
| 1979 |
<para>A full machine reboot is needed now to load the new kernel |
1989 |
<para>A full machine reboot is needed now to load the new kernel |
| 1980 |
and new world with new configuration files.</para> |
1990 |
and new world with new configuration files.</para> |
| 1981 |
</listitem> |
1991 |
</listitem> |
|
|
1992 |
|
| 1993 |
<listitem> |
| 1994 |
<para><command>make <maketarget>delete-old-libs</maketarget></command></para> |
| 1995 |
|
| 1996 |
<para>Remove any obsolete libraries to avoid conflicts with newer |
| 1997 |
ones. Make sure that all ports have been rebuilt to use the new |
| 1998 |
libraries before you delete the old ones.</para> |
| 1999 |
</listitem> |
| 1982 |
</orderedlist> |
2000 |
</orderedlist> |
| 1983 |
|
2001 |
|
| 1984 |
<para>Note that if you're upgrading from one release of the same &os; |
2002 |
<para>Note that if you're upgrading from one release of the same &os; |
|
Lines 2034-2041
Link Here
|
| 2034 |
&prompt.root; <userinput>mergemaster -p</userinput> |
2052 |
&prompt.root; <userinput>mergemaster -p</userinput> |
| 2035 |
&prompt.root; <userinput>cd /usr/src</userinput> |
2053 |
&prompt.root; <userinput>cd /usr/src</userinput> |
| 2036 |
&prompt.root; <userinput>make installworld</userinput> |
2054 |
&prompt.root; <userinput>make installworld</userinput> |
|
|
2055 |
&prompt.root; <userinput>make delete-old</userinput> |
| 2037 |
&prompt.root; <userinput>mergemaster</userinput> |
2056 |
&prompt.root; <userinput>mergemaster</userinput> |
| 2038 |
&prompt.root; <userinput>reboot</userinput></screen> |
2057 |
&prompt.root; <userinput>reboot</userinput> |
|
|
2058 |
&prompt.root; <userinput>make delete-old-libs</userinput></screen> |
| 2039 |
|
2059 |
|
| 2040 |
<warning> |
2060 |
<warning> |
| 2041 |
<title>Read Further Explanations</title> |
2061 |
<title>Read Further Explanations</title> |
|
Lines 2471-2476
Link Here
|
| 2471 |
</note> |
2491 |
</note> |
| 2472 |
</sect2> |
2492 |
</sect2> |
| 2473 |
|
2493 |
|
|
|
2494 |
<sect2 id="make-delete-old"> |
| 2495 |
<sect2info> |
| 2496 |
<authorgroup> |
| 2497 |
<author> |
| 2498 |
<firstname>Anton</firstname> |
| 2499 |
<surname>Shterenlikht</surname> |
| 2500 |
<contrib>Based on notes provided by </contrib> |
| 2501 |
</author> |
| 2502 |
</authorgroup> |
| 2503 |
</sect2info> |
| 2504 |
|
| 2505 |
<title>Deleting obsolete files and directories</title> |
| 2506 |
|
| 2507 |
<indexterm> |
| 2508 |
<primary>Deleting obsolete files and directories</primary> |
| 2509 |
</indexterm> |
| 2510 |
|
| 2511 |
<para>As a part of the &os; development lifecycle, it happens from time |
| 2512 |
to time that files and their contents become obsolete. This may be |
| 2513 |
because their functionality is implemented elsewhere, the version number |
| 2514 |
of the library has changed or it was removed from the system entirely. |
| 2515 |
This includes old files, libraries and directories, which should |
| 2516 |
be removed when updating the system. The benefit for the user is that |
| 2517 |
the system is not cluttered with old files which take up unnecessary |
| 2518 |
space on the storage (and backup) medium. Additionally, if the old |
| 2519 |
library had a security or stability issue, you should update to the |
| 2520 |
newer library to keep your system safe and prevent crashes caused by |
| 2521 |
the old library implementation. The files, directories, and libraries |
| 2522 |
that are considered obsolete are listed in |
| 2523 |
<filename>/usr/src/ObsoleteFiles.inc</filename>. The following |
| 2524 |
instructions will help you removing these obsolete files during the |
| 2525 |
system upgrade process.</para> |
| 2526 |
|
| 2527 |
<para>After the <command>make |
| 2528 |
<maketarget>installworld</maketarget></command> and the subsequent |
| 2529 |
<command>mergemaster</command> commands have finished successfully, you |
| 2530 |
should check for obsolete files and libraries as follows:</para> |
| 2531 |
|
| 2532 |
<screen>&prompt.root; <userinput>cd /usr/src</userinput> |
| 2533 |
&prompt.root; <userinput>make check-old</userinput></screen> |
| 2534 |
|
| 2535 |
<para>If any obsolete files are found, they can be deleted using the |
| 2536 |
following commands:</para> |
| 2537 |
|
| 2538 |
<screen>&prompt.root; <userinput>make delete-old</userinput></screen> |
| 2539 |
|
| 2540 |
<tip> |
| 2541 |
<para>See <filename>/usr/src/Makefile</filename> |
| 2542 |
for more targets of interest.</para> |
| 2543 |
</tip> |
| 2544 |
|
| 2545 |
<para>A prompt is displayed before deleting each obsolete file. You can |
| 2546 |
skip the prompt and let the system remove these files automatically by |
| 2547 |
using the <makevar>BATCH_DELETE_OLD_FILES</makevar> make-variable as |
| 2548 |
follows:</para> |
| 2549 |
|
| 2550 |
<screen>&prompt.root; <userinput>make -DBATCH_DELETE_OLD_FILES delete-old</userinput></screen> |
| 2551 |
|
| 2552 |
<para>You can also achieve the same goal by piping these commands through |
| 2553 |
<command>yes</command> like this:</para> |
| 2554 |
|
| 2555 |
<screen>&prompt.root; <userinput>yes|make delete-old</userinput></screen> |
| 2556 |
</sect2> |
| 2557 |
|
| 2474 |
<sect2 id="post-installworld-updates"> |
2558 |
<sect2 id="post-installworld-updates"> |
| 2475 |
<title>Update Files Not Updated by <command>make installworld</command></title> |
2559 |
<title>Update Files Not Updated by <command>make installworld</command></title> |
| 2476 |
|
2560 |
|
|
Lines 2725-2737
Link Here
|
| 2725 |
<sect2 id="updating-upgrading-rebooting"> |
2809 |
<sect2 id="updating-upgrading-rebooting"> |
| 2726 |
<title>Rebooting</title> |
2810 |
<title>Rebooting</title> |
| 2727 |
|
2811 |
|
| 2728 |
<para>You are now done. After you have verified that everything appears |
2812 |
<para>You are now almost done. After you have verified that everything |
| 2729 |
to be in the right place you can reboot the system. A simple |
2813 |
appears to be in the right place you can reboot the system. A simple |
| 2730 |
&man.shutdown.8; should do it:</para> |
2814 |
&man.shutdown.8; should do it:</para> |
| 2731 |
|
2815 |
|
| 2732 |
<screen>&prompt.root; <userinput>shutdown -r now</userinput></screen> |
2816 |
<screen>&prompt.root; <userinput>shutdown -r now</userinput></screen> |
| 2733 |
</sect2> |
2817 |
</sect2> |
| 2734 |
|
2818 |
|
|
|
2819 |
<sect2 id="updating-upgrading-make-delete-old-libs"> |
| 2820 |
<title>Deleting obsolete libraries</title> |
| 2821 |
|
| 2822 |
<warning> |
| 2823 |
<title>Warning</title> |
| 2824 |
|
| 2825 |
<para>Deleting obsolete files will break applications that still |
| 2826 |
depend on those obsolete files. This is especially true for old |
| 2827 |
libraries. In most cases, you need to recompile the programs, ports, |
| 2828 |
or libraries that used the old library before <command>make |
| 2829 |
<maketarget>delete-old-libs</maketarget></command> is executed.</para> |
| 2830 |
</warning> |
| 2831 |
|
| 2832 |
<para>Utilities for checking shared library dependencies are available |
| 2833 |
from the Ports Collection in <filename |
| 2834 |
role="package">sysutils/libchk</filename> or <filename |
| 2835 |
role="package">sysutils/bsdadminscripts</filename>.</para> |
| 2836 |
|
| 2837 |
<para>Obsolete shared libraries can conflict with newer libraries, |
| 2838 |
causing messages like these:</para> |
| 2839 |
|
| 2840 |
<screen>/usr/bin/ld: warning: libz.so.4, needed by /usr/local/lib/libtiff.so, may conflict with libz.so.5 |
| 2841 |
/usr/bin/ld: warning: librpcsvc.so.4, needed by /usr/local/lib/libXext.so, may conflict with librpcsvc.so.5</screen> |
| 2842 |
|
| 2843 |
<para>To solve these problems, determine which port installed the |
| 2844 |
library:</para> |
| 2845 |
|
| 2846 |
<screen>&prompt.root; <userinput>pkg_info -W /usr/local/lib/libtiff.so</userinput> |
| 2847 |
/usr/local/lib/libtiff.so was installed by package tiff-3.9.4 |
| 2848 |
&prompt.root; <userinput>pkg_info -W /usr/local/lib/libXext.so</userinput> |
| 2849 |
/usr/local/lib/libXext.so was installed by package libXext-1.1.1,1</screen> |
| 2850 |
|
| 2851 |
<para>Then deinstall, rebuild and reinstall the port. The <filename |
| 2852 |
role="package">ports-mgmt/portmaster</filename> and <filename |
| 2853 |
role="package">ports-mgmt/portupgrade</filename> utilities can be used |
| 2854 |
to automate this process. After you've made sure that all ports are |
| 2855 |
rebuilt and do not use the old libraries anymore, you can delete them |
| 2856 |
using the |
| 2857 |
following command:</para> |
| 2858 |
|
| 2859 |
<screen>&prompt.root; <userinput>make delete-old-libs</userinput></screen> |
| 2860 |
</sect2> |
| 2861 |
|
| 2735 |
<sect2> |
2862 |
<sect2> |
| 2736 |
<title>Finished</title> |
2863 |
<title>Finished</title> |
| 2737 |
|
2864 |
|
|
Lines 3020-3125
Link Here
|
| 3020 |
</sect2> |
3147 |
</sect2> |
| 3021 |
</sect1> |
3148 |
</sect1> |
| 3022 |
|
3149 |
|
| 3023 |
<sect1 id="make-delete-old"> |
|
|
| 3024 |
<sect1info> |
| 3025 |
<authorgroup> |
| 3026 |
<author> |
| 3027 |
<firstname>Anton</firstname> |
| 3028 |
<surname>Shterenlikht</surname> |
| 3029 |
<contrib>Based on notes provided by </contrib> |
| 3030 |
</author> |
| 3031 |
</authorgroup> |
| 3032 |
</sect1info> |
| 3033 |
<title>Deleting obsolete files, directories and libraries</title> |
| 3034 |
<indexterm> |
| 3035 |
<primary>Deleting obsolete files, directories and libraries</primary> |
| 3036 |
</indexterm> |
| 3037 |
|
| 3038 |
<para>As a part of the &os; development lifecycle, it happens from time |
| 3039 |
to time that files and their contents become obsolete. This may be |
| 3040 |
because their functionality is implemented elsewhere, the version number |
| 3041 |
of the library has changed or it was removed from the system entirely. |
| 3042 |
This includes old files, libraries and directories, which should |
| 3043 |
be removed when updating the system. The benefit for the user is that |
| 3044 |
the system is not cluttered with old files which take up unnecessary |
| 3045 |
space on the storage (and backup) medium. Additionally, if the old |
| 3046 |
library had a security or stability issue, you should update to the |
| 3047 |
newer library to keep your system safe and prevent crashes caused by |
| 3048 |
the old library implementation. The files, directories, and libraries |
| 3049 |
that are considered obsolete are listed in |
| 3050 |
<filename>/usr/src/ObsoleteFiles.inc</filename>. The following |
| 3051 |
instructions will help you removing these obsolete files during the |
| 3052 |
system upgrade process.</para> |
| 3053 |
|
| 3054 |
<para>We assume you are following the steps outlined in <xref |
| 3055 |
linkend="canonical-build">. After the <command>make |
| 3056 |
<maketarget>installworld</maketarget></command> and the subsequent |
| 3057 |
<command>mergemaster</command> commands have finished successfully, you |
| 3058 |
should check for obsolete files and libraries as follows:</para> |
| 3059 |
|
| 3060 |
<screen>&prompt.root; <userinput>cd /usr/src</userinput> |
| 3061 |
&prompt.root; <userinput>make check-old</userinput></screen> |
| 3062 |
|
| 3063 |
<para>If any obsolete files are found, they can be deleted using the |
| 3064 |
following commands:</para> |
| 3065 |
|
| 3066 |
<screen>&prompt.root; <userinput>make delete-old</userinput></screen> |
| 3067 |
|
| 3068 |
<tip> |
| 3069 |
<para>See <filename>/usr/src/Makefile</filename> |
| 3070 |
for more targets of interest.</para> |
| 3071 |
</tip> |
| 3072 |
|
| 3073 |
<para>A prompt is displayed before deleting each obsolete file. You can |
| 3074 |
skip the prompt and let the system remove these files automatically by |
| 3075 |
using the <makevar>BATCH_DELETE_OLD_FILES</makevar> make-variable as |
| 3076 |
follows:</para> |
| 3077 |
|
| 3078 |
<screen>&prompt.root; <userinput>make -DBATCH_DELETE_OLD_FILES delete-old</userinput></screen> |
| 3079 |
|
| 3080 |
<para>You can also achieve the same goal by piping these commands through |
| 3081 |
<command>yes</command> like this:</para> |
| 3082 |
|
| 3083 |
<screen>&prompt.root; <userinput>yes|make delete-old</userinput></screen> |
| 3084 |
|
| 3085 |
<warning> |
| 3086 |
<title>Warning</title> |
| 3087 |
<para>Deleting obsolete files will break applications that still |
| 3088 |
depend on those obsolete files. This is especially true for old |
| 3089 |
libraries. In most cases, you need to recompile the programs, ports, |
| 3090 |
or libraries that used the old library before <command>make |
| 3091 |
<maketarget>delete-old-libs</maketarget></command> is executed.</para> |
| 3092 |
</warning> |
| 3093 |
|
| 3094 |
<para>Utilities for checking shared library dependencies are available from |
| 3095 |
the Ports Collection in <filename |
| 3096 |
role="package">sysutils/libchk</filename> or <filename |
| 3097 |
role="package">sysutils/bsdadminscripts</filename>.</para> |
| 3098 |
|
| 3099 |
<para>Obsolete shared libraries can conflict with newer libraries, |
| 3100 |
causing messages like these:</para> |
| 3101 |
|
| 3102 |
<screen>/usr/bin/ld: warning: libz.so.4, needed by /usr/local/lib/libtiff.so, may conflict with libz.so.5 |
| 3103 |
/usr/bin/ld: warning: librpcsvc.so.4, needed by /usr/local/lib/libXext.so, may conflict with librpcsvc.so.5</screen> |
| 3104 |
|
| 3105 |
<para>To solve these problems, determine which port installed the |
| 3106 |
library:</para> |
| 3107 |
|
| 3108 |
<screen>&prompt.root; <userinput>pkg_info -W /usr/local/lib/libtiff.so</userinput> |
| 3109 |
/usr/local/lib/libtiff.so was installed by package tiff-3.9.4 |
| 3110 |
&prompt.root; <userinput>pkg_info -W /usr/local/lib/libXext.so</userinput> |
| 3111 |
/usr/local/lib/libXext.so was installed by package libXext-1.1.1,1</screen> |
| 3112 |
|
| 3113 |
<para>Then deinstall, rebuild and reinstall the port. The <filename |
| 3114 |
role="package">ports-mgmt/portmaster</filename> and <filename |
| 3115 |
role="package">ports-mgmt/portupgrade</filename> utilities can be used to |
| 3116 |
automate this process. After you've made sure that all ports are rebuilt |
| 3117 |
and do not use the old libraries anymore, you can delete them using the |
| 3118 |
following command:</para> |
| 3119 |
|
| 3120 |
<screen>&prompt.root; <userinput>make delete-old-libs</userinput></screen> |
| 3121 |
</sect1> |
| 3122 |
|
| 3123 |
<sect1 id="small-lan"> |
3150 |
<sect1 id="small-lan"> |
| 3124 |
<sect1info> |
3151 |
<sect1info> |
| 3125 |
<authorgroup> |
3152 |
<authorgroup> |