Why can't I use the UNIX or ! commands in MATLAB 6.0 (R12) if I have an older Linux kernel?

2 views (last 30 days)
When I start MATLAB, I get the following message although MATLAB does come up just fine.
ERROR: ---------------------------------------------------------------\nWarning: Linux 2.2.2 - your operating system\n Linux 2.2.15 - MATLAB built using \nthis system\n---------------------------------------------------------------\n\n??? MATLAB was unable to open the \npseudo-tty master device /dev/ptmx. The unix()\nand ! commands will not work in this MATLAB \nsession. Other commands which depend \nupon unix() and ! will fail. Please check with \nyour system administrator and confirm that \nthis device exists with the proper permissions.\n\n%
I just can't use UNIX or ! commands in MATLAB.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 26 Jan 2022
Edited: MathWorks Support Team on 26 Jan 2022
The warning about the different kernel versions can be ignored. We warn about this by default, but there are no significant differences between the two kernels that would cause any trouble.
The problem with UNIX and ! commands needs to be resolved on your part. Please see below for help on this.
MATLAB R12 relies on a working Unix98 pty setup. This was available on all the major distributions long before we shipped, though it's possible for someone who has upgraded piecemeal to have
missed this one.
Things to look for:
1. The device /dev/ptmx must exist and be writable.
greg@fess 839$ ls -l /dev/ptmx\ncrw-rw-rw- 1 root tty 5, 2 Dec 1 17:28 /dev/ptmx
Use "mknod -m 666 /dev/ptmx c 5 2" to remedy.
2. The directory /dev/pts must exist
greg@fess 840$ ls -ld /dev/pts\ndrwxr-xr-x 2 root root 0 Nov 13 09:11 /dev/pts/
Use "mkdir /dev/pts; chmod 755 /dev/pts" to remedy
3. The filesystem type "devpts" must be supported in the kernel
greg@fess 841$ cat /proc/filesystems | grep pts\nnodev devpts
Reconfigure and rebuild your kernel to remedy this.
4. The filesystem /dev/pts of type devpts must be mounted
greg@fess 842$ cat /proc/mounts | grep pts\ndevpts /dev/pts devpts rw 0 0
Short term remedy: "mount -t devpts devpts /dev/pts"
Long term remedy: put this into a startup script or add it to your /etc/fstab file.
There is plenty of info on the web to help you with any phase of this, depending on where you're falling short. One common failure mode seems to be this one:
I've had some problems that stem from compiling a kernel (2.2.10) and not getting devpts included. I've searched throughout the kernel and haven't found this as an option, but when I compile and then boot from the new kernel, I get error messages on bootup that it has no support for filesystem devpts when mounting my disk's partitions.
Pts is a method of defining and accessing terminals. It has been included in newer version of Linux to work toward Unix98 branding.
Pts inclusion in the kernel is under 'Character Devices.' The help for that option recommends also adding the '/dev/pts filesystem for Unix98 PTYs' under 'Filesystems.' It sounds as if you've not done this latter step.

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!