日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

修复删除/var/lib/dpkg目录后,无法使用apt-get命令问题

發布時間:2023/12/6 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 修复删除/var/lib/dpkg目录后,无法使用apt-get命令问题 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

Unfortunately I've deleted?dpkg?directory while removing the lock. By mistake I typed

root@sam:~$ rm -r /var/lib/dpkg

Now when I am trying to install/uninstall packages it shows me following error.

E: Could not open lock file /var/lib/dpkg/lock - open (2: No such file or directory)

What should I do now?

解決:

?

You removed 5 directories, the status file, etc. So, lets try to fix the stuff. First, create the directory:

sudo mkdir -p /var/lib/dpkg/{alternatives,info,parts,triggers,updates}

Recover some backups:

sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status

Now, let's see if your dpkg is working (start praying):

apt-get download dpkg sudo dpkg -i dpkg*.deb

If everything is "ok" then repair your base files too:

apt-get download base-files sudo dpkg -i base-files*.deb

Now try to update your package list, etc.:

dpkg --audit sudo apt-get update sudo apt-get check

Now, let's take a deep breath. Phew. Do?ls -l /var/lib/dpkg?and compare with the above list. If some?-old?file is not present don't worry it will be there tomorrow.

轉載于:https://my.oschina.net/u/2525089/blog/1913800

總結

以上是生活随笔為你收集整理的修复删除/var/lib/dpkg目录后,无法使用apt-get命令问题的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。