10.3->11.0 (after upgrade cannot use sudo and pkg)

IPTRACE

Well-Known Member

Reaction score: 24
Messages: 321

Hello!

After upgrade I cannot use sudo nad even pkg.
Is it a bug?

Code:
sudo: error in /usr/local/etc/sudo.conf, line 0 while loading plugin `sudoers_policy'
sudo: unable to load /usr/local/libexec/sudo/sudoers.so: Shared object "libpam.so.5" not found, required by "sudoers.so"
sudo: fatal error, unable to load plugins

Code:
Shared object "libssl.so.7" not found, required by "pkg"

I cannot log in as root. I always use sudo(8).
 
Last edited by a moderator:
OP
IPTRACE

IPTRACE

Well-Known Member

Reaction score: 24
Messages: 321

I can't. This system is on bhyve and I use console to get boot screen but ESC and others keys do not stop booting.
Boot delay is set to 0.
Is there any other option key to get single user mode?
 
OP
IPTRACE

IPTRACE

Well-Known Member

Reaction score: 24
Messages: 321

I have it (key 2 -digit). Headache to get single user mode.
 
OP
IPTRACE

IPTRACE

Well-Known Member

Reaction score: 24
Messages: 321

su does not work. I disabled to use root.
Ok, I'm in single user mode. What should I do to run properly pkg, sudo etc.?
 

Remington

Aspiring Daemon

Reaction score: 194
Messages: 562

Have you done proper mount and are you using ZFS?

After major upgrades, you will need to upgrade pkg to use FreeBSD 11 by issuing this command:
pkg-static install -f pkg

And then reinstall all packages for FreeBSD 11 by doing this: pkg upgrade -f

Hopefully the required libraries will be installed for sudo to work.

You should enable root login for now until you get things running properly.
 
OP
IPTRACE

IPTRACE

Well-Known Member

Reaction score: 24
Messages: 321

I'm using UFS. I'm in writable mode and can run/modify files as root etc.
I've run pkg-static install -f pkg and got:
Code:
[1/1] Reinstalling pkg-1.8.7_3...
[1/1] Extracting pkg-1.8.7_3: 100%
ldconfig: Cannot mmap "/var/run/ld-elf.so.hints": Invalid argument
pkg-static: POST-INSTALL script failed
 
Last edited by a moderator:

_martin

Daemon

Reaction score: 276
Messages: 1,073

It happened because sudo is not in FreeBSD base. It's built from ports against the library which has been updated in 11.0.

You need to rebuild it and/or download a new one. pkg-static(8) is your friend here. Assuming you have the internet connection you can do:

# pkg-static delete -f pkg
# pkg

First one deletes pkg from the system. It requires -f as it tries to delete itself. The 2nd one fetches then the pkg from the internet. Then you can use it to delete/install the sudo and other packages if needed. Today I used the portupgrade(1) to rebuild all my packages in jails.

As a side note you should not rely on sudo only. You should have user that could su to root (i.e. have him in wheel group).
 
OP
IPTRACE

IPTRACE

Well-Known Member

Reaction score: 24
Messages: 321

Anyway, it was helpful. After that
pkg upgrade -f
and reboot - done all.

Thank you for your help.
 

cbrace

Well-Known Member

Reaction score: 15
Messages: 316

Hi all,

I have encountered a similar problem that the instructions above haven't solved.

After rebooting, dovecot2' s auth won't run properly because it can't find libpam.so.5

In /usr/lib, I see the current version of that shared library is libpam.so.6

How do I get dovecot to find the new version?

Thanks
 
OP
IPTRACE

IPTRACE

Well-Known Member

Reaction score: 24
Messages: 321

Hello!

Try to delete dovecot package and install it again.

I'm going to upgrade other several servers with dovecot, so I can encounter the same problem.
I'll check it of course.
 

cbrace

Well-Known Member

Reaction score: 15
Messages: 316

Thanks, I tried that -- deleting and reinstalling -- but dovecot is still looking for libpam.s.05. I hope someone here has a suggestion as I've run out of ideas.
 
OP
IPTRACE

IPTRACE

Well-Known Member

Reaction score: 24
Messages: 321

Did you use port instead pkg to install dovecot?
 

kpa

Beastie's Twin

Reaction score: 1,843
Messages: 6,318

Sometimes I run into something like this so the quickest fix is to make a softlink to a newer library.

No, don't. There is nothing in FreeBSD ports that requires that the newer version of the same shared library has to implement the API/ABI of the previous version, it's left completely to the upstream vendor and the maintainer of the FreeBSD port to decide if they want to maintain such backward compatibility. Doing this will bite you eventually.
 

Remington

Aspiring Daemon

Reaction score: 194
Messages: 562

No, don't. There is nothing in FreeBSD ports that requires that the newer version of the same shared library has to implement the API/ABI of the previous version, it's left completely to the upstream vendor and the maintainer of the FreeBSD port to decide if they want to maintain such backward compatibility. Doing this will bite you eventually.

It usually rare in these cases when I don't have time to fetch and build customized ports and I would resort to making softlink as a temporary fix. It's never a permanent solution because something will break eventually.
 

cbrace

Well-Known Member

Reaction score: 15
Messages: 316

Once again hi all,

I have two question about this process which I hope some people here can answer.

First, I have been using freebsd-upgrade for some years now to perform OS upgrades (major and minor) and this is the first time I have encountered problems with obsolete libraries. Previously I never rebuilt the installed ports; I first made sure all ports were up to date with portmaster, and I then ran freebsd-upgrade. Reboot, done. Has something change? Or did I just have dumb luck previously?

Second, pkg upgrade -f seems to work well for most of the ports installed. But what about ports for which you need a non-default configuration? For example, my setup requires postfix with the mysql interface, which I believe is not a default option. To get my server back to normal today, I found I needed to run pkg upgrade -f and then also rebuild both dovecot2 and postfix from source. That finally solved the library issues.

Your thoughts? I would like to be prepared for the next major upgrade :)
 

marino

Daemon

Reaction score: 447
Messages: 1,091

nothing changed and you had dumb luck before.
You have to remove all the old packages and reinstall / rebuild them all again. You can't "use portmaster to make sure they are up to date". portmaster can't detect wrong library linkages.
 

Remington

Aspiring Daemon

Reaction score: 194
Messages: 562

It's a lot easier to use port-mgmt/synth or port-mgmt/poudriere to build your own clean packages. That way you'll know if something breaks and it won't mess up your running system. Also it keeps your installed packages and dependencies to minimum without cluttering up with bunch of orphaned built dependencies from ports. You can build your own packages with your custom options. I have mail server with many customized packages and I can simply delete all packages, reinstall all of them and its all up running without changing anything.
 

cbrace

Well-Known Member

Reaction score: 15
Messages: 316

nothing changed and you had dumb luck before.
You have to remove all the old packages and reinstall / rebuild them all again. You can't "use portmaster to make sure they are up to date". portmaster can't detect wrong library linkages.

You may be right about dumb luck :) But the Handbook does recommend portmaster to manage the transition:

After a major version upgrade, all installed packages and ports need to be upgraded. Packages can be upgraded using pkg upgrade. To upgrade installed ports, use a utility such as ports-mgmt/portmaster.

A forced upgrade of all installed packages will replace the packages with fresh versions from the repository even if the version number has not increased. This is required because of the ABI version change when upgrading between major versions of FreeBSD. The forced upgrade can be accomplished by performing:

# pkg-static upgrade -f
A rebuild of all installed applications can be accomplished with this command:

# portmaster -af

https://www.freebsd.org/doc/en_US.I...freebsdupdate.html#freebsdupdate-portsrebuild
 

marino

Daemon

Reaction score: 447
Messages: 1,091

for one, I have already tried getting references to portmaster removed from the handbook. Secondly, it's a badly written paragraph. "upgrading" is not needed, what's needed is a complete replacement of all packages, whether that be through binary packages or rebuilding from source. They have to be built on the same release. If you upgrade, all the packages where the version didn't change won't get rebuilt, right?

when compared to modern building options, portmaster is awful. Some die-hards won't admit it though so you'll people defend it despite it effectively not receiving updates for years.
 

cbrace

Well-Known Member

Reaction score: 15
Messages: 316

Is pkg upgrade the preferred method? If not, what do you recommend?
 
Top