How to Stop Ubuntu from Automatically Clearing the Clipboard on Exit

The Missing Data

By default, the X11 display server architecture (which Ubuntu traditionally uses, though Wayland handles this slightly differently) manages clipboard data in a highly volatile manner. The clipboard is tied directly to the application that owns the highlighted text. If you open a text editor, highlight a paragraph, press Ctrl+C, and then close the text editor, the clipboard data is instantly destroyed. When you open a web browser and press Ctrl+V, nothing will happen. This automatic clearing of the clipboard upon application exit is a massive point of frustration for users migrating from Windows or macOS, where the clipboard is a system-wide, persistent storage area.

Installing a Persistent Clipboard Manager

To fundamentally change how Ubuntu handles copied text and stop it from automatically dumping your clipboard data when an application closes, you must install a background clipboard manager.

Ubuntu does not include a persistent clipboard manager by default. You must install one from the repository. Open your terminal (Ctrl+Alt+T). A highly reliable, lightweight option is `parcellite` or `clipit` (though `clipman` or `gpaste` are better for modern GNOME). Let’s use `gpaste`. Type the command: sudo apt install gpaste and press Enter. Once the installation is complete, you will likely need to restart your GNOME shell (log out and log back in). You can now open the GPaste settings to configure its memory limits. Because the GPaste daemon runs independently of your applications, you can now copy text from a document, completely close the document window, and perfectly paste that text into your web browser ten minutes later.

Get the best tech tips delivered straight to your inbox.

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