Score:0

I have locked myself out of my computer

fo flag

I am now running Ubuntu 22.04 LTS “Jammy Jellyfish”

As you could expect from my other post on custom keyboard issues, I have messed up again with my /usr/share/X11/xkb/rules/evdev/files

The unexpected result is that I am now locked out of my system, being unable to enter my password. The irony of the situation is that I do not know what I type.

enter image description here

The top right icons say "fr" but I probably screwed up this keyboard layout. I tried to pretend I was using an English QWERTY keyboard instead of French AZERTY but that failed miserably.

Friendly complains here :

  • there is no option in the password box to at least show me what I type;
  • the top right "accessibilty" icon menu suggests a virtual keyboard, but it never shows up when I check the box. What else should I do to display it?

Browsing similar questions (some quite old!) I have tried to reboot and access the GRUB prompt. I set up a new password : password Corpus-team 123456

But this did not work either,

Attempt to fix the keyboard layout issue.

I tried a nice trick : CTRL+ALT+F1

This brought me to the Ubuntu prompt (Terminal, aka tty).

Here, fortunately I could see what I type in entering the user name (password is still hidden) - and - surprise! - the keyboard works just fine ! French AZERTY as it should have been.

I could enter no problem, restore my two my evdev files from backup. Upon reboot alas! this did not solve the password problem.

I did CTRL+ALT+F1 again, and this time I used the "passwd" command to change my password to numbers, in hope that this could avoid problem with keyboard layout mixup on boot.

It did not work.

I am stuck, cannot enter.

I have noticed that I can toggle between the login screen and the tty, using CTRL+ALT+F1 and CTRL+ALT+F7 login screen

However, so far, I have been unable to fix the keyboard layout issue on the login screen, although my password is OK on the tty interface, and although I have been able to change it to 12345678, which I though would avoid keyboard layout issues on the login screen, but no...

My last attempt following How do I change the login manager's keyboard layout? was around Mark Kirby's post : dpkg-reconfigure keyboard-configuration

When I changed over from French to English keyboard, that worked OK in the tty interface. Clumsy but I can manage: I know my Qwerty keyboard on an Azerty one...

However, back to the login screen, it still displays "Fr" in the top right corner of the screen... This does not solve my issue with the keyboard layout on the login screen.

Having re-installed the X11/xkb files with "sudo apt-get install --reinstall keyboard-layout" and seeing no result after all theses trials, I am beginning to think that it's not just an issue with keyboard loayout. Other things may be broken.

Attempts to skip the login/password screen.

The idea was to disable the login, fix the keyboard issue, reboot and go back to normal usage with login.

With kind help from @Andra, I tried hard around solutions suggested in How do I change the login manager's keyboard layout and in How do I reset a lost administrative password and in How to disable the login password

All of this failed miserably. I am no longer asked for a password, I now have instead the option to "connect", but it fails to open the session.

failed to open session

At this step, in tty, typing "systemlctl status display-manager" shows what happens when I click on "connect" but does not give a clue on the "session start" problem: display-manager status

Today's efforts

As I need to progress on normal work, I want to move files over to the network, and if possible take a complete backup on a usb drive.

I am now banging my head on new difficulties : "mount -a" no longer work, my fstab file is no longer aligned to the latest cifs requirements it seems.

Currently in backup on usb drives. 14:00 pm

andrew.46 avatar
in flag
Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/140107/discussion-on-question-by-jjmeric-i-have-locked-myself-out-of-my-computer).
de flag
ob2
Is it not more easy to reinstall ?
jjmeric avatar
fo flag
ob thank you. Yes, this is frustrating but probably the best next step. I just fear 1) to loose my home directory and 2) that the problem remains. What's the safest command line for a reinstal ? Is it "sudo apt-get install --reinstall ubuntu-desktop" as suggested by @william-martens in https://askubuntu.com/questions/289187/how-to-reinstall-ubuntu-from-terminal
pLumo avatar
in flag
You can try to reset your password. https://askubuntu.com/questions/24006/how-do-i-reset-a-lost-administrative-password
jjmeric avatar
fo flag
Thanks @pLumo, Yes, this is the first thing I have done - unless you talk about exotic, sometimes obsolete or riskier procedures mentioned in this long post...
Score:0
fo flag

I got rid of this problem by reinstalling : "sudo apt-get install --reinstall ubuntu-desktop" as suggested by @WilliamMartens in How to reinstall Ubuntu From Terminal?
This was pretty quick and I had only one choice for the display-manager : gdm3 or lightdm - I chose lightdm.

And... it works ! Following all my different attempts, I am now logged automatically...

Even better : I just found the root cause, and it was not my keyboard layout amateur work:
"Typically, the Graphical Display Manager fails when Python is uninstalled from Linux." https://www.pythoncentral.io/how-to-uninstall-python/
And yes, I had tried to "purge" Python 3.10 (preinstalled with Ubuntu 22) in order to install instead Python 3.9 (recommended for our own work). That was the bad idea!

Thank you all, especially @Andra, @ob, @pLumo !!!

Unfinished business: There is something that I cannot get rid of:
broken packages.
I had it before, I tried solutions found here, but still have it.
apt-get broken packages

Andra avatar
tr flag
it's great that it now works! For the remaining problem, just `sudo dpkg-reconfigure libdvd-pkg` or try to google the problem.
jjmeric avatar
fo flag
Thank you @Andra,that seems to have worked!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.