How to Stop Ubuntu from Automatically Clearing the Clipboard

The Volatile Memory

Ubuntu, like many Linux distributions utilizing the X11 or Wayland display servers, handles the clipboard differently than Windows or macOS. By default, the standard clipboard in Linux is highly volatile. If you open a text editor, highlight a paragraph, press Ctrl+C to copy it, and then completely close that text editor, the clipboard is instantly cleared. If you subsequently open an email client and press Ctrl+V, nothing will paste. Ubuntu assumes that when the source application terminates, any data held in the clipboard originating from that application should be purged to free up system memory.

Installing a Clipboard Manager

To ensure your copied data persists across applications and stop Ubuntu from automatically clearing the clipboard when you close a program, you must install a background clipboard manager.

Ubuntu does not have a persistent clipboard built into the core GNOME desktop by default; you must add one. Open your terminal (Ctrl+Alt+T). For modern Ubuntu (using GNOME), the best solution is a GNOME Shell extension. Alternatively, you can install a standalone daemon like copyq or parcellite, but for integration, we recommend the xclip utility combined with a GNOME extension. Type sudo apt install xclip and press Enter to provide the backend support. Next, open the “Ubuntu Software” app (or App Center), search for Clipboard Indicator, and install it. Once installed and enabled via the “Extensions” app, this utility runs constantly in the top menu bar, silently saving everything you copy into a persistent history list, completely preventing Ubuntu from erasing your data.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.