Introduction to GPM

The GPM (General Purpose Mouse daemon) package contains a mouse server for the console and xterm. It not only provides cut and paste support generally, but its library component is used by various software such as Links to provide mouse support to the application. It is useful on desktops, especially if following (Beyond) Linux From Scratch instructions; it's often much easier (and less error prone) to cut and paste between two console windows than to type everything by hand!

This package is known to build and work properly using an LFS-11.2 platform.

Package Information

Additional Downloads

User Notes:

Kernel Configuration

Enable the following option in the kernel configuration and recompile the kernel if necessary:

Device Drivers  --->
  Input device support ---> [CONFIG_INPUT]
    <*/M> Mouse interface   [CONFIG_INPUT_MOUSEDEV]

Installation of GPM

Install GPM by running the following commands:

patch -Np1 -i ../gpm-1.20.7-consolidated-1.patch &&
./                                     &&
./configure --prefix=/usr --sysconfdir=/etc      &&

This package does not come with a test suite.

Now, as the root user:

make install                                          &&

install-info --dir-file=/usr/share/info/dir           \
             /usr/share/info/                 &&

rm -fv /usr/lib/libgpm.a                              &&
ln -sfv /usr/lib/            &&
install -v -m644 conf/gpm-root.conf /etc              &&

install -v -m755 -d /usr/share/doc/gpm-1.20.7/support &&
install -v -m644    doc/support/*                     \
                    /usr/share/doc/gpm-1.20.7/support &&
install -v -m644    doc/{FAQ,HACK_GPM,README*}        \

Command Explanations

./ This command creates the missing configure script.

install-info ...: This package installs a .info file, but does not update the system dir file. This command makes the update.

ln -v -sfn /usr/lib/ This command is used to create (or update) the .so symlink to the library.

Configuring GPM

Boot Script

Install the /etc/rc.d/init.d/gpm init script included in the blfs-bootscripts-20220722 package.

make install-gpm

Config Files

/etc/gpm-root.conf and ~/.gpm-root: The default and individual user gpm-root configuration files.

/etc/sysconfig/mouse: This file contains the name of your mouse device and the protocol it uses. To create this file, run the following as the root user:

cat > /etc/sysconfig/mouse << "EOF"
# Begin /etc/sysconfig/mouse

GPMOPTS="<additional options>"

# End /etc/sysconfig/mouse

Configuration Information

Examples of values to set MDEVICE, PROTOCOL, and GPMOPTS to are:


A list of which protocol values are known can be found by running gpm -m [device] -t -help. The MDEVICE setting depends on which type of mouse you have. For example, /dev/ttyS0 for a serial mouse (on Windows this is COM1), /dev/input/mice is often used for USB mice and /dev/psaux for PS2 mice. GPMOPTS is the 'catch all' for any additional options that are needed for your hardware.


Installed Programs: disable-paste, display-buttons, display-coords, get-versions, gpm, gpm-root, hltest, mev, and mouse-test
Installed Library:
Installed Directory: /usr/share/doc/gpm-1.20.7

Short Descriptions


is a security mechanism used to disable the paste buffer


is a simple program that reports the mouse buttons being pressed and released


is a simple program that reports the mouse coordinates


is used to report the GPM library and server versions


is a cut and paste utility and mouse server for virtual consoles


is a default handler for gpm. It is used to draw menus on the root window


is a simple sample application using the high-level library, meant to be read by programmers trying to use the high-level library


is a program to report mouse events


is a tool for determining the mouse type and device it's attached to

contains the API functions to access the GPM daemon