Solved ports-mgmt/pkg Upgrade Issue?

I originally installed ports-mgmt/pkg by doing /usr/sbin/pkg bootstrap and now I'm not sure how to upgrade it.

I'm using ports-mgmt/synth to maintain my ports, but the port does not exist in my custom repo. I do not want to install it from the FreeBSD repo, as the I will run into dependency hell.
Code:
$ pkg version -v
...
pkg-1.10.1                         <   needs updating (index has 1.10.2)

$ sudo synth build ports-mgmt/pkg
There are no valid ports to build.  (Synth must exit)
What should I try next?
 
There are no valid ports to build. (Synth must exit)

That message means the port is already built. If there is no update for that pkg available it is because you already have the pkg version present in the repository installed.

So, did you updated the ports tree?
 
If you are using ports-mgmt/synth the first thing to do after the installation and configuration is -> synth prepare-system what will build the initial repository based on your installed packages, including pkg. So, ports-mgmt/pkg should be in the ports-mgmt/synth repository regardless of how you installed it initially.

Does the ports-mgmt/synth config is pointing to the right ports tree path?

Just for the record, I just built the last ports-mgmt/pkg in here using ports-mgmt/poudriere.
 
If you are using ports-mgmt/synth the first thing to do after the installation and configuration is -> synth prepare-system what will build the initial repository based on your installed packages, including pkg.


That's not how I did it. When I upgraded FreeBSD to 10.4, I used these steps. My "build.list" did not include PKG.
Code:
su
screen
cd /var/synth/live_packages/All
rm -rf *.txz
portsnap fetch update
synth just-build `cat /home/build.list`
synth rebuild-repository
pkg delete -af
/usr/sbin/pkg bootstrap
pkg install `cat /home/build.list`
My 00_synth.conf file only contains :
Code:
# Automatically generated.
Synth: {
  url      : file:///var/synth/live_packages,
  priority : 0,
  enabled  : yes,
}
 
Yeah, I tried that before posting here.
Code:
$ pkg upgrade
Updating Synth repository catalogue...
Synth repository is up to date.
All repositories are up to date.
Checking for upgrades (2 candidates): 100%
Processing candidates (2 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
 
IIRC, the 00_synth.conf file does include the issue to disable the FreeBSD repository in it. If it is not in there, is the FreeBSD repository disabled?

So, you did it in the most complicated way you could think, doesn't you? :rolleyes:

Code:
su
screen
cd /var/synth/live_packages/All
rm -rf *.txz
portsnap fetch update
synth just-build `cat /home/build.list`
synth rebuild-repository
pkg delete -af
/usr/sbin/pkg bootstrap
pkg install `cat /home/build.list`

What you are telling in there, is you are using a repository builder to create your own local repository but selecting what should be included in that and what is not... whats does no make too much sense for general usage.

Take a look on the Synth Guide, if you did not already.

My advise would be to run:

synth configure (to see if you want or need to change something)
synth prepare-system (to actually build everything)
pkg upgrade

PS. you would not need to issue synth rebuild-repository because prepare-system already does that.

EDIT: unless you are using port-mgmt/synth profiles to build packages for different machines, when the ports list is the way to go. :)
 
is the FreeBSD repository disabled?

Yes, I disabled it by following the instructions in the /etc/pkg/FreeBSD.conf file.

What you are telling in there, is you are using a repository builder to create your own local repository but selecting what should be included in that and what is not... whats does no make too much sense for general usage.

I do it this way because I need to enable custom build options for nginx, apache, postfix, dovecot, etc.

synth prepare-system (to actually build everything)
pkg upgrade
Thank you, this solved the issue!
 
Mayhem30

To build something with custom options while using ports-mgmt/synth you just need to configure the options, ie:

make -C /usr/ports/www/nginx config

And later run:

synth prepare-system

To update all affected packages.

It is also a good idea to run /bin/sh /usr/ports/Tools/scripts/redundant-opt-files.sh from time-to-time to remove eventual configs in /var/db/ports what actually are default ones.

I used to have that command set on cron(8).
 
Thank you for the script, I'll save that for later. I just recently deleted all the configs and just rebuilt the ones I knew I needed. However, that script should save me a bunch of time next go around.

I noticed synth will also give a warning message if your saved config matches the ports default settings. I believe I had to delete 12 of those when Synth was first installed.
 
That warning message happens when the options set differ from the upstream. I mean, you had set options for a port and later the available options changed upstream, and ports-mgmt/synth force you to review and fix that.

That alone is a good reason to keep /var/db/ports clean of ports set with default options, or you will get that warning more and more often - unnecessary.
 
Back
Top