118

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.

  • 6
    https://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 Mar 30 '24 at 19:46
  • 3
    I have a hunch that the fix to https://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 Mar 30 '24 at 20:23
  • 2
    Looks like it's indeed caused by a mutter bug: https://gitlab.gnome.org/GNOME/mutter/-/issues/3384 – egmont Mar 30 '24 at 21:12
  • 1
    I type a command like $ cd 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 Apr 04 '24 at 22:56
  • 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. – Weikang Wang Apr 03 '24 at 01:10
  • 1
    @FourierFlux Your comment is not helpful at all. Mistakes do happen. This unfortunate mistake could sneak in because it only affects a fraction of users. Revoking someone's commit access wouldn't improve anything; in fact, would probably result in the loss of a helpful contributor who just made a mistake. That being said, conclusions should be drawn, processes should be improved. In my opinion, the question is much rather: Why does it take more than a week (and counting) to officially release the fix, why couldn't they have reverted the severely faulty change within 1-2 days of locating it? – egmont Apr 08 '24 at 12:50
  • I had to install 22.04.4 last week and noticed this with GNOME terminal right-away. After typing a few commands, a noticeable lag between a key-press and the character echoed on screen is observed. This can be very annoying and seriously hampers CLI work. The lag could not be observed with Firefox or Gedit for example. Nor does it appear to affect xterm or eterm ( both appear to be X-windows based ). lxterminal, tilda, sakura and terminator have the same lag problem ( even worse than G-term ).

    xterm works flawlessly ( so far...).

    – darbehdar Apr 09 '24 at 06:00
  • Same issue, different stack exchange, but maybe the problem is fixed for you if you apt-get update today: https://unix.stackexchange.com/a/774241/510471 – VerteXVaaR Apr 10 '24 at 09:06
  • Are you sure this problem is only bounded by mutter and gnome terminal? I noticed this problem few days ago, and it is not only the terminal acting with latency, but for example, netbeans and eclipse windows does stutter and also laggy. I thought it was an nvidia-driver problem, so I switched to default x.org nouveau driver only to find out it will occasionally crash and log you out. This might be a problem at kernel level, or worst our nvidia cards could be faulty. Also, at boot time, kernel complains about not being able to communicate with nvidia gpu via i2c. – Can Altineller Apr 10 '24 at 17:17
  • Links to upstream discussions have been posted here, please read through them. It's not just the terminals, some other apps are also affected. Problems began for many people at roughly the same time, with a mutter update, and many of them have confirmed that reverting or upgrading to the proposed mutter packages solves the problem for them. – egmont Apr 10 '24 at 19:22
  • An alternative terminal emulator is alacritty from the snap store. It's listed as 96MB and is gpu accelerated. It does not seem to suffer from any input delays. It's basic (no tabs, splits), but is intended to be fast. You might also already have an alternative terminal already installed. For example JupyterLab has one and it does not seem to be affected by input delays. – filipmu May 11 '24 at 12:19

7 Answers7

93

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.

mikabytes
  • 1,196
  • 3
    how this should be reverted once the fix is applied to stable release? – Elgin Cahangirov Apr 05 '24 at 03:24
  • 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 Apr 05 '24 at 05:27
  • 1
    Worked for me. I just upgraded from 20.04 LTS to 22.04 LTS, and this issue was one of the first to hit me. Thanks @mikabytes – socjopata Apr 05 '24 at 07:49
  • 1
    The bug is now marked as "Fix Released" but, according to this AskUbuntu answer about the process, this doesn't mean actual packages have been released until one also sees "Fix Released" on the row for your particular Ubuntu version, e.g. Jammy (at the time of writing this comment, it's still showing "Triaged" for Jammy). – George Hawkins Apr 06 '24 at 10:41
  • The fix did not work for me. Ubuntu 23.10, X11, Gnome shell 45.2, 64 bit – Daigaku no Baku Apr 07 '24 at 09:42
  • I should also add that my NVidia driver version is 535 – Daigaku no Baku Apr 07 '24 at 09:55
  • @DaigakunoBaku You'll need to restart your computer after installing. So far quite a lot of people have used this fix successfully, I hope it will work for you as well. – mikabytes Apr 07 '24 at 10:31
  • @GeorgeHawkins Yes, the PPA allows us to use the fix before it lands in our official Ubuntu distros. I saw one of the developers hinting it might take a few weeks. – mikabytes Apr 07 '24 at 10:34
  • 3
    @mikabytes, you are right, it seems to be working after a system restart – Daigaku no Baku Apr 07 '24 at 11:05
  • This fixed it for me – FourierFlux Apr 07 '24 at 22:19
  • 2
    Worked here too. Latest days I was getting very upset trying to use terminal with remote SSH connections and I was complaining to my ISP due some missing ping packets but the problem really was this one that thanks to your help I have fixed now. For first time in 15 years I was thinking in change my OS due this problem because it was affecting also my local programs and my work productivity. – masterguru Apr 09 '24 at 04:49
  • Also worked with me after a restart (Ubuntu 22.04.1). I appreciate the solution because it was really annoying, especially when using vim, which even led me trying vscode with vim emulation, but that's not the same as native terminal vim! – vsantos Apr 12 '24 at 10:12
  • I'm here after search why my 24.04 terminal is so slow. Anyone know if this may still be the recommended fix on the latest Ubuntu? Ubuntu is still in beta for a few days, I may be asking too early. – PKKid Apr 19 '24 at 19:09
  • 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 Apr 19 '24 at 19:19
  • Hi, do you know when this fix will go live to the main ppa? If it's just a week or two, then I'd rather wait, lest I mess up my OS with subsequent updates. But if it's O(months), then I'm grabbing it asap. – user2671688 Apr 20 '24 at 01:20
  • @user2671688 Last I heard it was scheduled for the release of Ubuntu 24.04, April 25, but that information might be outdated. Probably others know better. This PPA will not mess up your OS regarding subsequent updates. – mikabytes Apr 20 '24 at 05:29
  • Does that mean "scheduled to be released into 22.04 on the same date that 24.04 goes out" or "never to be fixed in 22.04, must update to 24.04"? – user2671688 Apr 20 '24 at 14:30
  • It is planned to be released in 22.04 as well as 24.04. As for the date when this happens, it's hard to predict the future. I hope it makes it into 22.04 at the same time. – mikabytes Apr 20 '24 at 15:01
  • Thanks, I was wondering why my terminal became laggy – Romain Laneuville Apr 22 '24 at 21:11
  • I just updated without using a special PPA and rebooted, which resolved the issue. mutter package is 42.9-0ubuntu7 . So it seems the fix is released for Ubuntu 22.04. – Kjell May 03 '24 at 10:24
  • The initial bug reports show 42.9-0ubuntu7 as the affected version, along with 45.2-0ubuntu3 for 23.10. So @Kjell if that's the version you're running, it was probably not fixed by that package. I can however confirm that Ubuntu Noble (24.04) has received mutter 46.0-1ubuntu9 packages, and no longer requires this PPA. – mikabytes May 03 '24 at 12:38
  • @mikabytes Thanks, that seems right. It was fast after the reboot though, I just came back to fix my comment because now it is slow again. Not sure if that is a typical symptom of the bug. – Kjell May 03 '24 at 14:33
  • From the bug report: "2. Open a Terminal, resize it vigorously, and type several lines of text" . Probably I didn't yet resize and therefore it appeared fixed. – Kjell May 03 '24 at 14:41
  • 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 May 10 '24 at 17:12
  • 2
    I can confirm as in the previous comment by @mmalone the fix also stopped working for me after an Ubuntu-update. Installing the vanvugt versions fixed it for me after the restart, but these changes would be wiped again by the next Ubuntu update. – drupov May 11 '24 at 13:19
  • 1
    What I did was to add (or edit if already existing) a file /etc/apt/preferences and pin the versions like:

    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

    Notice the "Pin-Priority" - this is important, for these versions to stay, might be different for you though. Run sudo apt update && sudo apt upgrade afterwards and the needed versions will be installed and should remain also after updates.

    – drupov May 11 '24 at 13:20
  • Thanks, @mmalone. I've updated the post to suggest users follow your instructions. – mikabytes May 11 '24 at 13:51
  • 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 May 14 '24 at 18:46
  • @mmalone I'm a bit confused, will I need to "unpin" later when the official update finally does come out? And what is the command for that? – LongBoolean May 16 '24 at 04:08
  • 1
    Rare snarfu from Ubuntu but so annoying it makes my main working machine barely usable. You fix it just for them to break it soon on the next release. Too many cooks spoil the broth. – Waslap May 16 '24 at 06:20
  • 7
    The problem is back – FourierFlux May 21 '24 at 18:50
  • 1
    I've submit a edit to the answer. If you are not sure should do a mark / hold / pin magic. As the Assignee of this ubuntu issue indicated: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2059847/comments/135

    Before this issue get fixed officially, you can put all the deb files into a folder, then a script which execute the installation of the debs.

    just in case the package get upgraded unintentionally.

    – zxcpoiu May 22 '24 at 07:33
  • apt update/upgrade did not work for me. I needed to dpkg -i the packages referenced on the downstream Ubuntu issue link (comment #135) and then reboot: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2059847/comments/135. might be time to let ubuntu go... terminal is a pretty crucial app in my workflow. – Vigrond May 27 '24 at 21:55
  • 1
    @Vigrond I suggest, and recommend, that Ubuntu 22.04 users upgrade to 24.04. That version is unaffected by this issue and has other improvements as well. See Upgrade Ubuntu desktop – mikabytes May 28 '24 at 06:35
  • Make sure you reboot as mentioned a couple of times. – Harlin May 30 '24 at 11:11
  • Worked for me as well after pinning the vanvugt version. Thank you! – Nick Reed Jun 01 '24 at 18:25
  • @zxcpoiu I can confirm that that works for me. Just to play it safe I am going to use discipline and not update anything for a few months until this issue is fixed. – LongBoolean Jun 04 '24 at 16:04
  • @mikabytes I would upgrade to 24.04, but I have been burned to many times, I'll wait a year for the obvious bugs to get found. – LongBoolean Jun 04 '24 at 16:05
  • The issue should be fixed now, see the update in another answer: https://askubuntu.com/posts/1509271/revisions – A.L Jun 10 '24 at 11:23
  • As of 2024-06-13, on Ubuntu 22.04.4 LTS, the issue appears again every time I run sudo apt-get update && sudo apt-get upgrade. Pinning the versions of the broken packages to 42.9-0ubuntu7vv1 as explained in @smido's answer seems to have solved the problem for me. – ingo-m Jun 13 '24 at 11:57
  • Just updated 22.04 LTS, specific terminal lag not only fixed, but marked improvement in desktop performance overall. At the risk of sounding chatty: "WTF, how does an in-your-face bug like that pass LTS". – Birkensox Jun 21 '24 at 19:44
  • apt upgrade didn't work for me, but manually upgrading using apt install libmutter-10-0 worked – Cagri Jul 12 '24 at 13:53
35

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.

egmont
  • 9,030
  • 1
  • 34
  • 47
  • 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 Apr 02 '24 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 – Vsevolod Gromov Apr 02 '24 at 12:29
  • @VsevolodGromov Thanks for pointing this out! I'm not familiar with this level of apt magic :-D – egmont Apr 02 '24 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 Apr 03 '24 at 15:45
  • Ok, I downgraded, following my instructions. It worked for me. What I missed, though, is that there were some previous updates, I cannot see those packages on the download sites, so I reverted back to the ones in the original distribution, which is (for 23.10) version 45.0-3ubuntu3, rather than 45.2-0ubuntu3 which I was hoping for (the version just before the broken one). Surely, for others with different set of packages installed, or different Ubuntu version, the picture might be somewhat different. – egmont Apr 03 '24 at 16:07
  • @egmont, I was more referring to the mikabytes answer below, which provides a script based on your explanations; that answer contains the warning about the temporary, intentionally, broken apt state. I'm totally fine with (and grateful for) your findings, just wanted to point out that some people might get by with a simpler solution (log out, select wayland, log in). – Bart Robeyns Apr 03 '24 at 16:40
  • @BartRobeyns Well, then claiming that it leaves apt in a broken state in a comment to my answer rather than theirs looks quite derogatory. I recommended to downgrade all mutter-related packages that are installed on the system (there might be up to about 7-8 of them), that other answer where people complain about broken apt state downgrades 2 or 3 packages out of these. Converting the verbal instructions into a shell script that works on all distro versions and everyone's computer is probably way harder than it first looks. – egmont Apr 03 '24 at 17:02
  • That was totally not my intent, but it could indeed be interpreted like that; my apologies for that. I've deleted the original comment, and I'll just add this as a replacement: as pointed out in that first link (gitlab.gnome.org/GNOME/mutter/-/issues/3384), switching to Wayland works around the issue as well. – Bart Robeyns Apr 03 '24 at 20:22
  • "Converting .... script ... way harder than it first looks" Indeed, as the author of that code I can just confirm this to be true. The script has gone through several revisions already. – mikabytes Apr 04 '24 at 09:24
  • @egmont I did end up having a broken apt even when I downgraded all related mutter packages. That's why I limited my script to only downgrading the few ones that were necessary to give temporary relief from this issue. – mikabytes Apr 04 '24 at 09:27
  • @mikabytes Would have loved to learn more what went wrong for you, which dependency was not met. Anyway, hopefully soon this will be an issue of the past. Right now probably your new answer with the PPA at https://askubuntu.com/a/1509474/398785 is the best. – egmont Apr 04 '24 at 20:56
  • @egmont Sorry, I don't remember, and I feel like I spent too much time on this already. Perhaps it was one of those ubuntu meta-packages. We'll never know. The most important thing is we now have a "proper" solution for it :-) – mikabytes Apr 05 '24 at 16:53
  • The problem is back again – FourierFlux May 22 '24 at 05:49
  • @FourierFlux The problem hasn't officially been fixed yet. It's unfortunately "back" if you've applied certain workaround earlier. I've already added an update to my answer about it. – egmont May 22 '24 at 09:30
  • Any way to just get rid of mutter? – Harlin May 30 '24 at 11:11
  • 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 May 30 '24 at 20:44
  • Thanks egmont. I had a feeling that was the answer ;-) but never hurts to ask. Thanks! – Harlin Jun 01 '24 at 20:58
  • Weird. I have Ubuntu 24.04 and i switched from wayland to X11 (i'm facing ubuntu crash issues specially using Eclipse IDE). Now i have a annoying stuttering (a 1s delay) when i'm typing alphanumeric keys and the next key is Backspace, or the inverse. – Max Jun 14 '24 at 18:14
  • @Max If you've installed all the updates (especially the fixed libmutter and friends packages) and have logged out and back in then it's a different story. If it's tied to particular keys only then it might be related to the input method, just a wild guess. – egmont Jun 15 '24 at 12:34
  • @egmont If i understood correctly, gnome team has fixed this wayland bug updating mutter to 46.2. Unfortunately, ubuntu 24.04 does not released an update yet. Is there anyway to update Gnome3 manually ? – Max Jun 17 '24 at 19:08
  • @Max Ubuntu 24.04 had this fixed when released, they backported the fix into its mutter 46.0 packages. You don't need to do anything. – egmont Jun 18 '24 at 05:10
  • @egmont Weird. I have to run some applications with the env command GDK_BACKEND=x11 enabled, otherwise the application freezes after a few minutes of use and I return to the login screen with the entire session finished. – Max Jun 18 '24 at 11:28
  • @Max The symptoms you just described are very different from the one described in this topic. It must be some unrelated issue. – egmont Jun 18 '24 at 17:39
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
mikabytes
  • 1,196
  • Note for those on 22.04 - the script above needs a few tweaks. change lib-mutter-13 to lib-mutter-10 and remove the lines for mutter-common-bin as this package doesn't exist on 22.04. However, this does break apt as it ends up with gir1.2-mutter-10, gnome-remote-desktop and gnome-shell requiring libmutter-10-0 (>= 42.9), which is the package wit the issue. Hopefully the issue gets fixed asap by Ubuntu devs. – Steve Childs Apr 02 '24 at 13:15
  • @SteveChilds I have updated the scripts with the changes you mentioned. Can you confirm it works now? As for breaking apt, perhaps we should discourage users from downgrading, or what would you say? – mikabytes Apr 02 '24 at 13:19
  • to be honest, for me it was a massive issue as I do a lot in terminal (web developer / server admin), so temporarily breaking apt isn't too much of an issue as the bigger issue was the input lag. - Script appears to otherwise work fine on 22.04 :) – Steve Childs Apr 02 '24 at 13:48
  • Ah, - just spotted you didn't update the dpkg lines, version number for 22.04 & common-bin not required on 22.04 if I could tag you into the reply I would, for some reason it's not working for me. – Steve Childs Apr 02 '24 at 13:58
  • 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 Apr 02 '24 at 14:07
  • If you're on 22.04 and want to undo the changes above & fix apt - you need to download the update (and currently bugged) versions:

    wget http://se.archive.ubuntu.com/ubuntu/pool/main/m/mutter/mutter-common_42.9-0ubuntu7_all.deb ; wget http://se.archive.ubuntu.com/ubuntu/pool/main/m/mutter/libmutter-10-0_42.9-0ubuntu7_amd64.deb

    sudo dpkg -i mutter-common_42.9-0ubuntu7_all.deb ; sudo dpkg -i libmutter-10-0_42.9-0ubuntu7_amd64.deb

    – Steve Childs Apr 02 '24 at 14:08
  • 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

    – Elgin Cahangirov Apr 03 '24 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 Apr 03 '24 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 Apr 04 '24 at 07:46
  • @VonGoofy What commands broke your system? (what exact commands did you run to "reverting back to bugged packages") – mikabytes Apr 04 '24 at 09:12
  • First I needed to unhold the packages then I installed the uninstalled packages: sudo apt install gdm3 gnome-backgrounds gnome-shell-extension-prefs chrome-gnome-shell gir1.2-telepathylogger-0.2 gir1.2-telepathyglib-0.12 gir1.2-malcontent-0 libpam-pkcs11. And after that some more missing with apt-install ubuntu-desktop. – Von Goofy Apr 04 '24 at 12:04
  • 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. – Steve Childs Apr 05 '24 at 11:30
  • 1
    running this broke my desktop immediately even without apt install -f , @ElginCahangirov 's command only brought back the "essentials" for me, no dock no top bar, running sudo apt install ubuntu-desktop fixed it back (mutter got upgraded as well obviously) – Cagri May 13 '24 at 20:23
10

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

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.

db 1070
  • 103
  • 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. – A.L Apr 14 '24 at 15:59
  • Snap should be self-contained, but will be quite large (around 500MB). – db 1070 May 07 '24 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 May 18 '24 at 16:13
  • At least as a tactical solution i have found konsole to be the way to go for now. – JohnP May 27 '24 at 03: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

smido
  • 195
  • 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 May 29 '24 at 05: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 Jun 13 '24 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.

raddevus
  • 2,067
  • 1
    A fix has been published on June 7th: https://askubuntu.com/a/1509271/229365 – A.L Jun 08 '24 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 Jun 08 '24 at 15:29
  • i read that this was fixed in mutter 46.2, but Ubunut does not released yet. – Max Jun 17 '24 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 Jun 17 '24 at 20:10