{"id":4380,"date":"2015-12-06T16:32:47","date_gmt":"2015-12-06T16:32:47","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=4380"},"modified":"2021-07-09T15:50:47","modified_gmt":"2021-07-09T15:50:47","slug":"freebsd-update","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=4380","title":{"rendered":"freebsd-update"},"content":{"rendered":"<p><a href=\"https:\/\/www.freebsd.org\/doc\/handbook\/updating-upgrading-freebsdupdate.html\">FreeBSD Update<\/a><br \/>\n<a href=\"https:\/\/www.freebsd.org\/doc\/de_DE.ISO8859-1\/books\/handbook\/updating-upgrading-freebsdupdate.html\">FreeBSD-Update<\/a> (de)<br \/>\n<a href=\"https:\/\/www.freebsd.org\/doc\/en_US.ISO8859-1\/books\/handbook\/updating-upgrading-freebsdupdate.html\">FreeBSD Update<\/a> (en)<\/p>\n<p><a href=\"http:\/\/www.zytrax.com\/tech\/survival\/freebsd-update.html#updates\">Tech Stuff &#8211; FreeBSD Update Survival Guide<\/a><\/p>\n<p><a href=\"http:\/\/www.zomo.co.uk\/2013\/03\/freebsd-update-and-custom-kernels\/\">freebsd-update and custom kernels<\/a><\/p>\n<p>Upgrades from one minor version of FreeBSD to another, like from <code>FreeBSD 9.0<\/code> to <code>FreeBSD 9.1<\/code>, are called <strong>minor version<\/strong> upgrades. <strong>Major version<\/strong> upgrades occur when FreeBSD is upgraded from one <strong>major version<\/strong> to another, like from <code>FreeBSD 9.X<\/code> to <code>FreeBSD 10.X<\/code>. Both types of upgrades can be performed by providing <code>freebsd-update<\/code> with a release version target.<\/p>\n<h3>Upgrade to a new Patch-Level<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nFreeBSD 12.0-RELEASE-p9 GENERIC\r\n$ freebsd-update fetch\r\n$ freebsd-update install\r\n$ reboot\r\n\r\nFreeBSD 12.0-RELEASE-p10 GENERIC\r\n$  freebsd-version -kru\r\n-k   version and patch level of the installed kernel\r\n-r   version and patch level of the running kernel\r\n-u   version and patch level of the installed userland\r\n<\/pre>\n<h3>12.0 to 12.2<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# freebsd-update upgrade -r 12.2-RELEASE\r\nsrc component not installed, skipped\r\nLooking up update.FreeBSD.org mirrors... 2 mirrors found.\r\nFetching metadata signature for 12.0-RELEASE from update2.freebsd.org... done.\r\nFetching metadata index... done.\r\nFetching 2 metadata patches.. done.\r\nApplying metadata patches... done.\r\nInspecting system... done.\r\n\r\nThe following components of FreeBSD seem to be installed:\r\nkernel\/generic kernel\/generic-dbg world\/base world\/doc world\/lib32\r\n\r\nThe following components of FreeBSD do not seem to be installed:\r\nworld\/base-dbg world\/lib32-dbg\r\n\r\nDoes this look reasonable (y\/n)? y\r\n\r\nFetching metadata signature for 12.2-RELEASE from update2.freebsd.org... done.\r\nFetching metadata index... done.\r\nFetching 1 metadata patches. done.\r\nApplying metadata patches... done.\r\nFetching 1 metadata files... done.\r\nInspecting system... done.\r\nFetching files from 12.0-RELEASE for merging... done.\r\nPreparing to download files... done.\r\nFetching 10713 patches... &#x5B;...]\r\nApplying patches... done.\r\nFetching 11146 files... done.\r\nAttempting to automatically merge changes in files... done.\r\n\r\nThe following changes, which occurred between FreeBSD 12.0-RELEASE and\r\nFreeBSD 12.2-RELEASE have been merged into \/etc\/group:\r\n&#x5B;...]\r\nDoes this look reasonable (y\/n)? y\r\n\r\nThe following changes, which occurred between FreeBSD 12.0-RELEASE and\r\nFreeBSD 12.2-RELEASE have been merged into \/etc\/master.passwd:\r\n&#x5B;...]\r\nDoes this look reasonable (y\/n)? y\r\n\r\nThe following changes, which occurred between FreeBSD 12.0-RELEASE and\r\nFreeBSD 12.2-RELEASE have been merged into \/etc\/passwd:\r\n&#x5B;...]\r\nDoes this look reasonable (y\/n)? y\r\n\r\nThe following changes, which occurred between FreeBSD 12.0-RELEASE and\r\nFreeBSD 12.2-RELEASE have been merged into \/etc\/profile\r\n&#x5B;...]\r\nDoes this look reasonable (y\/n)? y\r\n\r\nThe following files are affected by updates, but no changes have\r\nbeen downloaded because the files have been modified locally:\r\n&#x5B;...]\r\nThe following files will be removed as part of updating to 12.2-RELEASE-p9:\r\n&#x5B;...]\r\nThe following files will be added as part of updating to 12.2-RELEASE-p9:\r\n&#x5B;...]\r\nThe following files will be updated as part of updating to 12.2-RELEASE-p9:\r\n&#x5B;...]\r\nTo install the downloaded upgrades, run &quot;\/usr\/sbin\/freebsd-update install&quot;.\r\n<\/pre>\n<h3>Upgrade to a new Release Version<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ uname -a\r\nFreeBSD gateway 10.0-RELEASE &#x5B;...] GENERIC  amd64\r\n\r\n$ freebsd-update upgrade -r 10.2-RELEASE\r\n$ \/usr\/sbin\/freebsd-update install\r\n$ reboot\r\n$ \/usr\/sbin\/freebsd-update install\r\n$ pkg upgrade -f\r\n$ \/usr\/sbin\/freebsd-update install\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ uname -a\r\nFreeBSD ns2.te-clan.ch 10.1-RELEASE &#x5B;...] NS2-BACHI-NET  amd64\r\n\r\n$ df\r\nFilesystem  1K-blocks    Used    Avail Capacity  Mounted on\r\n\/dev\/ada0p2   2031132  969868   898776    52%    \/      &lt;== includes \/boot\r\n                                                            kernel uses ca. 450 MB\r\ndevfs               1       1        0   100%    \/dev\r\n\/dev\/ada0p3   8106716  452652  7005528     6%    \/var\r\n\/dev\/ada0p4   4053308   35020  3694024     1%    \/tmp\r\n\/dev\/ada0p6  64995324 7673760 52121940    13%    \/usr\r\n\/dev\/ada0p7  42651260   32836 39206324     0%    \/web\r\n\/dev\/ada0p8  26396824   32836 24252244     0%    \/db\r\ndevfs               1       1        0   100%    \/var\/named\/dev\r\n\r\n$ cd \/usr\/src\r\n$ make kernel __MAKE_CONF=\/dev\/null SRCCONF=\/dev\/null\r\n\/boot\/kernel\/kernel        &lt;- GENERIC kernel\r\n\/boot\/kernel.old\/kernel    &lt;- your kernel\r\n\r\n$ rsync -a \/boot\/kernel \/boot\/GENERIC\r\n$ rm \/boot\/kernel\r\n$ mv \/boot\/kernel.old \/boot\/kernel\r\n\r\n$ sysctl -n kern.bootfile\r\n\/boot\/kernel.old\/kernel\r\n\r\n$ sysctl kern.bootfile=\/boot\/kernel\/kernel\r\nkern.bootfile: \/boot\/kernel.old\/kernel -&gt; \/boot\/kernel\/kernel\r\n\r\n$ sysctl -n kern.bootfile\r\n\/boot\/kernel\/kernel\r\n\r\n$ freebsd-update upgrade -r 10.2-RELEASE\r\nLooking up update.FreeBSD.org mirrors... none found.\r\nFetching public key from update.FreeBSD.org... done.\r\nFetching metadata signature for 10.1-RELEASE from update.FreeBSD.org... done.\r\nFetching metadata index... done.\r\nFetching 2 metadata files... done.\r\nInspecting system... done.\r\n\r\nWARNING: This system is running a &quot;ns2-bachi-net&quot; kernel, which is not a\r\nkernel configuration distributed as part of FreeBSD 10.1-RELEASE.\r\nThis kernel will not be updated: you MUST update the kernel manually\r\nbefore running &quot;\/usr\/sbin\/freebsd-update install&quot;.\r\n\r\nThe following components of FreeBSD seem to be installed:\r\nkernel\/generic src\/src world\/base world\/doc world\/lib32\r\n\r\nThe following components of FreeBSD do not seem to be installed:\r\nworld\/games\r\n\r\nDoes this look reasonable (y\/n)? y\r\n\r\nFetching metadata signature for 10.2-RELEASE from update4.freebsd.org... done.\r\nFetching metadata index... done.\r\nFetching 1 metadata patches. done.\r\nApplying metadata patches... done.\r\nFetching 1 metadata files... done.\r\nInspecting system... done.\r\nFetching files from 10.1-RELEASE for merging... done.\r\nPreparing to download files... done.\r\nFetching 39913 patches.....10....20....30....40....50....60\r\n&#x5B;...]\r\nApplying patches... done.\r\nFetching 6731 files... done.\r\nAttempting to automatically merge changes in files... done.\r\n\r\nThe following file could not be merged automatically: \/etc\/dhclient.conf\r\nPress Enter to edit this file in vi and resolve the conflicts\r\nmanually...\r\n\r\nThe following files are affected by updates, but no changes have\r\nbeen downloaded because the files have been modified locally:\r\n\/.profile\r\n\/root\/.profile\r\n\r\nThe following files will be removed as part of updating to 10.2-RELEASE-p8:\r\n&#x5B;...]\r\nTo install the downloaded upgrades, run &quot;\/usr\/sbin\/freebsd-update install&quot;.\r\n\r\n$ \/usr\/sbin\/freebsd-update install\r\nInstalling updates...\r\nKernel updates have been installed.  Please reboot and run\r\n&quot;\/usr\/sbin\/freebsd-update install&quot; again to finish installing updates.\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ sudo freebsd-update upgrade -r 9.1-RELEASE\r\n\r\n&#x5B; warnings about custom kernel ]\r\n\r\n$ sudo freebsd-update install\r\n\r\n&#x5B; this is when the new generic kernel is installed if we weren't running a custom kernel ]\r\n\r\n$ cd \/usr \r\n$ mv src{,-8.2}\r\n$ sudo svn co https:\/\/svn.freebsd.org\/base\/releng\/9.1\/\r\n$ sudo cp src{-8.2,}\/sys\/i386\/conf\/PULP\r\n$ cd src\r\n\r\n$ sudo rsync -a \/boot\/kernel{,-8.2}\/\r\n$ sudo make kernel-toolchain\r\n$ sudo make buildkernel KERNCONF=PULP\r\n$ sudo make installkernel KERNCONF=PULP\r\n\r\n$ sudo reboot\r\n\r\n$ sudo freebsd-update install\r\n$ sudo reboot\r\n<\/pre>\n<h3>Custom kernel in loader.conf<\/h3>\n<p><a href=\"https:\/\/lists.freebsd.org\/pipermail\/freebsd-questions\/2012-August\/244219.html\">How to keep freebsd-update from trashing custom kernel?<\/a><br \/>\n<a href=\"https:\/\/www.freebsd.org\/doc\/handbook\/boot-introduction.html\">FreeBSD Boot Process<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nJust an idea, not tested: Leave the GENERIC kernel updated\r\nby freebsd-update, and put your own kernel unter a different\r\nname into \/boot, for example:\r\n\r\n\t\/boot\/kernel\/kernel\t\t&lt;- GENERIC kernel\r\n\t\/boot\/mykernel\/kernel\t\t&lt;- your kernel\r\n\r\nThen change \/boot\/loader.conf to contain:\r\n\r\n\tkernel=&quot;mykernel&quot;\r\n\tbootfile=&quot;\/boot\/mykernel\/kernel&quot;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>FreeBSD Update FreeBSD-Update (de) FreeBSD Update (en) Tech Stuff &#8211; FreeBSD Update Survival Guide freebsd-update and custom kernels Upgrades from one minor version of FreeBSD to another, like from FreeBSD 9.0 to FreeBSD 9.1, are called minor version upgrades. Major version upgrades occur when FreeBSD is upgraded from one major version to another, like from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4380","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/4380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4380"}],"version-history":[{"count":16,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/4380\/revisions"}],"predecessor-version":[{"id":4384,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/4380\/revisions\/4384"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}