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

推荐订阅源

N
News and Events Feed by Topic
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
Jina AI
Jina AI
H
Help Net Security
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
L
LangChain Blog
Recorded Future
Recorded Future
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
GbyAI
GbyAI
B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
M
MIT News - Artificial intelligence
爱范儿
爱范儿
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Y
Y Combinator Blog
B
Blog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
W
WeLiveSecurity
MongoDB | Blog
MongoDB | Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
The Cloudflare Blog
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
D
DataBreaches.Net
博客园 - 【当耐特】
T
Troy Hunt's Blog
V
Visual Studio Blog
V2EX - 技术
V2EX - 技术
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog

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