I wanted to post an update because I finally managed to solve the problem and get my Ubuntu desktop back!
While trying to understand what had happened, I remembered something important: shortly before the problem started, I had changed the Ubuntu repository/mirror because I was having trouble installing/updating something. After changing the mirror, things started going wrong, and eventually Ubuntu stopped booting into the graphical environment completely.
I could still log in through TTY, and fortunately all my personal files were still there, but gdm3.service could not be found and ubuntu-desktop was no longer installed. At first, `apt` could not even locate the packages correctly.
Looking at /etc/apt/sources.list.d/ubuntu.sources, I found that my repository configuration was pointing to the mirror I had changed earlier and was not correctly configured.
I restored the standard Ubuntu 24.04 (Noble) repositories:
`http://archive.ubuntu.com/ubuntu/\`
and
`http://security.ubuntu.com/ubuntu/\`
After correcting a couple of syntax mistakes in `ubuntu.sources`, `sudo apt update` finally worked again and downloaded the package indexes normally.
I then checked:
`apt policy gdm3 ubuntu-desktop`
and discovered that both packages were available from the official repositories but neither was currently installed.
I ran:
sudo apt install ubuntu-desktop
This reinstalled `ubuntu-desktop`, `ubuntu-desktop-minimal`, `gdm3`, GNOME Shell, and the other required components.
After the installation completed, `systemctl status gdm3` finally recognized GDM again, although it was inactive. I started it manually with:
`sudo systemctl start gdm3`
and, to my surprise, the graphical login screen immediately came back. I logged in and my entire desktop was there again, including all my folders and personal files.
I also checked:
`systemctl get-default`
and it reports `graphical.target`, so the system is configured to boot into the graphical environment.
I honestly cannot describe how relieved and happy I am to have the computer working again. I had a lot of important documents on this machine and was extremely worried that I would have to reinstall Ubuntu or lose something.
Thank you very much to everyone here who replied and tried to help me. Your questions also helped point me in the right direction and made me think about what I had changed before the problem started.
The system is working again!