Page 1 of 1

Reinstall over existing system?

Posted: Wed Apr 27, 2022 1:34 am
by rainfox
I made an obvious stupid thing when I wanted to resolve a unresolved error I got when installing wine. I complained about some libraries that could not be installed, but where already on my system. So I wanted to uninstall and reinstall them. In particular I issued a

Code: Select all

apt remove libasound2-plugins libavutil56
During execution I saw that this uninstalled not only the library but nearly all programs I had installed and lot of system components. I was able to recover some of them, system also boots but looks not so well. E.g. icons are black, see screenshot
Screenshot_20220427_071711.jpg
Now my question: is there a way to reinstall the system using the installer over my existing system without formating the drive? I know I would have to reinstall missing programs by myself.
Or is it easier to reinstall everything?
Thanks for help.

Here is my systeminfo

Code: Select all

System:    Kernel: 5.15.0-12.2-liquorix-amd64 x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: audit=0 intel_pstate=disable tsc=reliable 
           BOOT_IMAGE=/boot/vmlinuz-5.15.0-12.2-liquorix-amd64 
           root=UUID=<filter> ro quiet splash 
           Desktop: KDE Plasma 5.20.5 tk: Qt 5.15.2 wm: kwin_x11 vt: 7 dm: SDDM 
           Distro: MX-21.1_KDE_x64 Wildflower October 20  2021 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Laptop System: Dell product: Latitude 5580 v: N/A serial: <filter> 
           Chassis: type: 10 serial: <filter> 
           Mobo: Dell model: 0FH6CJ v: A00 serial: <filter> UEFI: Dell v: 1.20.2 
           date: 06/03/2021 
Battery:   ID-1: BAT0 charge: 54.9 Wh (87.4%) condition: 62.8/92.0 Wh (68.3%) volts: 11.5 
           min: 11.4 model: SMP DELL WFWKK65 type: Li-ion serial: <filter> 
           status: Discharging 
CPU:       Info: Quad Core model: Intel Core i7-7820HQ bits: 64 type: MT MCP 
           arch: Kaby Lake family: 6 model-id: 9E (158) stepping: 9 microcode: EC cache: 
           L2: 8 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 46398 
           Speed: 2568 MHz min/max: 800/2901 MHz boost: enabled Core speeds (MHz): 1: 2568 
           2: 2837 3: 2470 4: 3012 5: 2433 6: 2593 7: 2597 8: 2347 
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf 
           mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl 
           Type: spectre_v1 
           mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, 
           STIBP: conditional, RSB filling 
           Type: srbds mitigation: Microcode 
           Type: tsx_async_abort mitigation: TSX disabled 
Graphics:  Device-1: Intel HD Graphics 630 vendor: Dell driver: i915 v: kernel 
           bus-ID: 00:02.0 chip-ID: 8086:591b class-ID: 0300 
           Device-2: NVIDIA GM107 [GeForce 940MX] vendor: Dell driver: nvidia v: 470.63.01 
           bus-ID: 01:00.0 chip-ID: 10de:179c class-ID: 0302 
           Display: x11 server: X.Org 1.20.13 compositor: kwin_x11 driver: 
           loaded: modesetting,nvidia unloaded: fbdev,nouveau,vesa alternate: nv 
           display-ID: :0 screens: 1 
           Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") 
           s-diag: 582mm (22.9") 
           Monitor-1: eDP-1 res: 1920x1080 hz: 60 dpi: 142 size: 344x194mm (13.5x7.6") 
           diag: 395mm (15.5") 
           OpenGL: renderer: Mesa Intel HD Graphics 630 (KBL GT2) v: 4.6 Mesa 21.2.5 
           direct render: Yes 
Audio:     Device-1: Intel CM238 HD Audio vendor: Dell driver: snd_hda_intel v: kernel 
           bus-ID: 00:1f.3 chip-ID: 8086:a171 class-ID: 0403 
           Device-2: NVIDIA GM107 High Definition Audio [GeForce 940MX] 
           driver: snd_hda_intel v: kernel bus-ID: 01:00.1 chip-ID: 10de:0fbc 
           class-ID: 0403 
           Sound Server-1: ALSA v: k5.15.0-12.2-liquorix-amd64 running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Intel Ethernet I219-LM vendor: Dell driver: e1000e v: kernel 
           port: f040 bus-ID: 00:1f.6 chip-ID: 8086:15e3 class-ID: 0200 
           IF: eth0 state: down mac: <filter> 
           Device-2: Intel Wireless 8265 / 8275 driver: iwlwifi v: kernel modules: wl 
           port: e000 bus-ID: 02:00.0 chip-ID: 8086:24fd class-ID: 0280 
           IF: wlan0 state: up mac: <filter> 
Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8 
           bus-ID: 1-6:3 chip-ID: 8087:0a2b class-ID: e001 
           Report: hciconfig ID: hci0 rfk-id: 3 state: down bt-service: disabled rfk-block: 
           hardware: no software: no address: <filter> 
           Info: acl-mtu: 1021:4 sco-mtu: 96:6 link-policy: rswitch hold sniff 
           link-mode: slave accept 
Drives:    Local Storage: total: 465.76 GiB used: 205.39 GiB (44.1%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital model: WDS500G2B0B-00YS70 
           size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s 
           type: SSD serial: <filter> rev: 20WD temp: 24 C scheme: GPT 
Partition: ID-1: / raw-size: 266.13 GiB size: 260.89 GiB (98.03%) used: 205.02 GiB (78.6%) 
           fs: ext4 dev: /dev/sda2 maj-min: 8:2 
           ID-2: /boot/efi raw-size: 512 MiB size: 511 MiB (99.80%) used: 371.9 MiB (72.8%) 
           fs: vfat dev: /dev/sda1 maj-min: 8:1 
Swap:      Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 15.63 GiB used: 0 KiB (0.0%) priority: -2 
           dev: /dev/sda3 maj-min: 8:3 
Sensors:   System Temperatures: cpu: 36.5 C mobo: N/A 
           Fan Speeds (RPM): cpu: 0 
Repos:     Packages: 3120 note: see --pkg apt: 3110 lib: 1688 flatpak: 10 
           Active apt repos in: /etc/apt/sources.list 
           1: deb http://ftp.de.debian.org/debian/ bullseye-proposed-updates main contrib non-free
           2: deb http://security.debian.org/ bullseye-security non-free main contrib
           Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list 
           1: deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ bullseye main
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://ftp.de.debian.org/debian/ bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://ftp.de.debian.org/debian/ bullseye main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://ftp.tu-chemnitz.de/pub/linux/MX/Repo/mx/repo/ bullseye main non-free
           Active apt repos in: /etc/apt/sources.list.d/opera-stable.list 
           1: deb https://deb.opera.com/opera-stable/ stable non-free
           Active apt repos in: /etc/apt/sources.list.d/oracle.list 
           1: deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian/ bullseye contrib
           Active apt repos in: /etc/apt/sources.list.d/signal-xenial-added-by-mxpi.list 
           1: deb [arch=amd64] https://updates.signal.org/desktop/apt/ xenial main
           Active apt repos in: /etc/apt/sources.list.d/sublime-text.list 
           1: deb https://download.sublimetext.com/ apt/stable/
           Active apt repos in: /etc/apt/sources.list.d/winehq-bullseye.sources 
           1: deb [arch=amd64 i386] https://dl.winehq.org/wine-builds/debian bullseye main
Info:      Processes: 300 Uptime: 17m wakeups: 1 Memory: 15.39 GiB used: 2.62 GiB (17.0%) 
           Init: systemd v: 247 runlevel: 5 default: 5 tool: systemctl Compilers: 
           gcc: 10.2.1 alt: 10 Shell: Bash v: 5.1.4 
           running-in: quick-system-info-mx inxi: 3.3.06 
Boot Mode: UEFI

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 6:36 am
by Huckleberry Finn
Though this may not be the answer exactly to what you asked: Your snapshot iso would be the simplest. (I just wanted to remind all users the importance of "MX Snapshot" (and occasionally taking snapshots) by the way.)

Since it's about panel and desktop: Just create a new user with "MX User Manager", then login with that and see how it looks there.

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 7:05 am
by baldyeti
Before re-installing you may give a look at /var/log/apt/history.log and see if you find the list of packages that were uninstalled so you can simply re-install them (probably your icon theme amongst them...)

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 7:38 am
by rainfox
baldyeti wrote: Wed Apr 27, 2022 7:05 am Before re-installing you may give a look at /var/log/apt/history.log and see if you find the list of packages that were uninstalled so you can simply re-install them (probably your icon theme amongst them...)
I already took a look at the log file and tried to reinstall. But some packages failed with dependency error. Also a lot packages where uninstalled and it would be a pain to reinstall them all manually.
Because of this I tought reinstalling would be the easiest way.

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 7:42 am
by rainfox
Huckleberry Finn wrote: Wed Apr 27, 2022 6:36 am Though this may not be the answer exactly to what you asked: Your snapshot iso would be the simplest. (I just wanted to remind all users the importance of "MX Snapshot" (and occasionally taking snapshots) by the way.)

Since it's about panel and desktop: Just create a new user with "MX User Manager", then login with that and see how it looks there.
I only have a somewhat older backintime snapshot, that I havent tried yet.
Can I also use the mx installation iso for this?
I mean, could I simply perform the installation manually but skip disk formating? I just would need to know what command I have to use for this.

Once everything is working again, I will take a look at the MX Snapshot function.

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 8:04 am
by Huckleberry Finn
... But .. even if you do it without formatting (and no matter it's your snapshot or the official iso) , the current system will be overwritten "randomly" (hence destroyed) .. (... won't be repaired. I wish there was an option to just repair the missing/broken parts)

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 8:13 am
by Huckleberry Finn
At least you can take a list of the installed packages (by you) and install them all later at once.

And/or preserve home during installation (assuming settings in home are not broken, too)

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 10:49 am
by dolphin_oracle
you can use the "preserve" option in the format menu, and the system will keep your home folder, but nuke everything else.

If the issue is just that you've removed libraries, its unlikely to affect the home folder at all.

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 11:16 am
by baldyeti
rainfox wrote: Wed Apr 27, 2022 7:38 am I already took a look at the log file and tried to reinstall. But some packages failed with dependency error. Also a lot packages where uninstalled and it would be a pain to reinstall them all manually.
Because of this I tought reinstalling would be the easiest way.
How many packages are we talking ? A couple ? Tens ?
Installing many from the command line is not really a problem if you have a list (from history.log or otherwise), just use cut & paste

Code: Select all

sudo apt-get install <list-of-packages>
in theory at least, if you had never enabled troublesome repositories, it should be possible to re-install everything.
Reinstall from the regular MX ISO whilst preserving /home should also work, but you'd then have to add any SW you add accumulated besides the default

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 11:34 am
by dolphin_oracle
It doesn’t have to be at command line. You could use synaptic to point and click the changes

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 4:28 pm
by rainfox
Ok, I managed to bring at least the icons back and some other components from my backintime backup :-)

I also followed the hints how to get the installed packages. At the end this are not too much so I will follow @baldyeti's hint to reinstall from command line.
At least I can work again with the system. I will take a look at the reinstall and keep option later, maybe. Depends on system status.

There are still some unresolved dependencies, I can't e.g. start gimp, it's complaining about too old version of GEGL.
When doing a

Code: Select all

sudo apt --fix-broken install --install-recommends
I get some errors like this

Code: Select all

prepare to extract .../libva-x11-2_2.10.0-1_i386.deb ...
Exctracting libva-x11-2:i386 (2.10.0-1) ...
dpkg: Error while processing the archive /var/cache/apt/archives/libva-x11-2_2.10.0-1_i386.deb (--unpack):
 Failed to overwrite shared file »/usr/share/doc/libva-x11-2/changelog.gz« which is different from other instances of libva-x11-2:i386 
Error while processing:
 /var/cache/apt/archives/libva2_2.10.0-1_i386.deb
 /var/cache/apt/archives/libva-drm2_2.10.0-1_i386.deb
 /var/cache/apt/archives/libva-x11-2_2.10.0-1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
libva2 is only one package that fails to install again.
If I can't solve this, I tend more and more to reinstall if I have the time.

I've attached an excerpt of the history.log with the bad command, there you can see what was removed. I'm still surprised how easy it is to damage the system that much.

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 5:07 pm
by baldyeti
wow - over 550 packages removed (amongst which sddm & many plasma components), i am surprised you still have a graphical desktop at all !

what i have sometimes done in the past is try aptitude instead of apt (or apt-get) as aptitude sometimes suggests workarounds for broken dependencies issues - but depending on how many such issues or conflicts you have this may get real tedious and re-installing without touching /home end up being faster

wait a little and see if someone else chimes in, i am no apt guru

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 5:30 pm
by rainfox
Not all of them where removed. I canceled it when I saw the icons vanish :eek: There where some messages about
First I had fear that it would not reboot at all. But luckily it did. I immediately installed some packages back after this.

The term.log
part term.log.7z
is much more frightening:
e.g. systemd and sysvinit compenents where removed

Re: Reinstall over existing system?

Posted: Wed Apr 27, 2022 5:39 pm
by rainfox
baldyeti wrote: Wed Apr 27, 2022 5:07 pm what i have sometimes done in the past is try aptitude instead of apt (or apt-get) as aptitude sometimes suggests workarounds for broken dependencies issues - but depending on how many such issues or conflicts you have this may get real tedious and re-installing without touching /home end up being faster
I did not know this. This fixed my gimp installation as I was now able to install gegl with aptitude. Thanks ! :yay:
Also mx-snapshot was installed again.

Re: Reinstall over existing system?

Posted: Mon May 02, 2022 6:40 am
by Solon
rainfox you sound like a Linux 'power user' (unlike myself) so I will simply suggest that you have a look at this thread: sudo apt autoremove; a detailed discussion about this same topic with a lot of very knowledgeable MX folks which happened last year.

Much of what was discussed there went over my head, but one thing really hit home, and that was Post #16 which I will put here (I highlighted dolphin_oracle's key advice in red):
dolphin_oracle wrote: Thu Jul 22, 2021 6:37 pm
Ironfighter wrote: Thu Jul 22, 2021 6:06 pm This is quite an eye opener for me. I do my updates regularly and if I see the auto remove message that’s what I do. I have never broken anything in the past 2 years since I left Windows for MX. But it seems I could have done?

My question is how does a non technical user like myself decide what to do if I see that message? Is there a “how to” guide?
what I do is...if the autoremove only removes the things that were expected, then its OK. if all of a sudden 100s of packages are being removed, then I stop the process.
In addition to being good advice, that wry admission always makes me smile! 9_9

Re: Reinstall over existing system?

Posted: Mon May 02, 2022 3:41 pm
by rainfox
Hi Solon, thanks for pointing this out, very good thread. I would myself not describe as an power user, but I keep learning.
I'm also happy to have switched from Win10 to MX Linux. I like it a lot.

Re: Reinstall over existing system?

Posted: Fri May 06, 2022 10:38 am
by eyduh
If you reinstall from scratch but preserve /home you have to be diligent with the formatting options and the prompt that come up when you press next.

If you do decide this route, you can
preserve ESP or boot (whichever one you're using),
format root
preserve home.

Make sure any other drives you have don't get formatted as wel though, the installer seems to sometimes fill in some stuff to get formatted when they shouldnt be. Just make sure to check out the Details button of the prompt when you press next after the formatting step.

it does get a bit trickier if you're using LUKS or LVM but the theory is the same, just might involve trips to Disks to open/mount stuff between.

Bonus: if you use flatpak user installs for softwares they get preserved as well as they get installed to ~/.var I've carried some commonly used programs between different distros by always preserving /home q: (it does get a bit messy after a while and I'm probably due for a fresh start with /home soon but saved me some headaches when distrohopping for a while)