upgrading to 14.0rc2, too big merge file?

While trying to upgrade from 13.2 to 14.0rc2, the system is asking me to resolve merge conflict for file /etc/ssh/moduli with vi.
My problem is mostly that the file is so big, that I can hardly find the markers and set the region to erase. (I am mostly a newbie with vi)... but just finding the markers seems hard. Is there a command I could type in an other shell tab to accept the new file? Or maybe some vi trick to help do the job.
 
As a newbie in vi things are difficult because there are two issues in parallel, one is the editor :).

You can find the marker by
  1. Enter the command mode by pressing the escape key
  2. Enter / followed by the string to search for.
  3. Press the enter key.
In case of the marker The search one of strings is /<<<</. There is an additional delimiter ">>>" and a separator line "----" or "====" - I am not sure which one.
EDIT: s replaced by /. May be I did too much search and replace with sed recently.
 
If the updater throws you to the editor, the file has already been merged and has changes that can't be automatically solved, so you have to manually edit that file. There's usually no "use the new version no matter what"-option at that point.

To get up to speed with vi(m) in under 2 minutes, glance over chapter 1 of vimtutor(1), which gives you the absolute basics that are sufficient for basic editing.
Another nice way to learn the basics is the "vim adventures" game at https://vim-adventures.com/

For the mere task of solving the diffs during upgrades:
- to search in vi(m) just hit '/' and type the search term (e.g. <<<) + enter. then you can jump from one match to the next by pressing 'n'.
- to delete the complete line use "dd", for multiple lines "Ndd" where N is the nuber of lines (e.g. 5dd deletes 5 lines)
- in most modern implementations of vi (and all vim) you can use the arrow keys to navigate the cursor, otherwise use h/j/k/l for left/down/up/right
- if you did something wrong, just 'u'ndo it
- write the file and quit vi(m) by entering ':wq'
 
What about to change default editor permanently or temporary (before upgrade)?

If you not familiar with 'vi' - just change a default editor to 'ee' or 'mcedit' before running freebsd-update.
The other editors instead vi may save your time.
In case of using csh as shell: run the command setenv EDITOR ee. It will set 'ee' as default editor for the current session.
 
While trying to upgrade from 13.2 to 14.0rc2, the system is asking me to resolve merge conflict for file /etc/ssh/moduli with vi.
My problem is mostly that the file is so big, that I can hardly find the markers and set the region to erase. (I am mostly a newbie with vi)... but just finding the markers seems hard. Is there a command I could type in an other shell tab to accept the new file? Or maybe some vi trick to help do the job.
I doubt you changed /etc/ssh/moduli. Just replace it with the new one.

etcupdate(8) has an option to "use theirs". Use that option.
 
Back
Top