惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
MyScale Blog
MyScale Blog
Jina AI
Jina AI
B
Blog
Microsoft Security Blog
Microsoft Security Blog
T
Troy Hunt's Blog
博客园_首页
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
GbyAI
GbyAI
T
Tenable Blog
B
Blog RSS Feed
S
Securelist
T
Threat Research - Cisco Blogs
P
Privacy International News Feed
P
Proofpoint News Feed
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
C
CXSECURITY Database RSS Feed - CXSecurity.com
罗磊的独立博客
AWS News Blog
AWS News Blog
V
V2EX
宝玉的分享
宝玉的分享
J
Java Code Geeks
小众软件
小众软件
Spread Privacy
Spread Privacy
腾讯CDC
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
V
Visual Studio Blog
The Hacker News
The Hacker News
C
CERT Recently Published Vulnerability Notes
Project Zero
Project Zero
Know Your Adversary
Know Your Adversary
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
NISL@THU
NISL@THU
C
Check Point Blog
Webroot Blog
Webroot Blog
D
DataBreaches.Net
Cloudbric
Cloudbric
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家

sakurawald's blog

fix-window-tearing-in-high-monitor-refresh-rate fix-nvidia-drm-issues fix-screen-brightness-too-low Fix sddm black screen issue comparing-emacs-and-idea-in-java-development-environment fix the cpu frequency throttle after bad charging how to fix corrupted packages in archlinux how to let chrome browser auto clean datas on exit make persistent windows 11 usb sticker pin refresh rate of an android phone launch tor browser without tor network apple magic touch pad review guide to install qubes on qemu optimize minecraft server configuration tweak KDE preferences android emulator methods in linux expression evulation
rescue a corrupted system after forced shutdown during system upgrade
2024-03-13 · via sakurawald's blog

Cause

While running the command pacman -Syu, I do some other works.
And the os is frozen. After reboot the computer, I failed to boot into the os.
Stuck in the boot screen with error msg “[Failed] failed to start d-bus message service”

Observation

The boot screen shows the error msg “[Failed] failed to start d-bus message service”, which says that the service dbus-broker service is broken. (Some problems with d-bus service)

I can’t change to another terminal using ctrl + alt + F3. (The d-bus related problem)

The plasma desktop is broken and says some theme .qml files are missing, so i can’t login into the dekstop. (It’s like some of the plasma packages are corrupted)

If you use a arch-installer sticker, and mount the os, run pacman -Syu again, the output says there is nothing to update. However, if you try run pacman -S <some package> you will get many errors like <some libraries> is empty (It’s like some libraries or packages is corrupted while upgrading)

In short, the method is to find what packages is corrupted and we manually reinstall all the corrupted packages.

Solution

And since it makes me very angry to come to a forum looking for a solution to a problem and see that the thread ends with "Don't worry, I've already solved it" without any further information, here are the steps to follow (based on my notes), for future seekers of solutions to their problems:

1. Boot the computer with an ArchLinux ISO installed on a pendrive (Ventoy is a REALLY useful tool GOOD for this kind of thing)

TIP: To increase the terminal font size we will execute 'setfont ter-124b', and to configure the keyboard with our language we will execute 'loadkeys <country-code>'.

2. Check that we have internet available on the machine ('ip a addr')
3. We will mount the root partition of the computer in /mnt
4. Chroot to the previous mount point ('arch-chroot /mnt')
5. Once in chroot we will mount a memory stick to record different outputs of the executed commands ('fdisk -l' to know the drive of the memory stick)
6. Run the command provided by seth, removing '--root /mnt' and the grep part, redirecting the output along with 'stderror' output, to a file on the memory stick:

sudo LC_ALL=C pacman -Qkk >> <memory-stick-mount-point>/<file.txt> 2>&1

7. We will filter the previous file with 'awk' to find the lines that contain 'mtree', that is, those that contain the defective packages, and we will redirect it to another file on the pendrive that will later serve as reference for reinstalling the packages that fail, viewing it on any other computer/tablet/mobile into which we will plug the memory stick.

awk '/mtree/ {print}' <file.txt-from-step-6> > <file.txt>

8. We will unmount the memory stick and unplug it from the computer to plug it into another computer/tablet/mobile to view/control the packages to be reinstalled.
9. For each package to be reinstalled we will execute the following two commands:

1st. sudo pacman -S --dbonly <package>
2nd. sudo pacman -S <package>

IMPORTANT1: It is important to execute the two commands in the indicated order, because if we execute the 2nd one first, it will cause an error saying that certain files already exist, and the installation will stop.
IMPORTANT2: Although the 1st command also offers the possibility of installing the package, both commands DO NOT do the same thing. So it is important to execute both, and in the indicated order.
NOTE1: If throughout the process we see that pacman complains that some libraries in /usr/lib have size 0 (i.e.: they are empty), we should not worry since the libraries will be installed as we reinstall the packages.
NOTE2: If once all the packages have been reinstalled, in the last one we notice that Pacman is still complaining that some libraries with size 0 still exist, we will look at which application they belong to and we will reinstall said application to leave everything clean ( It has happened to me in particular with 3 Okular libraries, and this one did not appear in the list of defective packages).

10. Once all the defective packages have been reinstalled, we will do a full system update ('sudo pacman -Syu'), and once done we will run a system check again (steps 6 and 7) to verify that there are no more defective packages.
11. If everything is fine and we no longer have any defective packages, we will exit the chroot with 'exit', and once at the ArchISO prompt (1) we will unmount all the mount points (umount -a ), and (2) we will do a reboot.
12. If everything went well, the system will start as usual.

--- "Y COLORIN COLORADO ESTE CUENTO HA ACABADO ... FELIZMENTE" --

Last edited by JosepF (2024-03-09 14:41:27)

Summary

  1. Don’t do other jobs while the system is upgrading. It’s may increase the possibility whole os is frozen.
  2. Always carry a rescue sticker if you are a linux user.

Reference

  1. https://bbs.archlinux.org/viewtopic.php?id=293521