ubuntu16.04安装virtualbox

1、下载virtualBox的Ubunut安装包

sudo wget http://download.virtualbox.org/virtualbox/5.1.14/virtualbox-5.1_5.1.14-112924~Ubuntu~xenial_amd64.deb

我下的是最新版的,。。。最新的是6.0.8

# 安装
sudo dpkg -i virtualbox-6.0_6.0.8-130520_Ubuntu_xenial_amd64.deb

2、缺失依赖:libqt5x11extras5 和 libsdl1.2debian

注意:安装过程中可能会报错:关于: libqt5x11extras5 和 libsdl1.2debian 的错误

# 安装 需要的两个依赖:
 sudo apt-get install libqt5x11extras5 libsdl1.2debian

需要注意:

一、执行如下命令,如果返回为空,则需要进行下面二、三步骤的安装

egrep --color 'vmx|svm' /proc/cpuinfo

二、安装VirtualBox (不同操作系统安装virtualbox,还是KVM,或其他,根据操作系统和情况决定)

1、添加VirtualBox的源

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list.d/virtualbox.list'

2、添加密钥

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -

可以参考:https://www.virtualbox.org/wiki/Linux_Downloads

3、执行更新

sudo apt update

4、安装

sudo apt install virtualbox-5.2/

sudo apt-get install virtualbox-6.0

二、安装kubectl

https://kubernetes.io/docs/tasks/tools/install-kubectl/

1、执行如下命令

sudo apt-get update && sudo apt-get install -y apt-transport-https

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add –

echo“deb https://apt.kubernetes.io/ kubernetes-xenial main” | sudo tee -a /etc/apt/sources.list.d/kubernetes.list

sudo apt-get update

sudo apt-get install -y kubectl

2、install snap with ubuntu

sudo snap install kubectl –classic

kubectl version

3、出现的问题和解决办法:

1、安装virtualbox时,执行sudo apt-get -f install virtualbox-6.0时报错如下

root@tt-test:~# sudo apt-get install virtualbox-6.0

Reading package lists... Done

Building dependency tree       

Reading state information... Done

You might want to run 'apt-get -f install' to correct these:

The following packages have unmet dependencies:

 percona-xtrabackup-24 : Depends: libcurl3 (>= 7.16.3) but it is not going to be installed

                         Depends: libev4 (>= 1:4.04) but it is not going to be installed

 virtualbox-6.0 : Depends: libcurl3 (>= 7.16.2) but it is not going to be installed

                  Depends: libopus0 (>= 1.1) but it is not going to be installed

                  Depends: libsdl1.2debian (>= 1.2.11) but it is not going to be installed

                  Depends: libxmu6 but it is not going to be installed

                  Recommends: libsdl-ttf2.0-0 but it is not going to be installed

                  Recommends: pdf-viewer

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

解决办法:

sudo apt-get -f install

2、curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add –

执行此命令时,提示错误:

gpg: no valid OpenPGP data found.

解决办法:把命令分开执行

1)使用可以FQ的网络,https://packages.cloud.google.com/apt/doc/apt-key.gpg下载这个文件

2)再执行

sudo apt-key add apt-key.gpg

 

文 / Aex
LEAVE A REPLY
loading