ODBC missing on Ubuntu


After a long break from running swipl on my hosted Linux box I updated the installation but found that ODBC seems to be missing.

mike@mifis:~/mifis$ mike@mifis:~/mifis$ sudo apt-get install swi-prolog
Reading package lists... Done
Building dependency tree
Reading state information... Done
swi-prolog is already the newest version (8.5.9-1-gbd7ba70e8-focalppa2).
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
mike@mifis:~/mifis$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
mike@mifis:~/mifis$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 8.5.9)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- use_module(library(odbc)).
ERROR: source_sink `library(odbc)' does not exist
ERROR:   [20] throw(error(existence_error(source_sink,...),_20316))
ERROR:   [16] '$resolve_source_path'(library(odbc),_20348,[if(not_loaded),...]) at /usr/lib/swi-prolog/boot/init.pl:2428
ERROR:   [15] '$load_file_e'(library(odbc),user,[if(not_loaded),...]) at /usr/lib/swi-prolog/boot/init.pl:2404
ERROR:   [14] '$load_file'(library(odbc),user,[if(not_loaded),...]) at /usr/lib/swi-prolog/boot/init.pl:2373
ERROR:    [9] toplevel_call(user:user: ...) at /usr/lib/swi-prolog/boot/toplevel.pl:1162
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.


Did you install ODBC?

This should do the trick:

apt install swi-prolog-odbc

Following Debian policies, SWI-Prolog is in a number of packages:

> aptitude search swi-prolog
p   swi-prolog                      - ISO/Edinburgh-style Prolog interpreter    
v   swi-prolog-abi-2-67-2d311769-de -                                           
v   swi-prolog-abi-binary-67        -                                           
v   swi-prolog-abi-foreign-2        -                                           
v   swi-prolog-abi-qlf-2d311769     -                                           
v   swi-prolog-abi-states-de23899e  -                                           
p   swi-prolog-bdb                  - Berkeley DB interface for SWI-Prolog      
p   swi-prolog-core                 - ISO/Edinburgh-style Prolog interpreter - c
p   swi-prolog-core-packages        - ISO/Edinburgh-style Prolog interpreter - c
p   swi-prolog-doc                  - documentation and examples for SWI-Prolog 
p   swi-prolog-full                 - ISO/Edinburgh-style Prolog interpreter - f
p   swi-prolog-java                 - Bidirectional interface between SWI-Prolog
p   swi-prolog-nox                  - ISO/Edinburgh-style Prolog interpreter - w
p   swi-prolog-odbc                 - ODBC library for SWI-Prolog               
p   swi-prolog-test                 - tests and checks for SWI-Prolog           
p   swi-prolog-x                    - User interface library for SWI-Prolog - wi
1 Like


Thanks guys