[CLOSED] Broken dpkg, login screen is not shown ubuntu

Hi guys back with another error

For about a month I was not getting upgrades noticed when my other system got new firefox but this one didn’t so I tried installing chrome again with their .deb package and I started getting error
here’s what I did
sudo apt install --fix-broken
sudo dpkg --configure -a

and than chrome got installed

similarly i did firefox and it worked
and than I did sudo apt autoremove
and booom I just rebooted and no log in screen nothing just plain blank screen

So I tried reinstalling ubuntu-desktop
It got all the packages around 700MB and than it was configuring one by one untill it failed (dpkg errors)

If I run sudo dpkg --configure -a
Processing was halted there were too many errors.
and if i run sudo apt install --fix-broken
everytime some new library gives error
currently it shows 684 not fully installed or removed (because I ran ubuntu-desktop) else it was only python3 and lsb-release

Now I am logged in from tty2
here is the screen shot

What I miss from your “abrakadabra”, is an apt update.
Did you run it?

quite obvious yes I ran it it works it fetches the packages

Did you try
apt install lsb-release
Ok, your screenshot suggests you are missing lsb_release.
If you can’t install it with apt, download it directly, then try to install it via dpkg.
After that retry apt upgrade, etc…

i am stuck in an endless cycle
Cannot remove any package neither can I add any package
if I run sudo apt install --fix-broken
it says dpkg-divert error

Which system do you have?
For Ubuntu 20.04 get lsb-release:
wget http://mirrors.kernel.org/ubuntu/pool/main/b/base-files/lsb-release-udeb_11ubuntu5_all.udeb
For 21.04:
wget http://mirrors.kernel.org/ubuntu/pool/main/l/lsb/lsb-release_11.1.0ubuntu2_all.deb
After that try
dpkg -i lsb[you just downloaded].deb

Does it install?

Does this help to you?

errors were encountered while processing lsb…
trying to overwrite /etc/lsb-release which is also in package base files 11ubuntu5.3

I have been trying this whole day if i fix one another one pops up
Something is badly gone wrong
All i did was sudo apt remove python3
And it broke everything

I’m out of ideas for now.
Looks like it will be easier to reinstall from scratch.
Or restore a system snapshot you took before… do you have any?
If not, it’s time to get used to it, either Timeshift, or Systemback.
BTW, is this the system with your very new laptop?

No this is my work system it has all the codes and stuff
Can I reinstall without loosing data?

Kovacsit has the solution. Make sure you have all your data in your backup location (that is, separate from this system) and format your disk. Reinstall and restore your backup.

1 Like

I think you can do it, but better have a backup of your important data.
If you have a separate partition for your /home, then the reinstall is easy, format the system partition, but keep the /home partition untouched.
If you have now everything on one single partition:
You could boot the installer live medium, and use there gparted.
Shrink the existing partition, so that there will be 48…64GB free, unallocated on the disk.
I have my desktop systems on 48GB partitions. I think, for the system alone that is sufficient, but 64GB is surely enough.
So, create a new partition on your drive with a size you think it will be OK for your system and installed apps.
Install your new system onto that partition, and use the old one as /home.
After installation completed, in your /home dir there will be your current home folder, and the residues of your previous system. You could take out of there what you need to keep. For example, if your username is majestic, your current home will be /home/majestic, while your old home will be /home/home/majestic (example!).
As a developer, you should get the idea, I hope you do.
Do you? :slight_smile:

After you moved all your important data to their new places, do a housekeeping, and delete the unnecessary residues of your old broken system.

Yeah I had to reinstall
I took backup up of everything and than did a reinstall
Kept everything same still ended up loosing /home
So I had hop on to backup

I wish there was a simpler way of fixing broken dpkg