
我嘗試samba-server
使用此命令(sudo tasksel remove samba-server
)刪除,每個應用程式甚至系統應用程式都已刪除,現在 xubuntu 卡在啟動時,只顯示載入。我該怎麼辦?
tasksel
我的檔案也被刪除了嗎?
答案1
TL;DR - 這是一個嚴重的錯誤,不要使用taskel來刪除東西!
分析
以下是可用選項tasksel
:
$ tasksel --help
Unknown option: help
Usage:
tasksel install <task>...
tasksel remove <task>...
tasksel [options]
-t, --test test mode; don't really do anything
--new-install automatically install some tasks
--list-tasks list tasks that would be displayed and exit
--task-packages list available packages in a task
--task-desc returns the description of a task
Samba 任務的命名如samba-server
您所寫:
$ tasksel --list-tasks | grep -i Samba
u samba-server Samba file server
它僅包含一個包:
$ tasksel --task-packages samba-server
samba-server^
如果我們嘗試模擬卸載 - 我們會得到以下行:
$ sudo tasksel --test remove samba-server
debconf-apt-progress -- apt-get -q -y \
-o APT::Install-Recommends=true \
-o APT::Get::AutomaticRemove=true -o APT::Acquire::Retries=3 \
install samba-server^-
(在上面的行中最後一個連字符-
會導致問題)。
我做了什麼:
- 啟動 Ubuntu 18.04 LTS 乾淨的 VM,安裝
tasksel
了sudo apt-get install tasksel
- 安裝了 Samba
sudo tasksel install samba-server
- 然
sudo tasksel remove samba-server
- 重新啟動並在下次啟動時損壞系統
修復系統
然後我嘗試修復系統:
我們需要啟動恢復模式(點選Shift啟動,在 GRUB 中選擇Ubuntu 的進階選項, 選擇Ubuntu,搭配 Linux ...(恢復模式))
選擇
resume Resume normal boot
存取登入 shellCtrl使用+ Alt+開啟第一個控制台#1,1然後登入
如果您沒有網際網路 - 檢查乙太網路介面名稱並在其上手動執行 DHCP 用戶端:
ifconfig -a # got enp0s3 sudo dhclient enp0s3
將元包重新安裝
xubuntu-desktop
到系統:sudo apt-get install xubuntu-desktop
重新啟動後我可以存取系統。
結論
所以這似乎是一個嚴重的錯誤 - 我發現了一些幾乎相同症狀的錯誤:
- 2010 年 5 月 3 日報告的 bug 574287 - “tasksel:當任務重疊時強制刪除包”
- bug 1338223 於 2014-07-06 報告 - “Tasksel 已刪除我的所有資料!”。
我也提交了新的bug 1779645 “tasksel 中的嚴重錯誤:tasksel remove task-name
刪除整個系統”