114

I have been using Ubuntu since Christmas, and just recently I have been receiving delayed input while using the Ubuntu terminal. It especially takes affect when using vim or man commands, which is strange as no other software I have has no delay when typing even UTerm and UXTerm have no delay.

What I have tried:

  • restarting pc
  • updating drivers
  • changed keyboard input

System Info:

  • OS Name: Ubuntu 22.04.4 LTS
  • OS Type: 64-bit
  • Gnome version: 42.9
  • Windowing system: X11

This problem occurred from March 30th to June 7th, any solutions from here as of now are not guaranteed to work.

11
  • 6
    gitlab.gnome.org/GNOME/gnome-terminal/-/issues/8070 looks like another report of probably the same issue. No report about lagging for years, and then suddenly 4 different people report it in just a bit over 24 hours. Must be some recent Ubuntu update that broke something. They did not update their VTE or GNOME Terminal packages recently, so it must be an update to an underlying package that is either buggy, or happens to trigger a bug in VTE / GNOME Terminal.
    – egmont
    Commented Mar 30 at 19:46
  • 3
    I have a hunch that the fix to bugs.launchpad.net/ubuntu/+source/mutter/+bug/2054510 may be the culprit; in that case reverting the [lib]mutter* packages to 42.9-0ubuntu5 (22.04) / 45.2-0ubuntu3 (23.10) and restarting the graphical session should fix the issue. Since I cannot reproduce the issue, I cannot confirm this suspicion. It would be great if you could test it and provide feedback!
    – egmont
    Commented Mar 30 at 20:23
  • 2
    Looks like it's indeed caused by a mutter bug: gitlab.gnome.org/GNOME/mutter/-/issues/3384
    – egmont
    Commented Mar 30 at 21:12
  • 3
    I have met same problem. I've found that switching the Nvidia driver to the open-source Nouveau can temporarily solve this problem. However, this is only a temporary solution; nobody wants their graphics card to lose a significant amount of performance. Commented Apr 3 at 1:10
  • 1
    I type a command like $ cd<space> and then the cursor freezes and it takes about 1 second for the space to appear. It is so annoying. It actually seems to occur intermittently on about every 3rd character typed. Really terrible.
    – raddevus
    Commented Apr 4 at 22:56

7 Answers 7

89

Update: Official updates have been released for all affected versions. All you need now is apt update && apt upgrade. You do not need to follow the instructions below.

There is now a PPA with an early fix for this issue. Caution: This PPA is meant for testing. There are no guarantees. It may fix this issue and cause other issues. Use at your own risk.

For me, it solved the problem and everything seems to work. Also, it doesn't break apt, as my previous answer did.

sudo add-apt-repository ppa:vanvugt/mutter
sudo apt update
sudo apt upgrade

The changes will take effect after a system restart.

42
  • 9
    This fix does not require any reversions. Once a stable solution is implemented, a new, improved version will be released, superseding the current PPA versions. You can then optionally remove the PPA by sudo add-apt-repository --remove ppa:vanvugt/mutter
    – mikabytes
    Commented Apr 5 at 5:27
  • 6
    @PKKid It is still the recommended fix. Also, several people have reported that they can identify if they have this bug by running journalctl -b0 | grep MetaSyncRing. If it has some output then you have this bug.
    – mikabytes
    Commented Apr 19 at 19:19
  • 37
    It looks like Ubuntu released a new version of mutter yesterday that superseded the vanvugt version, but still has the input delay bug AGAIN. To fix it I'm the pinning vanvugt version by running this command: sudo apt-get install gir1.2-mutter-10=42.9-0ubuntu7vv1 mutter-common=42.9-0ubuntu7vv1 libmutter-10-0=42.9-0ubuntu7vv1
    – mmalone
    Commented May 10 at 17:12
  • 4
    Follow-up on my comment about pinning the versions above. After doing that you'll also need to put a hold on them. That's done by sudo apt-mark hold gir1.2-mutter-10 mutter-common libmutter-10-0
    – mmalone
    Commented May 14 at 18:46
  • 6
    The problem is back Commented May 21 at 18:50
34

Unfortunately mutter and its related packages received a faulty update in Ubuntu. Developers are aware of the issue and are working on it.

Upstream Mutter issue: https://gitlab.gnome.org/GNOME/mutter/-/issues/3384

Downstream Ubuntu issue: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2059847

[Please don't add meaningless noise (comments like "it's buggy for me too") to those bugs because that only distracts developers and makes it harder to find actual useful information. However, feel free to comment there if you believe you have something new to add that hasn't been pointed out before.]


Here's how to revert to the previous version.

Update 4 (2024-06-07): Official updates have been released for both Ubuntu 22.04 and 23.10. You should revert any change you have made previously (e.g. unhold the packages you put on hold, remove the PPA you added) and then upgrade your system. This should hopefully fix this problem once and for all.

Update 3 (2024-05-10): Still no official update packages for this problem for 22.04 and 23.10. However, according to recent comments at the downstream Ubuntu issue (linked above), a fresh update takes precedence over the fixed packages in the PPA (at least in 22.04, I'm not sure about 23.10). Therefore the PPA approach, linked from the 1st "Update" below, does not work at the moment. You may want to resort to my original approach of putting the packages on hold.

Update 2 (2024-04-25): Ubuntu 24.04 has just been released. It includes the fix. Unfortunately older Ubuntu versions (22.04 and 23.10) are still waiting for this fix to be released.

Update: For the best method currently, see mikabytes's answer: https://askubuntu.com/a/1509474/398785. The following below is my earlier answer which is no longer the preferred method.

The instructions are somewhat vague because I cannot test them, a bit of experience might be required. Edits to this answer are welcome.

Go go https://packages.ubuntu.com/, type "mutter" to the upper search box and select your distribution (but not its "-updates" or "-backports" counterpart). You'll get a (hopefully complete) list of packages built from the same source, e.g. mutter, mutter-common, mutter-common-bin, libmutter-<version> etc., all bearing the same version number.

Download each of these packages whose newer (broken) counterpart is already installed on your system. Once downloaded, downgrade them with sudo dpkg -i ....

Once downgraded, put them on "hold" so that a next apt upgrade won't update them again. It goes like echo mutter hold | sudo dpkg --set-selections and repeat for all other packages.

Finally, log out of your graphical desktop and log back in.

Keep an eye on updates. Once a fix is released, remove the packages from the "hold" state by executing the previous commands with install instead of hold. Then upgrade your system as usual.

23
  • 2
    You're a lifesaver! This worked on Ubuntu 23.10. Note that Ubuntu servers are currently having some issues, if you hit a "500 Internal Server Error" just try again in a few minutes.
    – mikabytes
    Commented Apr 2 at 11:35
  • 1
    For me in Ubuntu 23.10 helped "sudo apt install mutter=45.0-3ubuntu3" Just find previous version of package: apt list -a mutter Commented Apr 2 at 12:29
  • @VsevolodGromov Thanks for pointing this out! I'm not familiar with this level of apt magic :-D
    – egmont
    Commented Apr 2 at 12:34
  • @BartRobeyns I'm not quite sure (I haven't tried this method), but could you please clarify: why would downgrading mutter leave apt in a broken state? What's the broken dependency exactly? Can't it be fixed by downgrading another package or two? On my particular system, 5 packages were updated at once (all from the mutter source, all from version 45.2-0ubuntu3 to 45.2-0ubuntu4) with no other package updated at that time. What becomes broken if you roll back these packages?
    – egmont
    Commented Apr 3 at 15:45
  • 1
    @Harlin Mutter is a key component of the GNOME desktop or its Ubuntu flavor, Ubuntu's default. You can choose other desktops, such as KDE, or the old default Unity, or old-fashioned window managers like IceWM, FVWM etc. These all provide a completely different desktop experience than GNOME. I don't think it's a good idea to get used to another desktop just because there's a faulty package, I'd rather just install its fix and stay with whatever I'm already used to.
    – egmont
    Commented May 30 at 20:44
10

EDIT: There is now a better solution, please see my other answer. I'll leave the answer below as is, including the comments, but I won't spend any more time on it.


Based on egmont's answer, these are the exact commands that I executed to fix this issue. You will need to restart the computer when done.

This will leave apt in a temporary broken state. This is intentional. We are manually downgrading specific packages. You won't be able to use apt until you run the restore script at the end. Do not run apt install --fix-broken before mutter is restored, or it will damage your installation.

Tested by me on Ubuntu 23.10. Other users report it works for 22.04, although one user had problems when restoring the system (see comments).

Uncomment the lines that are suitable for you.

arch=$(dpkg --print-architecture) # one of amd64 arm64 armhf ppc64el riscv64 s390x

# Ubuntu 23.10
version="45.0-3ubuntu3"
package="13-0"

# Ubuntu 23.04
#version="44.3-0ubuntu1.1" # only amd64
#version="44.0-2ubuntu4" # other archs
#package="12-0"

# Ubuntu 22.04
#version="42.0-3ubuntu2"
#package="10-0"

wget -nc http://se.archive.ubuntu.com/ubuntu/pool/main/m/mutter/libmutter-${package}_${version}_$arch.deb
wget -nc http://se.archive.ubuntu.com/ubuntu/pool/main/m/mutter/mutter-common_${version}_all.deb
if [ "$package" != "10-0" ]; then
  wget -nc http://se.archive.ubuntu.com/ubuntu/pool/main/m/mutter/mutter-common-bin_${version}_$arch.deb
fi

sudo dpkg -i *mutter*.deb

echo libmutter-$package hold | sudo dpkg --set-selections

Later, when there's an upstream fix for this and you want to upgrade, run these commands to restore your system:

echo libmutter-${package} install | sudo dpkg --set-selections
sudo apt update && sudo apt --fix-broken upgrade
13
  • 2
    Ah, got it. I think that was a smaller mistake, as it just would've thrown a warning. Good to make it clear. And yeah, this delay bug was a major issue for me as well as I spend all my day in Vim and it was completely unusable. Times like these make us appreciate how rarely these kinds of bugs happen :-)
    – mikabytes
    Commented Apr 2 at 14:07
  • 1
    after running this script and sudo apt install -f my screen became black and gnome desktop was not working after restart. I was only able to login via terminal. I fixed it by running sudo apt install --reinstall ubuntu-session. Terminal issue still persists.. EDIT: Ubuntu version is 22.04 Commented Apr 3 at 12:03
  • 2
    My best guess, because you downgraded mutter and then told apt to fix the broken packages, it went ahead and downgraded/removed a lot of things. This is ill-advised. It is best to leave apt in a broken state until a fix has been released for this bug.
    – mikabytes
    Commented Apr 3 at 12:50
  • 1
    This reported broken package on Ubuntu 23.10. I went on reverting back to bugged packages and it broke my system (deleted bunch of ubuntu-desktop dependencies). Then I had to drop to maintenance mode (drop to root) install everything back (remove holds) and then back in desktop install ubuntu-desktop meta package. If you don't know what are you doing I wouldn't recommend this fix.
    – Von Goofy
    Commented Apr 4 at 7:46
  • 1
    @VonGoofy / Elgin - yeah, DO NOT run apt install -f as it will downgrade ALOT of stuff which will as you found, break the system. I almost did this myself, but realised what the downgrade would do before I pressed 'y'! Apologies, I should have mentioned that to Mika to put in his reply. Commented Apr 5 at 11:30
9

Based on mikabytes's answer, I've found another solution that not will not leave apt in a broken state. For Ubuntu 22.04.4:

# Download the packages.
wget -nc https://launchpad.net/ubuntu/+source/mutter/42.9-0ubuntu5/+build/26711789/+files/gir1.2-mutter-10_42.9-0ubuntu5_amd64.deb
wget -nc https://launchpad.net/ubuntu/+source/mutter/42.9-0ubuntu5/+build/26711789/+files/libmutter-10-0_42.9-0ubuntu5_amd64.deb
wget -nc https://launchpad.net/ubuntu/+source/mutter/42.9-0ubuntu5/+build/26711789/+files/mutter-common_42.9-0ubuntu5_all.deb

# Install the packages.
sudo dpkg -i *mutter*.deb

# Mark as hold.
sudo apt-mark hold gir1.2-mutter-10
sudo apt-mark hold libmutter-10-0
sudo apt-mark hold mutter-common
1
6

For any users looking for a quick fix to this issue, I have found that Konsole is not GTK/mutter-based and is not suffering from this issue. Konsole can be installed on Gnome through the software store.

4
  • 2
    sudo apt install konsole would add 124 packages to my system, since I use Gnome my system lacks many libkf5* and Qt dependencies. The other answers require less changes to the dependencies, if that bother you. Commented Apr 14 at 15:59
  • Snap should be self-contained, but will be quite large (around 500MB).
    – db 1070
    Commented May 7 at 21:56
  • 2
    I've switched to Konsole for now, using sudo snap install konsole --classic. This is the best temporary workaround for me, since it feels too fragile to much around with apt and PPAs.
    – nlawson
    Commented May 18 at 16:13
  • At least as a tactical solution i have found konsole to be the way to go for now.
    – JohnP
    Commented May 27 at 3:02
2

As a mixture of other replies and comments (most notably @drupov, @mmalone), the simples solution seems to be to create a /etc/apt/preferences.d/mutter-fix file with content

Package: gir1.2-mutter-10 
Pin: version 42.9-0ubuntu7vv1 
Pin-Priority: 1001 

Package: mutter-common 
Pin: version 42.9-0ubuntu7vv1 
Pin-Priority: 1001 

Package: libmutter-10-0 
Pin: version 42.9-0ubuntu7vv1 
Pin-Priority: 1001 

and then sudo apt upgrade

For other distros, it might be /etc/apt/preferences

2
  • Yes, that worked for me. After adding /etc/apt/preferences I did "sudo apt update && sudo apt upgrade" and also needed a restart. Get your currently installed version of the packages with "apt-cache policy gir1.2-mutter-10 mutter-common libmutter-10-0 | grep Installed -B1"
    – drupov
    Commented May 29 at 5:59
  • Thanks, worked for me as well. Without this, the problematic packages were upgraded every time I ran sudo apt-get update && sudo apt-get upgrade, and I had to downgrade them again every time. (This was by far the most problematic issue I had with a linux distro in 10 years of using debian or ubuntu as my daily driver :/ ).
    – ingo-m
    Commented Jun 13 at 11:51
0

This problem was driving me crazy since I use the terminal constantly (as many Linux users do).

I finally read the information about the bug at the link and noticed that they report that it occurs on:

  • Mutter: 46.0
  • Present in XOrg: Yes
  • Graphics: NVIDIA 550.67
  • Present in Wayland: No

I have NVIDIA 1660, running Ubuntu 22.04.4 and am running on X11.

I didn't know that X11 was part of the problem, so I'm happy to try Wayland if past issues are resolved.

The slowness and skipping letters when I typed fast in the terminal was just driving me crazy. I kept hoping (for at least 6 weeks now) that it would finally get resolved.

Switched To Wayland

Since the problem didn't get resolved, I finally switched over to Wayland.
The problem seems entirely resolved and I'm really happy.

Also prior issues that I saw in wayland are resolved:

  1. Why won't my Android emulator start on Ubuntu 22.04?
  2. Why doesn't Remmina handle sending Alt-Tab to remote computer on 22.04 Jammy Jellyfish?

Happy to be on Wayland, now that features work for me. Glad this resolved my terminal issue.

Additional Info

Someone commented that a fixed has been published -- it ended up being published the same day (06-07-2024) I gave up and moved to Wayland.

I always check for updates every day but I didn't receive any fix on the 8th (Saturday) or 9th (Sunday).

Today (06-10-2024), I ran updates and I saw the following:

mutter updates

I'm guessing that since the original issue had to do with Mutter that these are the updates which would fix the issue (if I were still running X11). Just thought seeing the updates might be helpful to someone.

Wayland continues to work fine for me now.

4
  • 1
    A fix has been published on June 7th: askubuntu.com/a/1509271/229365 Commented Jun 8 at 14:22
  • @A.L-saynotoAI Thanks for the update. That's interesting because I run all updates every morning when I turn my computer on but still hadn't seen the fix -- I was seeing the issue in my terminal all day yesterday until I upgraded to Wayland. Fortunately, moving to wayland fixes the issue and I didn't see any other issues yesterday, but I'll keep it in mind if I am forced for some reason to move back to X11.
    – raddevus
    Commented Jun 8 at 15:29
  • i read that this was fixed in mutter 46.2, but Ubunut does not released yet.
    – Max
    Commented Jun 17 at 19:10
  • @Max I can confirm that I've moved back to X11 (because my version of MS Teams running on Ubuntu wouldn't do Screen Share under Wayland) and that the input delay problem is resolved after the update shown in my post above occurred. Others have also mentioned that Mutter has indeed been updated (see Update 4 on the most upvoted answer) on Ubuntu 22.04.4 (which I'm running).
    – raddevus
    Commented Jun 17 at 20:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .