How to Stop Ubuntu from Automatically Clearing the Clipboard When Closing Apps

If you have recently migrated from Windows to Ubuntu Linux, you might encounter a highly frustrating quirk regarding how copy and paste works. In Windows, if you highlight a paragraph in Microsoft Word, press Ctrl+C, and then completely close Microsoft Word, you can still paste that paragraph into Notepad an hour later. The clipboard data is managed by the operating system.

In traditional Linux environments running the X11 display server, the clipboard behavior is often fundamentally different. The text you copy is actually owned by the specific application you copied it from. Therefore, if you highlight a command in your web browser, press Ctrl+C, and then close the browser, the copied text is automatically destroyed. When you try to paste it into your terminal, absolutely nothing happens.

To stop Ubuntu from automatically clearing your clipboard every time you close an application, you must install a lightweight background utility called a “Clipboard Manager” to catch and preserve the data.

How to Prevent Clipboard Data Loss on App Exit

You can install a clipboard daemon like Clipman or CopyQ to manage your copied data.

  1. Open your terminal application (Ctrl+Alt+T).
  2. Install the CopyQ clipboard manager by running the following command:
    sudo apt update && sudo apt install copyq
  3. Once the installation is complete, launch CopyQ from your application launcher.
  4. You will see a small scissors icon appear in your system tray (top right of the screen).
  5. Right-click the scissors icon and select Preferences.
  6. Ensure the checkbox for Autostart is enabled, so CopyQ launches every time you turn on your computer.

CopyQ will now silently run in the background. Every time you press Ctrl+C in any application, CopyQ will intercept the data and save a backup copy in its own memory. Even if you completely close the source application, your text will remain safely stored in CopyQ’s history, allowing you to paste it anywhere, at any time.

Get the best tech tips delivered straight to your inbox.

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