NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: problem updating NetBSD via source

This works for me, always. I have upgraded several systems, several times from STABLE to CURRENT using this method.

       Updating an existing system (top

/Please remember to check src/UPDATING <> for the latest changes./

  1.  From the root of the source tree:

     $ cd /usr/src

  2. Build the toolchain:

     $ ./ -O ../obj -T ../tools -U -u tools

  3. Build the distribution:

     $ ./  -O ../obj -T ../tools -U -u distribution

  4. Build the kernel:

     $ ./  -O ../obj -T ../tools -U -u kernel=GENERIC

  5. Install the kernel:

         $ cd ../obj/sys/arch/<ARCH>/compile/GENERIC
         $ su
         # mv /netbsd /netbsd.old
         # cp netbsd /netbsd
  6. Reboot into the new kernel:

     # shutdown -r now

  7. Install the new userland:

         $ cd /usr/src
         $ su
         # ./ -O ../obj -T ../tools -U install=/
  8. Follow the instruction in the output for fixing obsolete files,
     for example:

         # /usr/src/usr.sbin/postinstall/postinstall -s /usr/src -d // fix 
defaults mtree obsolete
  9. Update <> /etc:

     # /usr/sbin/etcupdate -s /usr/src

 10. Optionally reboot to ensure all running services are using the new

     # shutdown -r now

In this example, the |-u| option indicates an update process, and the |-U| option allows the entire build by a non-root user followed with an install by root.

The build order (tools, distribution, kernel) is chosen to optimize the time for updating the source whenever problems occur. To ensure consistency, the process should be restarted from the beginning in the case of errors/cvs updates.


Stevie Lancaster wrote:
On Jun 08 16:07, Christian Baer wrote:
--------- snip -----------

built a new userland:
./ -U distribution (in /usr/src, not as root)
./ kernel=GENERIC

I ran into the first problems there because couldn't find any tools. The same thing happens BTW. if I type the command just like in the guide. So I did a
./ tools

--------- snip ------------

Hi Chris,

There is a very useful explaination in the NetBSD guide on

For example, it recommends the following to build the userland (I always do a 
mkdir /usr/obj and /usr/tools before):

./  -O ../obj -T ../tools -U -u distribution

But on the other hand, I never switched from stable to current.

Hope I could help a little bit.

Have a nice day!

Home | Main Index | Thread Index | Old Index