DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 15th November 2020
TheTKS TheTKS is offline
Port Guard
 
Join Date: Sep 2018
Location: Canada
Posts: 42
Default Sysupgrade vs fresh installation

An observation about OpenBSD installations after running:
- On my desktop (x86_64): sysupgrade twice with a fresh installation in between (sysupgrade 6.5 => 6.6, new 6.7, then sysupgrade 6.7 => 6.8)
- On my Raspberry Pi 4 4GB: new 6.8

A really nice thing with OpenBSD is, once you've got the important steps down and the information handy, both sysupgrade and new installation go quickly compared to most (all?) other desktop OSs.

If you have as simple single-user desktop OS installations as I do, with very few non-default options chosen during installation and just a handful of packages added, and so few manual modifications to .conf files, and relatively few user files, there is little to no time savings to running sysupgrade vs a new installation, assuming you back up and copy back all relevant user and conf files.

I learned a couple of things running sysupgrade and the followup actions, but not much, as there really wasn't that much needed.

I expect the more changes from and additions to a base installation you do, the bigger the time savings.

That is probably beyond obvious for power users, but as a very light-duty user so far, this has only become apparent to me after running sysupgrade a couple of times.

TKS
Reply With Quote
  #2   (View Single Post)  
Old 15th November 2020
johnR johnR is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 57
Default

I've found that sysupgrade goes more smoothly on my desktop computer if I remove all packages using 'pkg_delete -X' first, then install them again manually afterwards. This saves time over a fresh install as it leaves the package conf dotfiles in place.

If I don't remove the packages first there's often a problem with the 'pkg_add -u' step, probably due to the large number of packages I use.

Last edited by johnR; 16th November 2020 at 09:01 AM. Reason: clarification
Reply With Quote
  #3   (View Single Post)  
Old 16th November 2020
bradley bradley is offline
Fdisk Soldier
 
Join Date: Jul 2020
Posts: 53
Default

Yes, I noticed before as well that there can be issues with pkg_add -u. At my first sysupgrade I did run the command but somehow some packages were not updated. However the recent sysupgrade was smooth and quick on a desktop machine. I really like this feature.

There is one thing I'd like to add: While using sysupgrade, don't forget fw_update after the reboot as there might be new firmware for the machine. In the documentation it's not pointed out at the "Unattended Upgrade" steps, only for "Manual Upgrade".

Last edited by bradley; 16th November 2020 at 02:24 AM. Reason: addendum
Reply With Quote
  #4   (View Single Post)  
Old 16th November 2020
blackhole's Avatar
blackhole blackhole is offline
Spam Deminer
 
Join Date: Mar 2014
Posts: 316
Default

Quote:
Originally Posted by johnR View Post
If I don't remove the packages first there's often a problem with the 'pkg_add -u' step, probably due to the large number of packages I use.
Quote:
Originally Posted by bradley View Post
Yes, I noticed before as well that there can be issues with pkg_add -u. At my first sysupgrade I did run the command but somehow some packages were not updated.
Refer to pkg_add(1). Specifically:

Quote:
-U Update dependencies if required before installing the new package(s).

-u Update the given installed pkgname(s), and anything it depends upon. If no pkgname is given, pkg_add will update all installed packages. This relies on PKG_PATH to figure out the new package names.
I usually run:
Code:
# pkg_add -Uu
# pkg_delete -a
Reply With Quote
  #5   (View Single Post)  
Old 16th November 2020
bradley bradley is offline
Fdisk Soldier
 
Join Date: Jul 2020
Posts: 53
Default

Quote:
Originally Posted by cynwulf View Post
Refer to pkg_add(1). Specifically:



I usually run:
Code:
# pkg_add -Uu
# pkg_delete -a
That -U makes sense to me. If I'm not mistaken, it wasn't available in earlier versions. Wondering if there are reasons for using only -u? What I'd use next time after a sysupgrade and reboot:

Code:
fw_update
pkg_add -vvvvviUu
pkg_delete -a
pkg_check -vvvvv
sysmerge
First a firmware update, -vvvvv is for output, which I like to read, -i is interactive mode (asks questions if there is something difficult), -a is for deleting unused dependencies and pkg_check I like to use for checking the consistency of all the installed packages (and indeed I had some dependency issues pointed out by pkg_check, a gtk package wanted to have the whole mate desktop, but it's ok now).

Last edited by bradley; 16th November 2020 at 07:39 PM.
Reply With Quote
  #6   (View Single Post)  
Old 16th November 2020
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 304
Default

Quote:
Originally Posted by bradley View Post
There is one thing I'd like to add: While using sysupgrade, don't forget fw_update after the reboot as there might be new firmware for the machine. In the documentation it's not pointed out at the "Unattended Upgrade" steps, only for "Manual Upgrade".
fw_upgrade is run by rc.firstime after upgrading (among other steps). You should see this in the emails the installer sends to root.
Reply With Quote
  #7   (View Single Post)  
Old 17th November 2020
TheTKS TheTKS is offline
Port Guard
 
Join Date: Sep 2018
Location: Canada
Posts: 42
Default

Quote:
Originally Posted by bradley View Post
That -U makes sense to me. If I'm not mistaken, it wasn't available in earlier versions. Wondering if there are reasons for using only -u? What I'd use next time after a sysupgrade and reboot:

Code:
fw_update
pkg_add -vvvvviUu
pkg_delete -a
pkg_check -vvvvv
sysmerge
First a firmware update, -vvvvv is for output, which I like to read, -i is interactive mode (asks questions if there is something difficult), -a is for deleting unused dependencies and pkg_check I like to use for checking the consistency of all the installed packages (and indeed I had some dependency issues pointed out by pkg_check, a gtk package wanted to have the whole mate desktop, but it's ok now).
I also saw fw_update run during sysupgrade, so you shouldn’t need to run it.

I’ll have to take a closer look at these pkg_add/delete/check steps the next time I get ready for a sysupgrade.

I did see a bunch of output running pkg_add -u, at first thinking that there might have been some errors. It turns out not, but one thing I learned is that pkg_add might leave a bunch of messages to delete a bunch of files which don’t exist. You should look at each one, to make sure.

TKS
Reply With Quote
  #8   (View Single Post)  
Old 17th November 2020
bradley bradley is offline
Fdisk Soldier
 
Join Date: Jul 2020
Posts: 53
Default

Indeed, I can remember those messages too, mostly about using the rm command couple of times (if I'm not mistaken being at the very end of the output).

Btw I checked /var/mail and did not find anything related to sysupgrade. After using this command and a reboot (as a sidenote it might be an idea to show a short notice before reboot) I tried fw_update and it did download some files, which means that somehow it did not run for me during sysupgrade. Otherwise I usually also update the ports tree:
Code:
cd /usr/ports
cvs -q up -Pd -rOPENBSD_6_8
Reply With Quote
  #9   (View Single Post)  
Old 18th November 2020
openletter openletter is offline
Real Name: Paul
New OpenBSD User
 
Join Date: Feb 2020
Posts: 23
Default

I am still very new to OpenBSD, but I have installed older versions, starting around 6.5, and upgraded all the way to 6.7.

My experience is that I consistently have issues getting pkg_add -u to complete as it usually hangs around 68% and I have to interrupt with Ctrl+C. When I then run pkg_add -u again, it completes stating everything is up to date. Running pkg_check after that says everything is ok.

For the upgrade to 6.8, after completing the upgrade I changed the /etc/installurl to a different one and the pkg_add -u completed without issue.

At my next upgrade I'll instead try using the -Uu options to see if anything changes.

Despite all of this, I haven't had any issues with the OS, itself (just my fat fingers and misconfigurations).

Note that the only packages installed are nano and dokuwiki plus their dependencies.
Reply With Quote
Old 5th December 2020
TheTKS TheTKS is offline
Port Guard
 
Join Date: Sep 2018
Location: Canada
Posts: 42
Default

Quote:
Originally Posted by bradley View Post
Btw I checked /var/mail and did not find anything related to sysupgrade.
Look for the mbox file.

In my case, I have two: an older one /root/mbox, a newer one /home/[user]/mbox.

The older one in /root is the original, from when I wiped my drive and did a clean installation of 6.7

The newer one is in /home/[user], I presume because I ran sysupgrade to 6.8 from within my user instance, that is (abbreviated steps, and I believe this is the right order):
[user]$ su -
[user]# sysupgrade
[user]# sysmerge
[user]# syspatch
then a bunch of
[user]# [pkg_add -options, pkg_delete -options, pkg_check -options]

With reboots, and doing what I needed to do from man afterboot and from https://www.openbsd.org/faq/upgrade68.html (read "After the Upgrade", and then read all the way to the end of the page!) fw_update ran during sysupgrade.

Which is why I concluded that, with my fairly simple setup, it probably takes me about the same amount of time to sysupgrade (both in man-minutes and start-to-finish time) as it does to back up files, do a fresh intstallation including Xfce and other 3rd party packages, and copy back user files.

I expect that with a more complicated setup, more users or more computers to upgrade, sysupgrade could be substantially faster, especially if you can automate some of the manual steps.

TKS
Reply With Quote
Old 24th February 2021
bradley bradley is offline
Fdisk Soldier
 
Join Date: Jul 2020
Posts: 53
Default

A week ago, after the 6.9 beta snapshot got available I upgraded via
Code:
sysupgrade -s
I can confirm two things:
1. I noticed that sysupgrade runs fw_update before reboot, but fw_update after reboot had two new recent firmwares installed. So it's definitely useful running it after reboot.
2. pkg_add -u did not update all packages for me. It took some hours to complete, but e.g. the Firefox package wasn't updated (the old version was still working fine). It was the same with otter-browser. I suspect there might be sometimes glitches with dependencies (e.g. it did not update qtconnectivity first). After pkg_check there were some dependency issues fixed. Updated those packages one by one.

Thinking about the process I'd try next time after sysupgrade finished and there was a reboot (btw it might be an idea to check the free space on /home first, but it's no problem to resume the downloads):
Code:
$ su -
# fw_update
# pkg_add -vvvvviUum
# pkg_delete -a
# pkg_check -vvvvv
# sysmerge
The -m for pkg_add is just about showing the progress meter. Checking the output is necessary as there are often recommendations which files/folders are obsolete and can be removed (obviously reading the official upgrade manual is important too).

I've got the impression - might be wrong though - that it might be a good idea to get a list of the manually installed packages (before running the final sysmerge) with

Code:
pkg_info -m
and running running pkg_add -u or pkg_add -uU (for packages with dependencies) one by one on these packages, in order to make sure that all the available updates get installed. pkg-delete -a and pkg_check again might be useful. At leas this is what worked for me nicely.

There is a useful tool called sysclean (in sysutils/sysclean), which lists obsolete files between OpenBSD upgrades.

Last edited by bradley; 24th February 2021 at 03:58 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sysupgrade fails on evbarm7hf (rasperry pi 2) milestone NetBSD Installation and Upgrading 10 26th April 2020 04:50 PM
Is there an update of sysupgrade available? darktrym NetBSD Package System (pkgsrc) 2 20th September 2019 04:59 PM
Fresh installation 6.1.2 amd64 freezes in the line "root device" divel NetBSD Installation and Upgrading 2 22nd November 2013 07:11 PM
Problems after fresh OpenBSD installation Destorni OpenBSD General 7 22nd March 2013 07:18 PM
Fresh PuTTY J65nko News 2 15th July 2011 02:03 AM


All times are GMT. The time now is 09:55 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick