# freebsd-update 7.0 to 7.1



## formaltux (Mar 25, 2009)

freebsd-update wants to merge /etc/hosts, answering 'n' to this: 'Does this look reasonable (y/n)?' question will abort the freebsd-update process, what? Also i'm a dumbass can someone explain how is manual merge done using vi?


Thanks.


----------



## CrazyFingers (Mar 25, 2009)

Similar issue here, doing freebsd-update from 7.0 to 7.1, the update process would whine about not being able to merge /etc/hosts and open vi to manually merge.  I am not a vi user, so this was a confusing pain.  I ended up just entering "ZZ" and then [enter], which closed vi and continued along.  When it was finished I did freebsd-update install, and it installed everything, and on a reboot it was FreeBSD 7.1-RELEASE-p4, happy happy.
However, my hosts file had a bunch of extra crap in it that I had to delete, but it didn't seem to break anything.
The section of the handbook that covers freebsd-update bumping to newer versions of the OS is a bit vague on this part of the upgrade process.


----------



## tangram (Mar 25, 2009)

Not using freebsd-update lately so don't recall how to deal with merges.

However if it's /etc/hosts simply don't update it. Only ident information changes and it will try to remove your customizations to the file.


----------



## formaltux (Mar 25, 2009)

Ok, figured this one out.

When freebsd-update tells you that it was unable to merge the given file automatically, you press Enter and then vi editor starts up. It will look similar to this: 

http://pastebin.com/m2d366a61

In my case I wanted to keep my original /etc/hosts intact, so I deleted lines: 1 and everything after line 5 (5 included).

After that command :wq! saved the file and quit vi.  .. on to the next file.

After all the files which freebsd-update wasn't able to merge automatically comes section witch automatic merges. freebsd-update will show you the file, lines prefixed with '-' are going to be removed and lines prefixed with '+' are going to be added.
If you are happy with the -/+ for given file then just answer 'Y'.

Quick vi howto:

 - There are two modes, insert mode and command mode,
   into insert mode you go by pressing key: i
   to go back to command mode you pres ESC.

 - To delete the line in vi, go to command mode
   go to desired line with the cursor and press: dd

 - To delete a single character in command mode press: x
   (cursor should be on that character)

 - To replace single character in command mode press: r
   and then type new character

 - some navigation(in command mode):
     Next Page     = CTRL + f
     Previous Page = CTRL + b 

 - To exit vi and save changes(in command mode) type:  :wq!

 - To exit vi without saving changes(in command mode) type:  :q!


----------



## SirDice (Mar 26, 2009)

formaltux said:
			
		

> - To exit vi and save changes(in command mode) type:  :wq!


Just <ESC>:wq will do fine. No need to force a quit.


----------

