0

I was using Ubuntu 22.04.4, I installed an app/program that didn't work but wouldn't uninstall. I ran a purge and auto remove command and when the computer rebooted, I knew I borked it! I get a terminal window with the following: Ubuntu 22.04.4 LTS gary-260-a020 ttyl and next line: gary-260-a020 login:_. gary-260-a020 is my personal computer, an HP.

I installed Ubuntu 24.04 alongside 22.04.4 by dumb luck. When I tried to start Ubuntu 22.04.4 from GRUB I get the same two lines. I have tried various login/user names, nothing works, not root or my name.

Is there anything I can do. 24.04 is working fine, but there files on 22.04.4 I'd like to get back.

1
  • Likely, you purged your desktop manager and desktop environment along with the non-working thing; sudo apt install ubuntu-desktop could fix that in case you want to boot to a desktop environment on 22.04 again. About the non-working username / password in the TTY, your actual username might not match what you see when logging in through your desktop manager, but that can also be fixed by running the command from a root shell obtained by booting into GRUB, choosing "advanced options for Ubuntu" and dropping to a root shell from the recovery mode.
    – kos
    Commented May 1 at 17:52

1 Answer 1

1

Do lsblk, locate the Ubuntu 22.04 and 24.04 partitions, then mount the old one with sudo mount /dev/sdX /mnt (sdX stands for old partition, adapt to your own system).

Explore the filesystem with Nautilus and copy your files over or use the command line in the terminal, i. e.: cp -R /mnt/home/gary/* /home/gary/old to get all the contents of your old home into the directory ~/old. This leaves out the dotfiles with your old configurations and is a real fresh start.

If you want to copy everything over, including old and possibly stale dotfiles, use what @kos has mentioned in a comment: cp -R /mnt/home/gary/{*,.*} /home/gary/old. You could use it without going back to 22.04, there would be no need to keep the old partition.

This should suffice to let you copy all your personal files over.

Since your 24.04 is working fine, no need to fix the old 22.04 via chroot or other repair options. Better to have a fresh start.

2
  • You are right about things like .bashrc, but for a lot of dotfiles, I prefer a fresh start with careful investigation if something should be carried over. I can see the advantage of your approach, though. Everything is there and can be fixed later. I'll expand the answer.
    – emk2203
    Commented May 1 at 19:04
  • Exactly, I wouldn't fogive myself for losing years of .zshrc customization :) hence why I pointed that out, I agree with the start fresh thing though, besides .zshrc and a few others I usually don't carry over much from my home directory, just that and some stuff from /etc
    – kos
    Commented May 1 at 19:15

You must log in to answer this question.

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