1. 程式人生 > 實用技巧 >本機環境virtualbox出現問題重灌

本機環境virtualbox出現問題重灌

vagrant reload 的時候 電腦卡住宕機了,然後我重啟了以後就沒辦法啟動了,於是重灌這個 vagrant

使用sudo apt-get remove vagrant 然後如果清除不乾淨就sudo apt-get autoremove 執行一下

然後重新安裝sudo apt-get install vagrant

然後是virtualbox的清理

sudo apt-get remove virtualbox

sudo apt-get autoremove

之後看這篇文章

https://phoenixnap.com/kb/install-virtualbox-on-ubuntu

ubuntu 安裝 virtualbox 我使用的就是

sudo apt-get update
sudo apt-get install virtualbox–6.0

之後我重新啟動,遇到一個提示

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

DEBIAN_FRONTEND=noninteractive apt-get install -y linux-headers-`uname -r` dkms

Stdout from the command:
Stderr from the command: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

然後我就 sudo vagrant ssh 進去

手動執行

sudo DEBIAN_FRONTEND=noninteractive apt-get install -y linux-headers-`uname -r` dkms

然後提示我

E: dpkg was interrupted, you must manually run '
sudo dpkg --configure -a' to correct the problem.

我就再次執行

sudo dpkg --configure -a

然後就順利執行了 結果如下:

sudo DEBIAN_FRONTEND=noninteractive apt-get install -y linux-headers-`uname -r` dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
dkms is already the newest version (2.2.0.3-2ubuntu11.8).
linux-headers-4.4.0-142-generic is already the newest version (4.4.0-142.168).
The following packages were automatically installed and are no longer required:
  libmcrypt4 libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 libpcre2-dev libpcre2-posix2 libzip4
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  nodejs
The following packages will be upgraded:
  nodejs
1 upgraded, 0 newly installed, 0 to remove and 233 not upgraded.
1 not fully installed or removed.
Need to get 0 B/18.2 MB of archives.
After this operation, 118 kB of additional disk space will be used.
(Reading database ... 95928 files and directories currently installed.)
Preparing to unpack .../nodejs_12.18.3-1nodesource1_amd64.deb ...
Detected old npm client, removing...
Unpacking nodejs (12.18.3-1nodesource1) over (12.18.2-1nodesource1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up nodejs (12.18.3-1nodesource1) ...

然後我sudo vagrant reload --provision 就可以了