# PTB for GNU Octave in Ubuntu 22.04

**URL:** <https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409>\
**Category:** Programming Help\
**Tags:** linux\
**Created:** [May 6, 2022, 12:59pm UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409 "2022-05-06T12:59:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atul](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Atul](https://psychtoolbox.discourse.group/u/Atul)\
**Post date:** [May 6, 2022, 12:59pm UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/1 "2022-05-06T12:59:03Z")

</div>

hello, I want some help. I am new to PTB. Recently, installed ubuntu 22.04, then gnu octave 6.4.0 (configured for x86\_64-pc-linux-gnu) from ubuntu software repository. after that tried to installed ptb-3 from neurodebian website,as suggested in PTB website; through following and typing the given commands given there. its been more than 5 hrs, still in terminal something is setting up… and i am unable to find PTB-3 anywhere in my laptop.  
Please help.

---

<div class="post-metadata">

**Author:** ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)\
**Post date:** [May 6, 2022, 1:13pm UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/2 "2022-05-06T13:13:17Z")

</div>

you need to provide more info, what exact commands did you execute and what output did you get on the console?

---

<div class="post-metadata">

**Author:** ![Atul](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Atul](https://psychtoolbox.discourse.group/u/Atul)\
**Post date:** [May 7, 2022, 4:21am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/3 "2022-05-07T04:21:17Z")

</div>

For installation, I visited PTB website there I got the link for neurodebian website. In the second place (neurodebian website), recommended commands were “wget -O- [http://neuro.debian.net/lists/impish.jp.libre](http://neuro.debian.net/lists/impish.jp.libre) | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list  
sudo apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com 0xA5D32F012649A5A9” for adding neurodebian repository to my native package management system.  
Then i executed “sudo apt-get update” for updating the packages.  
In last the command, “sudo apt-get install octave-psychtoolbox-3” was executed for installing the PTB-3.  
Now, I am waiting for getting PTB-3 anywhere in my laptop.

---

<div class="post-metadata">

**Author:** ![Atul](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Atul](https://psychtoolbox.discourse.group/u/Atul)\
**Post date:** [May 7, 2022, 4:24am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/4 "2022-05-07T04:24:36Z")

</div>

while visiting neurodebian for PTB-3, I found nothing for ubuntu 22.04, instead packages was only available for upto ubuntu 21.10.

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [May 7, 2022, 4:48am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/5 "2022-05-07T04:48:44Z")

</div>

Yes, Ubuntu 22.04, being a rather new release only 2 weeks old, isn’t yet supported by NeuroDebian afaik. I assume support will be added soon’ish (days to weeks - whenever Yaroslav finds the time), then with the latest 3.0.18.9 PTB

In the meantime, the “universe” (or was it “multiverse”?) repo of Ubuntu 22.04 contains PTB 3.0.18.4, so if that is enabled in package sources, you can `sudo apt install octave-psychtoolbox-3` to get that slightly older version from Ubuntu 22.04 itself.

Or you can use the `DownloadPsychtoolbox` method to get the latest current 3.0.18.9 PTB from us.

Make sure to login into a GUI session that is X11/Xorg based, not Wayland based, or you will end with the Wayland nightmare, cfe. [Screen('OpenWindow') and PsychImaging('OpenWindow') produce black screen - #6 by mariokleiner](https://psychtoolbox.discourse.group/t/screen-openwindow-and-psychimaging-openwindow-produce-black-screen/4361/6)

-mario

---

<div class="post-metadata">

**Author:** ![Atul](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Atul](https://psychtoolbox.discourse.group/u/Atul)\
**Post date:** [May 7, 2022, 8:33am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/6 "2022-05-07T08:33:40Z")

</div>

Hey Mario, thanks. I enabled the multi & universe repositories, then gave the command, “sudo apt install octave-psychtoolbox-3” and in return i got this,  
"atul@atul-HP-Pavilion-Laptop-14-dv1xxx:~$ sudo apt install octave-psychtoolbox-3  
[sudo] password for atul:  
Reading package lists… Done  
Building dependency tree… Done  
Reading state information… Done  
octave-psychtoolbox-3 is already the newest version (3.0.18.4.dfsg1-1).  
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.  
atul@atul-HP-Pavilion-Laptop-14-dv1xxx:~$

I am still unable to access psychtoolbox-3, please help me out.

---

<div class="post-metadata">

**Author:** ![Atul](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Atul](https://psychtoolbox.discourse.group/u/Atul)\
**Post date:** [May 7, 2022, 9:47am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/7 "2022-05-07T09:47:27Z")

</div>

As you suggested, I can download the PTB latest version from you, using " DownloadPsychtoolbox". What is your address??

---

<div class="post-metadata">

**Author:** ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)\
**Post date:** [May 7, 2022, 11:50am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/8 "2022-05-07T11:50:40Z")

</div>

Use google or look at [psychtoolbox.org](http://psychtoolbox.org)

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [May 7, 2022, 5:39pm UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/9 "2022-05-07T17:39:47Z")

</div>

Seems it is already installed. You just start octave, and then its commands should be available, e.g., `PsychtoolboxRoot` or `PsychtoolboxVersion` or a demo like `LinesDemo`. The first setup step would be running `PsychLinuxConfiguration` to optimize your laptop for neuroscience use – Admin password required.  
E.g., in a terminal `octave` then in octave `PsychLinuxConfiguration`.  
Or `octave --gui` or the Octave icon for the full Octave GUI application.

-mario

---

<div class="post-metadata">

**Author:** ![Atul](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Atul](https://psychtoolbox.discourse.group/u/Atul)\
**Post date:** [May 13, 2022, 11:24am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/10 "2022-05-13T11:24:18Z")

</div>

Thanks Mario,  
Commands of _PsychtoolboxVersion_ and _PsychtoolboxRoot_ are working and popping answers properly. Entry of command line _Linesdemo_ leaving me to a blank, non-functional page. And, I am still unable to see/find the Psychtoolbox Homepage, like and a homepage of any application, so that i can access the library, tool, settings, etc. Please help me out.

---

<div class="post-metadata">

**Author:** ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)\
**Post date:** [May 13, 2022, 12:59pm UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/11 "2022-05-13T12:59:53Z")

</div>

I do not understand what you are saying, but some guessing:  
PTB doesn’t have a settings page where you can click and change stuff.

What is the error you get when you run LinesDemo? Please post the full  
command line output

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [May 13, 2022, 4:47pm UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/12 "2022-05-13T16:47:53Z")

</div>

From previous advice, citing myself:

Make sure to login into a GUI session that is X11/Xorg based, **not** Wayland based, or you will end with the Wayland nightmare of just blank black screens and a hang, cfe. [Screen(‘OpenWindow’) and PsychImaging(‘OpenWindow’) produce black screen - #6 by mariokleiner](https://psychtoolbox.discourse.group/t/screen-openwindow-and-psychimaging-openwindow-produce-black-screen/4361/6)

Currently you seem to have v3.0.18.4 from Ubuntu itself, and that version lacks automatic Wayland detection and troubleshooting for this problem → Don’t use Wayland, use a Xorg/X11 GUI session. This should make visual stimulation working.

~~Yesterday I got feedback from Yaroslav Halchenko of team NeuroDebian that they currently can’t provide updated packages via NeuroDebian for Ubuntu 22.04-LTS due to some technical problems. That’s a pity as i want people to upgrade to Ubuntu 22.04-LTS, it has substantial improvements for neuroscience applications, and NeuroDebian would be the most convenient method for that. But it is what it is…~~

~~Therefore, for the time being, it would be best if you’d use the `DownloadPsychtoolbox` method as described on our website under “Subversion-based installation”, to get the latest 3.0.18.9 release, and then `UpdatePsychtoolbox` as needed, iow. the same procedure as when using MS-Windows or macOS.~~

**EDIT: Yaroslav found a solution, and I’m pleased to report that the latest PTB 3.0.18.9 is now available from NeuroDebian for Ubuntu 22.04-LTS.** There won’t be any support for the outdated Ubuntu 21.10 though, as that reaches end of life in 2 months anyway, so no point in providing packages for it.

-mario

---

<div class="post-metadata">

**Author:** ![Atul](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Atul](https://psychtoolbox.discourse.group/u/Atul)\
**Post date:** [May 14, 2022, 5:27am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/13 "2022-05-14T05:27:42Z")

</div>

ohh Thanks Mario, now I changed to X11 and then typed LinesDemo in octave’s command window, and watched a miracle of colorful lines in great motion. Thanks a lot  
now for next how to find experiment/program library…? where i can find some already developed experiments. Please suggest me

---

<div class="post-metadata">

**Author:** ![Atul](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Atul](https://psychtoolbox.discourse.group/u/Atul)\
**Post date:** [May 14, 2022, 5:41am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/14 "2022-05-14T05:41:10Z")

</div>

Thanks dcnieho, now I typed LinesDemo and watched an animation then found this on my octave’s command window :

PTB-INFO: This is Psychtoolbox-3 for GNU/Linux X11, under GNU/Octave 64-Bit (Version 3.0.17 - Build date: Feb 22 2021).  
PTB-INFO: OS support status: Linux 5.13.0-40-generic Supported.  
PTB-INFO: Type ‘PsychtoolboxVersion’ for more detailed version information.  
PTB-INFO: Most parts of the Psychtoolbox distribution are licensed to you under terms of the MIT License, with  
PTB-INFO: some restrictions. See file ‘License.txt’ in the Psychtoolbox root folder for the exact licensing conditions.

PTB-INFO: For information about paid priority support, community membership and commercial services, please type  
PTB-INFO: ‘PsychPaidSupportAndServices’.

PTB-INFO: Failed to enable realtime-scheduling [Operation not permitted]!  
PTB-INFO: You need to run the script PsychLinuxConfiguration once, then logout and login again for this to work.

PTB-INFO: OpenGL-Renderer is Intel :: Mesa Intel(R) Xe Graphics (TGL GT2) :: 4.6 (Compatibility Profile) Mesa 21.2.2  
PTB-INFO: VBL startline = 1080 , VBL Endline = -1  
PTB-INFO: Will try to use OS-Builtin OpenML sync control support for accurate Flip timestamping.  
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.668200 ms [59.994479 Hz]. (50 valid samples taken, stddev=0.005448 ms.)  
PTB-INFO: Reported monitor refresh interval from operating system = 16.666111 ms [60.001999 Hz].  
PTB-INFO: Small deviations between reported values are normal and no reason to worry.  
minsmooth = 1  
maxsmooth = 7.3750

> >

now next i want to have a introductory tour to my Psychtoolbox on my laptop. I Want to see some already developed experiments, then to do some tiny then successively large manipulations in those experiments. please suggest me the paths and tricks.

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [May 14, 2022, 4:26pm UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/15 "2022-05-14T16:26:35Z")

</div>

That’s not running on Ubuntu 22.04, but something older like 21.10? I’d recommend upgrading to the latest. Also an old 3.0.17 PTB…

Wrt. further steps: `help Psychtoolbox` gives you pointers.

---

<div class="post-metadata">

**Author:** ![Atul](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Atul](https://psychtoolbox.discourse.group/u/Atul)\
**Post date:** [May 15, 2022, 7:58am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/16 "2022-05-15T07:58:45Z")

</div>

sorry, i should have told to earlier. now i am on ubuntu 21.10, and PTB 3.0.17.

---

<div class="post-metadata">

**Author:** ![Atul](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Atul](https://psychtoolbox.discourse.group/u/Atul)\
**Post date:** [May 15, 2022, 8:01am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/17 "2022-05-15T08:01:42Z")

</div>

…and help Psychtoolbox gave me this:

> help Paychtoolbox  
> error: help: ‘Paychtoolbox’ not found
> 
> > help Psychtoolbox  
> > error: help: ‘Psychtoolbox’ not found  
> > help\_Psychtoolbox  
> > error: ‘help\_Psychtoolbox’ undefined near line 1, column 1

---

<div class="post-metadata">

**Author:** ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)\
**Post date:** [May 15, 2022, 1:24pm UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/18 "2022-05-15T13:24:47Z")

</div>

Not sure what you did to make that happen (install in a folder with non-standard name?), but in the root folder of psyschtoolbox, there is a file Contents.m. Read the text in that file

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [May 15, 2022, 1:58pm UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/19 "2022-05-15T13:58:53Z")

</div>

Right, I forgot that NeuroDebian and the Linux distributions install into the root folder “psychtoolbox-3” instead of “Psychtoolbox”, so one needs to use `help psychtoolbox-3` instead. Or look at the online version for the latest PTB version:  
[http://psychtoolbox.org/docs/Psychtoolbox.html](http://psychtoolbox.org/docs/Psychtoolbox.html)

---

<div class="post-metadata">

**Author:** ![Atul](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Atul](https://psychtoolbox.discourse.group/u/Atul)\
**Post date:** [May 17, 2022, 9:57am UTC](https://psychtoolbox.discourse.group/t/ptb-for-gnu-octave-in-ubuntu-22-04/4409/20 "2022-05-17T09:57:35Z")

</div>

Thank a lot. Now I can access to Contents.m and help Psychtoolbox-3. Reading the folders…
