# "freebsd-update fetch" stops at the editor vi



## pavlar (Dec 14, 2018)

After upgrading 11.2 to 12.0  is problem:

```
sudo freebsd-update fetch
Password:
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 12.0-RELEASE from update4.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.
...skipping...
~
~
~
~
~
~
~
~
~
~
~
~
~
~
............
etc etc
```
Until I enter :q
No updates needed to update system to 12.0-RELEASE-p0


----------



## meine (Dec 14, 2018)

pavlar said:


> After upgrading 11.2 to 12.0  is problem



Did you do all the necessary commands and in the right order?

See for example https://www.cyberciti.biz/open-source/freebsd-12-released-here-is-how-to-upgrade-freebsd/"> for all consequetive steps -- e.g. `freebsd-update install` has to be repeated several times.

The vi-like output could be an incidental mix-up with the setting in your shell's rc file, as I noticed sometimes under 11.2. Just check if you properly escaped the builtin vi(1) command line editor  `# set -o vi`


----------



## pavlar (Dec 14, 2018)

meine said:


> Did you do all the necessary commands and in the right order?
> 
> See for example https://www.cyberciti.biz/open-source/freebsd-12-released-here-is-how-to-upgrade-freebsd/"> for all consequetive steps -- e.g. `freebsd-update install` has to be repeated several times.
> 
> The vi-like output could be an incidental mix-up with the setting in your shell's rc file, as I noticed sometimes under 11.2. Just check if you properly escaped the builtin vi(1) command line editor  `# set -o vi`


I did everything right. I don’t use vi at all and answered :q all its proposal during upgrading (for example change file mailer.conf)


----------



## Deleted member 30996 (Dec 15, 2018)

I get the same error running `# freebsd-update fetch`. It goes through the first step without any problems but when I press the down arrow key to see if anything has been downloaded I get the same thing as OP and had to use `:q` to get back to the command line. No other key combo worked for me.

This on a fresh build and first time running it.

It's a bug of some sort. When running ports-mgmt/portmaster to install security/wipe and security/rkhunter I had to do the same thing to get back to the command line.


----------



## meine (Dec 15, 2018)

pavlar said:


> I did everything right. I don’t use vi at all and answered :q all its proposal during upgrading (for example change file mailer.conf)



The upgrade forces you to review the file in question -- as far as I can remember, when prompted any keystroke opens vi / vim to review and change the conf file (so you leave the shell, and enter the editor). when in vi / vim, the only way to quit indeed is `:q`. vi is basic infrastructure to make such changes.

I don't know if the upgrade also _forces_ to make the proposed changes, and refuses to take a 'no' for an answer. Last days was the first time I did such upgrade for the first time...


----------



## Deleted member 30996 (Dec 15, 2018)

I just had ports-mgmt/portmaster successfully build x11-fm/xfe. At the end of the build I was presented with this screen:




To get from that screen back to the command line:



I had to use the `:q` command. I built x11-wm/fluxbox right before it and things went normally.

It's the same error I got before with wipe and rkhunter, the only difference being with rkhunter the colon symbol was already present. All I had to do was press q to get back to the command line. This behavior with the colon presented itself again at the end of the build for graphics/epdfview:





This is not normal behavior for using portmaster, is not consistent in happening every time and not something I've had to do before FreeBSD 12.


----------



## pavlar (Dec 17, 2018)

I think it's a bug and I have to wait for patches.For 3 years I have been consistently upgrading on the same server from 10.2 to 12.0 and so far there has been no such error in any version


----------



## Deleted member 30996 (Dec 17, 2018)

I never upgrade. I've always done a new build for every version or version bump and have always used ports. 

I successfully got it up and running but will probably wait before doing any others.


----------



## pavlar (Dec 18, 2018)

Today freebsd-update hangs for a long time and then gives the same message. In general, 12.0  at this stage is the worst release since 10.0


----------



## pavlar (Dec 18, 2018)

It seems to me that it is necessary to work on the 11th and wait for the 13th release, the 12th will be unsuccessful as Vista in the windows: from the very beginning, serious failures in freebsd-update  and in pkg upgrade


----------



## olafz (Dec 19, 2018)

I agree. Right now, I am trying to roll back by rebuilding everything from 11.2 sources. I do not trust `freebsd-update` to make a proper rollback.


----------



## forquare (Dec 19, 2018)

So to confirm, this is after the upgrade, and the upgrade went smoothly?

Is the required key combination 

```
:q<ENTER>
```

Or simply

```
:q
```

The default PAGER for 12.0-RELEASE has been changed from more(1) to less(1) (can't find any documentation other than a reply to this tweet, and I can see that reflected on my own boxes), so I wonder if it's the latter your seeing the colon is a red herring and actually it's just the 'q' quitting out?   If that works you could set your PAGER back to more(1) to restore original behavior.

Not saying that you don't have an issue, but I've got two boxes here (one went from 11.2-RELEASE-p6 to 12.0-RELEASE, the other went from 11.2-RELEASE-p5 (think) to 12.0-BETA2, then jumped each -BETA and -RC to 12.0-RELEASE) which don't have these issues.  Then again, I've only done fairly standard ZFS installations, binary updates with freebsd-update(8), and all of my packages are stock from the FreeBSD repository.


----------



## xtaz (Dec 19, 2018)

Neither. :q is to exit vi or vim. You just need to press q to exit less.


----------



## gkontos (Dec 19, 2018)

So, to wrap up. I did a fresh install of a FreeBSD 12.0-RELEASE. After completing the installation I run `feebsd-update fetch`

```
root@freebsd12:~ # freebsd-update fetch
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching public key from update4.freebsd.org... done.
Fetching metadata signature for 12.0-RELEASE from update4.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Preparing to download files... done.
```
At this point I was left in a less empty file where I had to type q

```
No updates needed to update system to 12.0-RELEASE-p0.
```

Given the fact that more has been changed by less I believe the behaviour is expected.


----------



## gkontos (Dec 19, 2018)

I believe this should be marked as solved.


----------



## SirDice (Dec 19, 2018)

Yep, it's due to PAGER being changed from more(1) to less(1). They both behave a little differently when the output is at the end.


----------



## pavlar (Dec 19, 2018)

gkontos said:


> I believe this should be marked as solved.


Let the developers make the patch. Why do we have to get rid of bugs for a clearly unsuccessful release


----------



## SirDice (Dec 19, 2018)

There is no bug. You're not "stuck" in vi(1). You're at the end of output that's paged through less(1) (less(1) actually understands a number of vi(1) commands, which is why ":q" works).


----------



## pavlar (Dec 19, 2018)

then let's call it a blunder. Does it change anything?Where is the guarantee that these errors at the very beginning do not form something like an avalanche of errors afterwards?I understand that no one is going to correct this error.It reminds me very much CentOS 6.0. Until CentOS 6.2 appeared it was impossible to work


----------



## gkontos (Dec 19, 2018)

pavlar said:


> then let's call it a blunder. Does it change anything?Where is the guarantee that these errors at the very beginning do not form something like an avalanche of errors afterwards?I understand that no one is going to correct this error.It reminds me very much CentOS 6.0. Until CentOS 6.2 appeared it was impossible to work



What errors are you referring to?


----------



## gkontos (Dec 19, 2018)

pavlar said:


> Let the developers make the patch. Why do we have to get rid of bugs for a clearly unsuccessful release



There is no need for a patch. Instead of hitting ENTER you now have to press q


----------



## pavlar (Dec 19, 2018)

gkontos said:


> What errors are you referring to?


abnormal behavior freebsd-update  and pkg upgrade. Under normal behavior, do not press q or ENTER. For the pkg upgrade , see the relevant section of the forum.


----------



## gkontos (Dec 19, 2018)

pavlar said:


> abnormal behavior freebsd-update  and pkg upgrade



Since they decided to replace more with less, this is the expected behaviour.


```
The default PAGER now defaults to less(1) for most commands.
```


----------



## SirDice (Dec 19, 2018)

pavlar said:


> Under normal behavior, do not press q or ENTER.


Normal behavior is to respect PAGER. Which is exactly what it's doing now and has done before.


----------



## xtaz (Dec 19, 2018)

Yes. It used to do this before. You would have seen an empty screen with END at the end of it I think and then pressed enter. Nothing has changed in this respect. There is though an argument that if the file that is being paged is empty that it should just continue and not open the pager?


----------



## SirDice (Dec 19, 2018)

xtaz said:


> There is though an argument that if the file that is being paged is empty that it should just continue and not open the pager?


I haven't looked too closely at it but I suspect the script can't tell the difference beforehand and simply always pipes the output to PAGER. If you really want to know, /usr/sbin/freebsd-update is a shell script, so it's fairly easy to look at the actual code.


----------



## Deleted member 30996 (Dec 19, 2018)

xtaz said:


> Yes. It used to do this before. You would have seen an empty screen with END at the end of it I think and then pressed enter. Nothing has changed in this respect.



No, that's not the way it worked before.

At the end of the download process for `freebsd-update fetch` it sometimes "eats" the command and back a few lines of previously existing text in the terminal. I just ran:

`portsnap fetch update
pkg audit -F
freebsd-update fetch`

and this is the results in the terminal:




It jumped back 23 lines in the terminal. Now I have to hit q to get back to the normal readout:



And that is not normal behavior for using ports-mgmt/portmaster as shown above.

If this is the "new way", Change Bad, and editing the .profile file for root and usr to get back to `more` did not do it for me:


```
PAGER=more
MANPAGER="more -s"
```


----------

