# Atrfter upgrading mc not works



## kerogaz (Dec 6, 2022)

```
ld-elf.so.1: /usr/local/bin/mc: Undefined symbol "g_free"
```


----------



## richardtoohey2 (Dec 6, 2022)

Upgrading what how?


----------



## kerogaz (Dec 6, 2022)

upgrading all system


----------



## kerogaz (Dec 6, 2022)

sudo freebsd-update fetch and sudo pkg upgrade


----------



## covacat (Dec 6, 2022)

reinstall 
devel/glib20
pkg install glib


----------



## kerogaz (Dec 6, 2022)

sudo pkg install glib
Password:
Sorry, try again.
Password:
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
pal@boss:~ % mc
ld-elf.so.1: /usr/local/bin/mc: Undefined symbol "g_free"


----------



## covacat (Dec 6, 2022)

```
~$ldd /usr/local/bin/mc|grep /lib/|cut -w -f 4|while read a;do nm -D $a|grep "T g_free$" && echo ==== $a === && break;done
00000000000e3590 T g_free
==== /usr/local/lib/libglib-2.0.so.0 ===
```
try
ldd /usr/local/bin/mc


----------



## kerogaz (Dec 6, 2022)

ldd /usr/local/bin/mc|grep /lib/|cut -w -f 4|while read a;do nm -D $a|grep "T g_free$" && echo ==== $a === && break;done
Illegal variable name.
pal@boss:~ % 00000000000e3590 T g_free


----------



## covacat (Dec 6, 2022)

try just the ldd
for the scripted line you need sh/bash (bourne shell)


----------



## kerogaz (Dec 6, 2022)

ldd /usr/local/bin/mc
/usr/local/bin/mc:
    libslang.so.2 => /usr/local/lib/libslang.so.2 (0x800336000)
    libncursesw.so.9 => /lib/libncursesw.so.9 (0x800752000)
    libssh2.so.1 => /usr/local/lib/libssh2.so.1 (0x8007c5000)
    libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0 (0x800804000)
    libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x80080a000)
    libintl.so.8 => /usr/local/lib/libintl.so.8 (0x80094b000)
    libutil.so.9 => /lib/libutil.so.9 (0x80095a000)
    libthr.so.3 => /lib/libthr.so.3 (0x800972000)
    libc.so.7 => /lib/libc.so.7 (0x8009a0000)
    libdl.so.1 => /usr/lib/libdl.so.1 (0x800daa000)
    libm.so.5 => /lib/libm.so.5 (0x800dae000)
    libz.so.6 => /lib/libz.so.6 (0x800de9000)
    libssl.so.111 => /usr/lib/libssl.so.111 (0x800e06000)
    libcrypto.so.111 => /lib/libcrypto.so.111 (0x800e9e000)


----------



## kerogaz (Dec 6, 2022)

covacat said:


> try just the ldd
> for the scripted line you need sh/bash (bourne shell)


But I have 
echo $SHELL
/bin/csh


----------



## covacat (Dec 6, 2022)

nm -D /usr/local/lib/libglib-2.0.so.0|grep g_free


----------



## kerogaz (Dec 6, 2022)

nm -D /usr/local/lib/libglib-2.0.so.0|grep g_free
nm: /usr/local/lib/libglib-2.0.so.0: no symbols


----------



## covacat (Dec 6, 2022)

ls -l  /usr/local/lib/libglib-2.0.so.0
file  -L /usr/local/lib/libglib-2.0.so.0


----------



## kerogaz (Dec 6, 2022)

ls -l /usr/local/lib/libglib-2.0.so.0
lrwxr-xr-x  1 root  wheel  23 Nov 22 03:20 /usr/local/lib/libglib-2.0.so.0 -> libglib-2.0.so.0.7400.1


----------



## kerogaz (Dec 6, 2022)

file -L /usr/local/lib/libglib-2.0.so.0
/usr/local/lib/libglib-2.0.so.0: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped


----------



## Emrion (Dec 6, 2022)

You did `sudo freebsd-update fetch` but have you actually installed the updates with `sudo freebsd-update install`?


----------



## elgrande (Dec 6, 2022)

If it was a major version upgrade you need to reinstall all packages.


----------



## kerogaz (Dec 6, 2022)

Emrion said:


> You did `sudo freebsd-update fetch` but have you actually installed the updates with `sudo freebsd-update install`?


yes


----------



## covacat (Dec 6, 2022)

nm: /usr/local/lib/libglib-2.0.so.0: no symbols
this is weird
does this show no symbols too ?
nm  -D /usr/local/lib/libgmodule-2.0.so.0


----------



## kerogaz (Dec 6, 2022)

now any command associated with the update leads to a reboot of the system than  I can't even do   freebsd-update rollback


----------



## kerogaz (Dec 6, 2022)

nm -D /usr/local/lib/libgmodule-2.0.so.0
                 w _Jv_RegisterClasses
                 w __cxa_finalize
                 U __error
                 U __stack_chk_fail
                 U __stack_chk_guard
000000000000357c T _fini
000000000000356c T _init
                 U close
                 U dlclose
                 U dlerror
                 U dlopen
                 U dlsym
                 U g_assertion_message_expr
                 U g_file_test
                 U g_filename_display_name
                 U g_free
                 U g_getenv
                 U g_malloc
0000000000003470 T g_module_build_path
0000000000003250 T g_module_close
00000000000030a0 T g_module_error
00000000000026c0 T g_module_error_quark
00000000000033f0 T g_module_make_resident
0000000000003430 T g_module_name
0000000000003420 T g_module_open
0000000000002720 T g_module_open_full
00000000000026f0 T g_module_supported
00000000000030c0 T g_module_symbol
                 U g_parse_debug_string
                 U g_path_get_dirname
                 U g_private_get
                 U g_private_replace
                 U g_quark_from_static_string
                 U g_rec_mutex_lock
                 U g_rec_mutex_unlock
                 U g_return_if_fail_warning
                 U g_scanner_destroy
                 U g_scanner_eof
                 U g_scanner_get_next_token
                 U g_scanner_input_file
                 U g_scanner_new
                 U g_scanner_scope_add_symbol
                 U g_set_error_literal
                 U g_str_has_suffix
                 U g_strconcat
                 U g_strdup
                 U g_strdup_printf
                 U open
                 U strcmp
                 U strncmp
                 U strrchr


----------



## covacat (Dec 6, 2022)

output of nm -D /usr/local/lib/libgmodule-2.0.so.0 looks ok
so either there is something wrong with the glib package or other system stuff is broken too if the system reboots while executing freebsd-update


----------



## kerogaz (Dec 6, 2022)

And how to roll back the system if the update leads to a reboot?On linux, I just pick the old kernel from the list on boot


----------



## covacat (Dec 6, 2022)

if you use zfs on root you may use bectl to boot the be created pre update


----------



## kerogaz (Dec 6, 2022)

sudo df -Th | grep "^/dev"
Password:
/dev/ada0p2  ufs       27G     18G    6.9G    72%    /


----------



## kerogaz (Dec 6, 2022)

sudo df -Th | grep "^/dev"
Password:
/dev/ada0p2  ufs       27G     18G    6.9G    72%    /


----------



## covacat (Dec 6, 2022)

so ufs then
does freebsd-update IDS work ?


----------



## elgrande (Dec 6, 2022)

You are sure you did reinstall all packages?
Or was it a minor upgrade?

Just to make sure you are not chasing a ghost here...


----------



## cracauer@ (Dec 10, 2022)

kerogaz said:


> nm -D /usr/local/lib/libglib-2.0.so.0|grep g_free
> nm: /usr/local/lib/libglib-2.0.so.0: no symbols


This should absolutely have symbols. A shared library cannot work without.

What does this print?

```
size /usr/local/lib/libglib-2.0.so.0
ls -l `which mc`
```


----------

