Solved [Solved] Portmaster broken

I have just successfully upgraded to 10.0-STABLE but when I tried to recompile all my ports with portmaster -a -f -D -R I get:

Code:
/usr/local/sbin/portmaster: pkg_version: not found

===>>> pkg_version -t libevent-1.4.14b_2 libevent-1.4.14b_3 gave an unexpected result
===>>> Aborting update

===>>> Killing background jobs
Terminated

portmaster -L returns the following:

Code:
===>>> libevent-1.4.14b_2
/usr/local/sbin/portmaster: pkg_version: not found

===>>> pkg_version -t libevent-1.4.14b_2 libevent-1.4.14b_3 gave an unexpected result
===>>> Aborting update

How do I get ports-mgmt/portmaster working again so I can recompile all my ports on 10.0?
 
Re: Portmaster broken

Ok. So I ran /usr/sbin/pkg successfully. The next step was to run pkg2ng but I get the error:
Code:
pkg2ng: Command not found.

Did I miss something? I didn't get any errors.

Edit: My bad, I just ran it with the full path and it is busy running: /usr/local/sbin/pkg2ng
 
Re: Portmaster broken

Thanks for the tip!

The conversion is complete. Do I use pkg now to rebuild all my ports so that they will work on 10.0?

If I try to run portmaster -a -f -D -R I get a new error:

Code:
===>>> All >> libiconv-1.14_1 (24/24)

===>>> Currently installed version: libiconv-1.14_1
===>>> Port directory: /usr/ports/converters/libiconv

        ===>>> This port is marked IGNORE
        ===>>> converters/libiconv should not be used with iconv from base.  Please fix the port which tries to use it


        ===>>> If you are sure you can build it, remove the
               IGNORE line in the Makefile and try again.

===>>> Update for libiconv-1.14_1 failed
===>>> Aborting update

===>>> Killing background jobs
 
Re: Portmaster broken

The conversion is complete. Do I use pkg now to rebuild all my ports so that they will work on 10.0?

No. pkg(7) is for package management. Every port that you install on your system is a package. Just because pkg(7) can download binary packages somebody else built does not mean you have to use them. Continue to use portmaster.

As for libiconv, see /usr/ports/UPDATING, entry 20130904.
 
Re: Portmaster broken

Thank you.

So its a matter of just running pkg upgrade and then pkg autoremove?

Edit: I just ran pkg upgrade and it wants to install/reinstall 95 packages. One thing I have noticed is that it wants to install older versions of some software I use such as Perl, PHP and db42. Why is this? For example I run Perl 5.18.2 but it wants to install Perl 5.16.3_6?

Should I rather run:
Code:
pkg query %ro libiconv >ports_to_update
pkg delete -f libiconv
cat ports_to_update | xargs portmaster
 
Re: Portmaster broken

So I ran the following fine:
Code:
pkg query %ro libiconv >ports_to_update
pkg delete -f libiconv

But when I run cat ports_to_update | xargs portmaster I get:

Code:
Shared object "libstdc++.so.6" not found, required by "mysql"
make: "/usr/ports/Mk/bsd.database.mk" line 118: warning: Couldn't read shell's output for "/usr/local/bin/mysql --version | /usr/bin/sed -e 's/.*Distrib \([0-9]\)\.\([0-9]*\).*/\1\2/'"
Shared object "libstdc++.so.6" not found, required by "mysql"
Shared object "libstdc++.so.6" not found, required by "mysql"
Shared object "libstdc++.so.6" not found, required by "mysql"
make: "/usr/ports/Mk/bsd.database.mk" line 118: warning: Couldn't read shell's output for "/usr/local/bin/mysql --version | /usr/bin/sed -e 's/.*Distrib \([0-9]\)\.\([0-9]*\).*/\1\2/'"
Shared object "libstdc++.so.6" not found, required by "mysql"
Shared object "libstdc++.so.6" not found, required by "mysql"
Shared object "libstdc++.so.6" not found, required by "mysql"
make: "/usr/ports/Mk/bsd.database.mk" line 118: warning: Couldn't read shell's output for "/usr/local/bin/mysql --version | /usr/bin/sed -e 's/.*Distrib \([0-9]\)\.\([0-9]*\).*/\1\2/'"
Shared object "libstdc++.so.6" not found, required by "mysql"
Shared object "libstdc++.so.6" not found, required by "mysql"
Shared object "libstdc++.so.6" not found, required by "mysql"
make: "/usr/ports/Mk/bsd.database.mk" line 118: warning: Couldn't read shell's output for "/usr/local/bin/mysql --version | /usr/bin/sed -e 's/.*Distrib \([0-9]\)\.\([0-9]*\).*/\1\2/'"
Shared object "libstdc++.so.6" not found, required by "mysql"
Shared object "libstdc++.so.6" not found, required by "mysql"
        ===>>> This port is marked IGNORE
        ===>>> cannot install: unknown MySQL version:


        ===>>> If you are sure you can build it, remove the
               IGNORE line in the Makefile and try again.

===>>> Update for dovecot2-2.2.9 failed
===>>> Aborting update

===>>> Update for mail/postfix failed
===>>> Aborting update

===>>> Killing background jobs
Terminated
===>>> Exiting

I'm stumped! What do I do next?
 
Re: Portmaster broken

The funny thing is if I run locate libstdc++.so.6 it does find these files:

/usr/lib/libstdc++.so.6
/usr/lib32/libstdc++.so.6

So why can't portmaster run to rebuild/recompile all my ports?
 
Re: Portmaster broken

xy16644 said:
Thank you.

So its a matter of just running pkg upgrade and then pkg autoremove?

No. That would download binary packages. If you want to continue to use ports, use portmaster, or make install in a port directory.

I suggest you stop throwing commands at the system and think about this for a bit. There are several things you have to accomplish.

1. Install and switch to pkg(7). This will handle tracking of packages (ports you have compiled and installed).
2. Get a list of all the old "origin" ports on the system with portmaster --list-origins > ~/installed-port-list. Save that list, it's important. Make a backup copy. This is part of the portmaster(8) procedure.
3. Delete all installed packages (these are ports you installed). This is part of the portmaster(8) procedure (although with pkg, it will be pkg delete -a).
4. Rebuild and reinstall all the ports that were installed. This is part of the portmaster(8) procedure.

So far, you have accomplished #1 and maybe #2. Then you veered off into binary packages. Don't do that if you want to use ports.
 
Re: Portmaster broken

xy16644 said:
The funny thing is if I run locate libstdc++.so.6 it does find these files:

/usr/lib/libstdc++.so.6
/usr/lib32/libstdc++.so.6

locate(1) can often report files that have already been deleted. Please read the manual page to see why.
 
Re: Portmaster broken

Hi @wblock@, I really appreciate your post and help. I think I got ahead of myself last night!
1. Install and switch to pkg(7). This will handle tracking of packages (ports you have compiled and installed).

This has been done and I had no errors during this process.

2. Get a list of all the old "origin" ports on the system with portmaster --list-origins > ~/installed-port-list. Save that list, it's important. Make a backup copy. This is part of the portmaster(8) procedure.

This has also been done.

This is where I start to get a bit nervous. Before continuing, one important question: By doing this will my config/settings be kept?

3. Delete all installed packages (these are ports you installed). This is part of the portmaster(8) procedure (although with pkg, it will be pkg delete -a).

4. Rebuild and reinstall all the ports that were installed. This is part of the portmaster(8) procedure.

I just wanted to summarise the steps to make sure I am doing this correctly:

  1. portmaster --clean-distfiles-all
  2. portmaster --check-port-dbdir
  3. portmaster -Faf
  4. pkg delete -a
  5. rm -rf /usr/local/lib/compat/pkg
  6. portmaster `cat installed-port-list`

So will this delete ALL my installed ports, reinstall them AND keep my config/settings?
 
Last edited by a moderator:
Re: Portmaster broken

xy16644 said:
This is where I start to get a bit nervous. Before continuing, one important question: By doing this will my config/settings be kept?

3. Delete all installed packages (these are ports you installed). This is part of the portmaster(8) procedure (although with pkg, it will be pkg delete -a).

Make a copy of /usr/local/etc to copy config files. Port options are kept in /var/db/ports, which this process does not remove. Still, it would not hurt to make a backup copy of that directory also.

I just wanted to summarise the steps to make sure I am doing this correctly:

  1. portmaster --clean-distfiles-all
  2. portmaster --check-port-dbdir
  3. portmaster -Faf
  4. pkg delete -a
  5. rm -rf /usr/local/lib/compat/pkg
  6. portmaster `cat installed-port-list`

The procedure shown looks like an older version of portmaster. The current one has:
Code:
           1. portmaster --list-origins > ~/installed-port-list
           2. Update your ports tree
           3. portmaster -ty --clean-distfiles
           4. portmaster --check-port-dbdir
           5. portmaster -Faf
           6. pkg_delete -a
           7. rm -rf /usr/local/lib/compat/pkg
           8. Back up any files in /usr/local you wish to save,
              such as configuration files in /usr/local/etc
           9. Manually check /usr/local and /var/db/pkg
              to make sure that they are really empty
           10. Re-install portmaster
           11. portmaster `cat ~/installed-port-list`

So will this delete ALL my installed ports, reinstall them AND keep my config/settings?

That's the plan, yes. Backup copies of the installed port list, /usr/local/etc, and /var/db/ports are in case something goes wrong.
 
Re: Portmaster broken

Ok, I got to step 6. with pkg delete -a and got the following scary warning:

Code:
pkg: Deleting 'ports-mgmt/pkg' is really dangerous. If that is really required, -f must be specified
 
Re: Portmaster broken

pkg is one of the installed ports, so it needs to be deinstalled. Which, come to think of it, ought to be one of the things updated on that list:

Code:
6. pkg delete -af
9 Re-install ports-mgmt/pkg and then ports-mgmt/portmaster
 
Re: Portmaster broken

So this step should be ignored:

Manually check /usr/local and /var/db/pkg to make sure that they are really empty.
 
Re: Portmaster broken

Actually, no. That instruction is to make sure there are no old files left. In this case, you want to keep the old files in /usr/local/etc. Getting rid of /var/db/pkg would not be bad, the old package database is probably still there.
 
Re: Portmaster broken

wblock@ said:
Actually, no. That instruction is to make sure there are no old files left. In this case, you want to keep the old files in /usr/local/etc. Getting rid of /var/db/pkg would not be bad, the old package database is probably still there.

I have left /usr/local/etc alone since I want to keep all my config settings etc. I did however remove the contents of /var/db/pkg with rm -r /var/db/pkg/. Portmaster and pkg were reinstalled.

I then started to run portmaster `cat installed-port-list` but when it got to Perl it wanted to install version 5.16...huh? I have/had 5.18 on my machine. I still don't understand why it is trying to install on older version of Perl? Its not the end of the world as I can upgrade it afterwards but I would like to understand WHY it is doing this. From day one of installing this server I have been running Perl 5.18.

It seems to want to install a couple older ports like db4 as well.
 
Re: Portmaster broken

Perl 5.16 is the standard Perl port at present. The db4 situation is a little less clear. One way to do it is to manually install the non-standard ports you want to use first. When the leaf ports look for a dependency like Perl, they see the version that is already installed.

To do that, you might have to edit the list of ports given to portmaster. I would not use nonstandard ports unless there was a good reason.
 
Re: Portmaster broken

wblock@ said:
Perl 5.16 is the standard Perl port at present. The db4 situation is a little less clear. One way to do it is to manually install the non-standard ports you want to use first. When the leaf ports look for a dependency like Perl, they see the version that is already installed.

To do that, you might have to edit the list of ports given to portmaster. I would not use nonstandard ports unless there was a good reason.

What do you mean by a "non standard" port? Is it considered non-standard to use newer versions of ports?

Well, I have some good news! It looks like all my ports are working again on 10.0-STABLE now. I'm a happy bunny :) A huge thank you to @wblock@ for all his assistance and patience in helping me with this problem.

I thought I'd summarise what I did to get this all working again:

  1. portmaster --list-origins > installed-port-list
  2. Update your ports tree
  3. portmaster -ty --clean-distfiles
  4. portmaster --check-port-dbdir
  5. portmaster -Faf
  6. pkg delete -af
  7. rm -rf /usr/local/lib/compat/pkg
  8. Back up any files in /usr/local you wish to save, such as configuration files in /usr/local/etc and maybe /var/db/pkg as well to be safe
  9. Remove contents from /var/db/pkg
  10. Re-install ports-mgmt/pkg and then ports-mgmt/portmaster
  11. The next bit depends on the ports you have installed but I manually installed db5, Perl 5.18, Apache 2.4 and PHP 5.5 Once that was done I did the next step which is...
  12. portmaster `cat installed-port-list`

I then rebooted and after a very quick test (I'm doing this during my lunch hour!) I can now access the network services on my server.

Hope this helps someone!
 
Last edited by a moderator:
Re: Portmaster broken

xy16644 said:
wblock@ said:
Perl 5.16 is the standard Perl port at present. The db4 situation is a little less clear. One way to do it is to manually install the non-standard ports you want to use first. When the leaf ports look for a dependency like Perl, they see the version that is already installed.

To do that, you might have to edit the list of ports given to portmaster. I would not use nonstandard ports unless there was a good reason.

What do you mean by a "non standard" port? Is it considered non-standard to use newer versions of ports?

"Default version" is probably a better term. At present, Perl 5.16 is the default version. The newer 5.18 is apparently different enough that it surprises people.

Well, I have some good news! It looks like all my ports are working again on 10.0-STABLE now. I'm a happy bunny :) A huge thank you to @wblock@ for all his assistance and patience in helping me with this problem.

Thank you for sticking with it. In addition to getting it working now, it will be easier the next time.
 
Last edited by a moderator:
Back
Top