1. sudo apt-get update
2. sudo apt-get install mysql-server mysql-client
- 若出现如下错误,无法安装!!
jianliu@ubuntu:~$ sudo apt-get install mysql-server
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:
mysql-server : Depends: mysql-server-5.5 but it is not going to be installed
mysql-workbench-community : Depends: libctemplate2 but it is not going to be installed
Depends: libpcrecpp0 (>= 7.7) but it is not going to be installed
Depends: libtinyxml2.6.2 but it is not going to be installed
Depends: libzip2 (>= 0.10) but it is not going to be installed
Depends: python-paramiko but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
3. sudo apt-get -f install, 再执行2步骤
———-解决上述的依赖项问题。
jianliu@ubuntu:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
libctemplate2 libpcrecpp0 libtinyxml2.6.2 libzip2 python-paramiko
The following NEW packages will be installed:
libctemplate2 libpcrecpp0 libtinyxml2.6.2 libzip2 python-paramiko
0 upgraded, 5 newly installed, 0 to remove and 724 not upgraded.
1 not fully installed or removed.
Need to get 320 kB of archives.
After this operation, 1,711 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://mirrors.aliyun.com/ubuntu/ trusty/universe libctemplate2 amd64 2.2-4ubuntu3 [136 kB]
Get:2 https://mirrors.aliyun.com/ubuntu/ trusty-updates/main libpcrecpp0 amd64 1:8.31-2ubuntu2.3 [14.5 kB]
Get:3 https://mirrors.aliyun.com/ubuntu/ trusty/universe libtinyxml2.6.2 amd64 2.6.2-2 [35.0 kB]
Get:4 https://mirrors.aliyun.com/ubuntu/ trusty/main libzip2 amd64 0.10.1-1.2 [29.0 kB]
Get:5 https://mirrors.aliyun.com/ubuntu/ trusty/main python-paramiko all 1.10.1-1git1build1 [106 kB]
Fetched 320 kB in 1s (258 kB/s)
Selecting previously unselected package libctemplate2.
(Reading database ... 172453 files and directories currently installed.)
Preparing to unpack .../libctemplate2_2.2-4ubuntu3_amd64.deb ...
Unpacking libctemplate2 (2.2-4ubuntu3) ...
Selecting previously unselected package libpcrecpp0:amd64.
Preparing to unpack .../libpcrecpp0_1%3a8.31-2ubuntu2.3_amd64.deb ...
Unpacking libp