iT邦幫忙

0

ubuntu 14.04版本無法安裝my sql 5.6

Hi 各位大神好

小弟的ubuntu 版本為14.04.1
Linux ubuntu 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

有按照下列網頁安裝php、apache2、mysql 5.6
https://tecadmin.net/install-php-7-0-apache-2-4-mysql-5-6-on-ubuntu/

但是安裝到mysql5.6的時候,下以下三個指令
sudo add-apt-repository -y ppa:ondrej/mysql-5.6
$ sudo apt-get update
$ sudo apt-get install mysql-server-5.6

當下sudo apt-get install mysql-server-5.6指令時,出現下列訊息:

mysql-server-5.6 : Depends: mysql-common (>= 5.6.22-1~) but 5.5.54-0ubuntu0.14.04.1 is to be installed
Recommends: libhtml-template-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

mysql-server-5.6 : Depends: mysql-common (>= 5.6.22-1~) but 5.5.54-0ubuntu0.14.04.1 is to be installed
Recommends: libhtml-template-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

小弟查了一下,貌似依賴性軟體需要再安裝,可否請各位大大指示一下,後續該如何安裝,是因為ubuntu版本的問題嗎???

抱歉,再請各位大大提示一下,謝謝。

3
bizpro
iT邦大師 1 級 ‧ 2017-03-22 20:47:56
最佳解答

E: Unable to correct problems, you have held broken packages

這個錯誤訊息是因為存在不完全套件(broken packages), 以此案例來說, 是mysql-common,
請問您是裝Ubuntu桌面版嗎? Ubuntu Server版並不會有mysql-common.

Ubuntu桌面版內定會安裝一些mysql的套件給Qt和Python用, 在安裝某些軟體時也會裝一些mysql的套件, 如果有衝突,要先移除mysql-common, 而mysql-common有許多相依套件, 因此要先移除這些相依套件, 我的Ubuntu 16.04.02桌面版有以下套件,您的系統可能不同:

$ dpkg --get-selections | grep mysql
libmysqlclient18:amd64				deinstall
libmysqlclient18:i386				deinstall
libmysqlclient20:amd64				install
libmysqlclient20:i386				install
libqt4-sql-mysql:i386				install
mysql-common					install
python-mysqldb					install

其中我要保留Qt和Python的套件, 因此去除libmysqlclient18, libmysqlclient20和mysql-common:

$ sudo apt-get clean
$ sudo apt-get update
$ sudo apt-get purge libmysqlclient18 libmysqlclient20 mysql-common

如果以上的任何指令產生相依問題, 那就先purge那個套件.
如果還不乾淨:

$ sudo apt-get purge mysql-workbench mysql-server mysql-common mysql-client

最後:

$ sudo apt-get autoremove

20170323T1123:
mysql-common並非造成不完全套件的問題, 而是ppa:ondrej/mysql-5.6有問題, 請看以下的回覆

看更多先前的回應...收起先前的回應...
SunAllen iT邦高手 1 級 ‧ 2017-03-22 21:05:00 檢舉

/images/emoticon/emoticon07.gif/images/emoticon/emoticon12.gif

bochun iT邦新手 5 級 ‧ 2017-03-23 10:55:13 檢舉

Hi Sir
小弟下指令如下:
dpkg --get-selections | grep mysql
沒有顯示出訊息,看來貌似沒有找到mysql的相關套件

另外這個系統灌的是Server版本,會不會是ubuntu 14.04的版本不support mysql 5.6???

bizpro iT邦大師 1 級 ‧ 2017-03-23 11:19:44 檢舉

抱歉, 我誤以為是mysql-common的問題.
結果是這個ppa ppa:ondrej/mysql-5.6有問題. 這個ppa包裝了mysql 5.5的套件, 造成不完全套件的問題.
請不要用這個ppa. 請去掉這個ppa:

$ sudo add-apt-repository --remove ppa:ondrej/mysql-5.6
$ sudo apt-get clean
$ sudo apt-get update

Ubuntu官方有正式套件. 直接安裝mysql-5.6, 不要用外來的ppa:
$ sudo apt-get install mysql-server-5.6

bizpro iT邦大師 1 級 ‧ 2017-03-23 13:23:57 檢舉

這個教學可以用在Ubuntu 14.04, 不過還是建議用16.04, 因為Kernel不同.
https://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-on-ubuntu-16-04-lamp/

bochun iT邦新手 5 級 ‧ 2017-03-23 17:44:46 檢舉

Hi bizpro大大

已經可以安裝mysql 5.6了,多謝大大相助

但是現在又需要安裝phpmyadmin,安裝完後,apache2 居然無法重新啟動.....不好意思,小弟剛碰linux系統,可否請大大指導一下....

kenchen@ubuntu:/var/www/html$ sudo apt-get -y install phpmyadmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
dbconfig-common fontconfig-config fonts-dejavu-core javascript-common
libapache2-mod-php5 libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8
libjs-codemirror libjs-jquery libjs-jquery-cookie libjs-jquery-event-drag
libjs-jquery-metadata libjs-jquery-mousewheel libjs-jquery-tablesorter
libjs-jquery-ui libjs-underscore libmcrypt4 libtiff5 libwebp5 libxpm4
libxslt1.1 php-gettext php-pear php-xml php5-cli php5-common php5-gd
php5-json php5-mcrypt php5-mysql php5-readline php7.1-common php7.1-xml
Suggested packages:
libgd-tools libjs-jquery-ui-docs libmcrypt-dev mcrypt php5-user-cache
mysql-server
Recommended packages:
mysql-client
The following NEW packages will be installed:
dbconfig-common fontconfig-config fonts-dejavu-core javascript-common
libapache2-mod-php5 libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8
libjs-codemirror libjs-jquery libjs-jquery-cookie libjs-jquery-event-drag
libjs-jquery-metadata libjs-jquery-mousewheel libjs-jquery-tablesorter
libjs-jquery-ui libjs-underscore libmcrypt4 libtiff5 libwebp5 libxpm4
libxslt1.1 php-gettext php-pear php-xml php5-cli php5-common php5-gd
php5-json php5-mcrypt php5-mysql php5-readline php7.1-common php7.1-xml
phpmyadmin
0 upgraded, 37 newly installed, 0 to remove and 129 not upgraded.
Need to get 13.9 MB of archives.
After this operation, 63.5 MB of additional disk space will be used.
Get:1 http://hk.archive.ubuntu.com/ubuntu/ trusty/main fonts-dejavu-core all 2.34-1ubuntu1 [1,024 kB]
Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main libjbig0 amd64 2.1-3.1+deb.sury.org~trusty+1 [26.5 kB]
Get:3 http://hk.archive.ubuntu.com/ubuntu/ trusty-updates/main fontconfig-config all 2.11.0-0ubuntu4.2 [47.4 kB]
Get:4 http://hk.archive.ubuntu.com/ubuntu/ trusty-updates/main libfontconfig1 amd64 2.11.0-0ubuntu4.2 [123 kB]
Get:5 http://hk.archive.ubuntu.com/ubuntu/ trusty/main libjpeg-turbo8 amd64 1.3.0-0ubuntu2 [104 kB]
Get:6 http://hk.archive.ubuntu.com/ubuntu/ trusty/main libjpeg8 amd64 8c-2ubuntu8 [2,194 B]
Get:7 http://hk.archive.ubuntu.com/ubuntu/ trusty-updates/main libtiff5 amd64 4.0.3-7ubuntu0.6 [144 kB]
Get:8 http://hk.archive.ubuntu.com/ubuntu/ trusty-updates/main libxpm4 amd64 1:3.5.10-1ubuntu0.1 [33.2 kB]
Get:9 http://hk.archive.ubuntu.com/ubuntu/ trusty/main libxslt1.1 amd64 1.1.28-2build1 [145 kB]
Get:10 http://hk.archive.ubuntu.com/ubuntu/ trusty/main php5-json amd64 1.3.2-2build1 [34.4 kB]
Get:11 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main libwebp5 amd64 0.4.4-1+deb.sury.org~trusty+1 [163 kB]
Get:12 http://hk.archive.ubuntu.com/ubuntu/ trusty-updates/main php5-common amd64 5.5.9+dfsg-1ubuntu4.21 [448 kB]
Get:13 http://hk.archive.ubuntu.com/ubuntu/ trusty-updates/main php5-gd amd64 5.5.9+dfsg-1ubuntu4.21 [28.1 kB]
Get:14 http://hk.archive.ubuntu.com/ubuntu/ trusty-updates/main php5-mysql amd64 5.5.9+dfsg-1ubuntu4.21 [63.2 kB]
Get:15 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main libgd3 amd64 2.2.3-3+deb.sury.org~trusty+0 [131 kB]
Get:16 http://hk.archive.ubuntu.com/ubuntu/ trusty-updates/main php5-cli amd64 5.5.9+dfsg-1ubuntu4.21 [2,166 kB]
23% [16 php5-cli 617 kB/2,166 kB 28%] [Waiting for headers] 511 kB/s 226% [16 php5-cli 1,128 kB/2,166 kB 52%] [Waiting for headers] 511 kB/s 128% [16 php5-cli 1,305 kB/2,166 kB 60%] [Waiting for headers] 511 kB/s 132% [16 php5-cli 1,853 kB/2,166 kB 86%] [Waiting for headers] 511 kB/s 132% [16 php5-cli 1,853 kB/2,166 kB 86%] [Waiting for headers] 511 kB/s 133% [16 php5-cli 2,089 kB/2,166 kB 96%] [Waiting for headers] 511 kB/s 134% [Waiting for headers] 511 kB/s 1 Get:17 http://hk.archive.ubuntu.com/ubuntu/ trusty-updates/main php5-readline amd64 5.5.9+dfsg-1ubuntu4.21 [12.1 kB]
34% [17 php5-readline 2,696 B/12.1 kB 22%] [Waiting for headers] 511 kB/s 134% [Waiting for headers] [Waiting for headers] 511 kB/s 134% [Waiting for headers] [Waiting for headers] 511 kB/s 1 Get:18 http://hk.archive.ubuntu.com/ubuntu/ trusty/main dbconfig-common all 1.8.47+nmu1 [468 kB]
34% [18 dbconfig-common 1,234 B/468 kB 0%] [Waiting for headers] 511 kB/s 137% [Waiting for headers] 511 kB/s 1 Get:19 http://hk.archive.ubuntu.com/ubuntu/ trusty/main javascript-common all 11 [6,066 B]
37% [Waiting for headers] 511 kB/s 137% [Waiting for headers] [Waiting for headers] 511 kB/s 137% [Waiting for headers] [Waiting for headers] 511 kB/s 137% [Waiting for headers] [Waiting for headers] 511 kB/s 137% [Waiting for headers] [Waiting for headers] 511 kB/s 1 Get:20 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main php7.1-common amd64 7.1.3+-2+deb.sury.org~trusty+1 [871 kB]
37% [Waiting for headers] [20 php7.1-common 4,135 B/871 kB 0%] 511 kB/s 144% [Waiting for headers] 480 kB/s 1 Get:21 http://hk.archive.ubuntu.com/ubuntu/ trusty-updates/main libapache2-mod-php5 amd64 5.5.9+dfsg-1ubuntu4.21 [2,211 kB]
60% [Waiting for headers] 480 kB/s 1 Get:22 http://hk.archive.ubuntu.com/ubuntu/ trusty/main libjs-jquery all 1.7.2+dfsg-2ubuntu1 [78.8 kB]
60% [22 libjs-jquery 1,235 B/78.8 kB 2%] [Waiting for headers] 480 kB/s 160% [Waiting for headers] 480 kB/s 1 Get:23 http://hk.archive.ubuntu.com/ubuntu/ trusty/universe libjs-jquery-cookie all 8-2 [6,502 B]
60% [Waiting for headers] [Waiting for headers] 480 kB/s 1 Get:24 http://hk.archive.ubuntu.com/ubuntu/ trusty/universe libjs-jquery-event-drag all 8-2 [11.2 kB]
60% [Waiting for headers] [Waiting for headers] 480 kB/s 1 Get:25 http://hk.archive.ubuntu.com/ubuntu/ trusty/main libjs-jquery-metadata all 8-2 [6,856 B]
60% [Waiting for headers] [Waiting for headers] 480 kB/s 1 Get:26 http://hk.archive.ubuntu.com/ubuntu/ trusty/universe libjs-jquery-mousewheel all 8-2 [7,076 B]
60% [Waiting for headers] 480 kB/s 1 Get:27 http://hk.archive.ubuntu.com/ubuntu/ trusty/main libjs-jquery-tablesorter all 8-2 [64.0 kB]
61% [Waiting for headers] 480 kB/s 1 Get:28 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main php7.1-xml amd64 7.1.3+-2+deb.sury.org~trusty+1 [113 kB]
61% [Waiting for headers] [28 php7.1-xml 1,215 B/113 kB 1%] 480 kB/s 162% [Waiting for headers] 480 kB/s 1 Get:29 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main php-xml all 1:7.1+50+deb.sury.org~trusty+1 [5,176 B]
62% [Waiting for headers] [29 php-xml 1,218 B/5,176 B 24%] 480 kB/s 162% [Waiting for headers] 480 kB/s 1 Get:30 http://hk.archive.ubuntu.com/ubuntu/ trusty/universe libjs-jquery-ui all 1.10.1+dfsg-1 [458 kB]
62% [30 libjs-jquery-ui 1,234 B/458 kB 0%] [Waiting for headers] 480 kB/s 165% [Waiting for headers] 480 kB/s 1 Get:31 http://hk.archive.ubuntu.com/ubuntu/ trusty/main libjs-underscore all 1.4.4-2ubuntu1 [45.6 kB]
65% [Waiting for headers] 480 kB/s 1 Get:32 http://hk.archive.ubuntu.com/ubuntu/ trusty/universe libmcrypt4 amd64 2.5.8-3.1ubuntu1 [61.9 kB]
65% [32 libmcrypt4 1,236 B/61.9 kB 2%] [Waiting for headers] 480 kB/s 166% [Waiting for headers] 480 kB/s Get:33 http://hk.archive.ubuntu.com/ubuntu/ trusty/universe php5-mcrypt amd64 5.4.6-0ubuntu5 [15.4 kB]
66% [33 php5-mcrypt 1,236 B/15.4 kB 8%] [Waiting for headers] 480 kB/s 66% [Waiting for headers] [Waiting for headers] 480 kB/s 66% [Waiting for headers] [Waiting for headers] 480 kB/s Get:34 http://hk.archive.ubuntu.com/ubuntu/ trusty/universe libjs-codemirror all 2.23-1 [210 kB]
66% [34 libjs-codemirror 5,614 B/210 kB 3%] [Waiting for headers] 480 kB/s 67% [Waiting for headers] 480 kB/s Get:35 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main php-pear all 1:1.10.1+submodules+notgz-8+donate.sury.org~trusty+2 [283 kB]
67% [Waiting for headers] [35 php-pear 4,135 B/283 kB 1%] 480 kB/s 69% [Waiting for headers] 480 kB/s Get:36 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main php-gettext all 1.0.11-2+deb.sury.org~trusty+1 [15.9 kB]
69% [Waiting for headers] [36 php-gettext 9,977 B/15.9 kB 63%] 480 kB/s 70% [Waiting for headers] 480 kB/s 70% [Waiting for headers] 480 kB/s 70% [Waiting for headers] 480 kB/s 70% [Waiting for headers] 596 kB/s 70% [Waiting for headers] 596 kB/s 70% [Waiting for headers] 596 kB/s 70% [Waiting for headers] 596 kB/s 70% [Waiting for headers] 596 kB/s 70% [Waiting for headers] 596 kB/s Get:37 http://hk.archive.ubuntu.com/ubuntu/ trusty/universe phpmyadmin all 4:4.0.10-1 [4,224 kB]
70% [37 phpmyadmin 4,152 B/4,224 kB 0%] 596 kB/s 97% [37 phpmyadmin 3,749 kB/4,224 kB 89%] 596 kB/s 100% [Working] 596 kB/s Fetched 13.9 MB in 21s (636 kB/s)
Extracting templates from packages: 100%
Preconfiguring packages ...
Selecting previously unselected package fonts-dejavu-core.
(Reading database ... 59087 files and directories currently installed.)
Preparing to unpack .../fonts-dejavu-core_2.34-1ubuntu1_all.deb ...
Unpacking fonts-dejavu-core (2.34-1ubuntu1) ...
Selecting previously unselected package fontconfig-config.
Preparing to unpack .../fontconfig-config_2.11.0-0ubuntu4.2_all.deb ...
Unpacking fontconfig-config (2.11.0-0ubuntu4.2) ...
Selecting previously unselected package libfontconfig1:amd64.
Preparing to unpack .../libfontconfig1_2.11.0-0ubuntu4.2_amd64.deb ...
Unpacking libfontconfig1:amd64 (2.11.0-0ubuntu4.2) ...
Selecting previously unselected package libjpeg-turbo8:amd64.
Preparing to unpack .../libjpeg-turbo8_1.3.0-0ubuntu2_amd64.deb ...
Unpacking libjpeg-turbo8:amd64 (1.3.0-0ubuntu2) ...
Selecting previously unselected package libjpeg8:amd64.
Preparing to unpack .../libjpeg8_8c-2ubuntu8_amd64.deb ...
Unpacking libjpeg8:amd64 (8c-2ubuntu8) ...
Selecting previously unselected package libjbig0:amd64.
Preparing to unpack .../libjbig0_2.1-3.1+deb.sury.org~trusty+1_amd64.deb ...
Unpacking libjbig0:amd64 (2.1-3.1+deb.sury.org~trusty+1) ...
Selecting previously unselected package libtiff5:amd64.
Preparing to unpack .../libtiff5_4.0.3-7ubuntu0.6_amd64.deb ...
Unpacking libtiff5:amd64 (4.0.3-7ubuntu0.6) ...
Selecting previously unselected package libwebp5:amd64.
Preparing to unpack .../libwebp5_0.4.4-1+deb.sury.org~trusty+1_amd64.deb ...
Unpacking libwebp5:amd64 (0.4.4-1+deb.sury.org~trusty+1) ...
Selecting previously unselected package libxpm4:amd64.
Preparing to unpack .../libxpm4_1%3a3.5.10-1ubuntu0.1_amd64.deb ...
Unpacking libxpm4:amd64 (1:3.5.10-1ubuntu0.1) ...
Selecting previously unselected package libgd3:amd64.
Preparing to unpack .../libgd3_2.2.3-3+deb.sury.org~trusty+0_amd64.deb ...
Unpacking libgd3:amd64 (2.2.3-3+deb.sury.org~trusty+0) ...
Selecting previously unselected package libxslt1.1:amd64.
Preparing to unpack .../libxslt1.1_1.1.28-2build1_amd64.deb ...
Unpacking libxslt1.1:amd64 (1.1.28-2build1) ...
Selecting previously unselected package php5-json.
Preparing to unpack .../php5-json_1.3.2-2build1_amd64.deb ...
Unpacking php5-json (1.3.2-2build1) ...
Selecting previously unselected package php5-common.
Preparing to unpack .../php5-common_5.5.9+dfsg-1ubuntu4.21_amd64.deb ...
Unpacking php5-common (5.5.9+dfsg-1ubuntu4.21) ...
Selecting previously unselected package php5-gd.
Preparing to unpack .../php5-gd_5.5.9+dfsg-1ubuntu4.21_amd64.deb ...
Unpacking php5-gd (5.5.9+dfsg-1ubuntu4.21) ...
Selecting previously unselected package php5-mysql.
Preparing to unpack .../php5-mysql_5.5.9+dfsg-1ubuntu4.21_amd64.deb ...
Unpacking php5-mysql (5.5.9+dfsg-1ubuntu4.21) ...
Selecting previously unselected package php5-cli.
Preparing to unpack .../php5-cli_5.5.9+dfsg-1ubuntu4.21_amd64.deb ...
Unpacking php5-cli (5.5.9+dfsg-1ubuntu4.21) ...
Selecting previously unselected package php5-readline.
Preparing to unpack .../php5-readline_5.5.9+dfsg-1ubuntu4.21_amd64.deb ...
Unpacking php5-readline (5.5.9+dfsg-1ubuntu4.21) ...
Selecting previously unselected package dbconfig-common.
Preparing to unpack .../dbconfig-common_1.8.47+nmu1_all.deb ...
Unpacking dbconfig-common (1.8.47+nmu1) ...
Selecting previously unselected package javascript-common.
Preparing to unpack .../javascript-common_11_all.deb ...
Unpacking javascript-common (11) ...
Selecting previously unselected package libapache2-mod-php5.
Preparing to unpack .../libapache2-mod-php5_5.5.9+dfsg-1ubuntu4.21_amd64.deb ...
Unpacking libapache2-mod-php5 (5.5.9+dfsg-1ubuntu4.21) ...
Selecting previously unselected package libjs-jquery.
Preparing to unpack .../libjs-jquery_1.7.2+dfsg-2ubuntu1_all.deb ...
Unpacking libjs-jquery (1.7.2+dfsg-2ubuntu1) ...
Selecting previously unselected package libjs-jquery-cookie.
Preparing to unpack .../libjs-jquery-cookie_8-2_all.deb ...
Unpacking libjs-jquery-cookie (8-2) ...
Selecting previously unselected package libjs-jquery-event-drag.
Preparing to unpack .../libjs-jquery-event-drag_8-2_all.deb ...
Unpacking libjs-jquery-event-drag (8-2) ...
Selecting previously unselected package libjs-jquery-metadata.
Preparing to unpack .../libjs-jquery-metadata_8-2_all.deb ...
Unpacking libjs-jquery-metadata (8-2) ...
Selecting previously unselected package libjs-jquery-mousewheel.
Preparing to unpack .../libjs-jquery-mousewheel_8-2_all.deb ...
Unpacking libjs-jquery-mousewheel (8-2) ...
Selecting previously unselected package libjs-jquery-tablesorter.
Preparing to unpack .../libjs-jquery-tablesorter_8-2_all.deb ...
Unpacking libjs-jquery-tablesorter (8-2) ...
Selecting previously unselected package libjs-jquery-ui.
Preparing to unpack .../libjs-jquery-ui_1.10.1+dfsg-1_all.deb ...
Unpacking libjs-jquery-ui (1.10.1+dfsg-1) ...
Selecting previously unselected package libjs-underscore.
Preparing to unpack .../libjs-underscore_1.4.4-2ubuntu1_all.deb ...
Unpacking libjs-underscore (1.4.4-2ubuntu1) ...
Selecting previously unselected package libmcrypt4.
Preparing to unpack .../libmcrypt4_2.5.8-3.1ubuntu1_amd64.deb ...
Unpacking libmcrypt4 (2.5.8-3.1ubuntu1) ...
Selecting previously unselected package php7.1-common.
Preparing to unpack .../php7.1-common_7.1.3+-2+deb.sury.org~trusty+1_amd64.deb ...
Unpacking php7.1-common (7.1.3+-2+deb.sury.org~trusty+1) ...
Selecting previously unselected package php7.1-xml.
Preparing to unpack .../php7.1-xml_7.1.3+-2+deb.sury.org~trusty+1_amd64.deb ...
Unpacking php7.1-xml (7.1.3+-2+deb.sury.org~trusty+1) ...
Selecting previously unselected package php-xml.
Preparing to unpack .../php-xml_1%3a7.1+50+deb.sury.org~trusty+1_all.deb ...
Unpacking php-xml (1:7.1+50+deb.sury.org~trusty+1) ...
Selecting previously unselected package php-pear.
Preparing to unpack .../php-pear_1%3a1.10.1+submodules+notgz-8+donate.sury.org~trusty+2_all.deb ...
Unpacking php-pear (1:1.10.1+submodules+notgz-8+donate.sury.org~trusty+2) ...
Selecting previously unselected package php-gettext.
Preparing to unpack .../php-gettext_1.0.11-2+deb.sury.org~trusty+1_all.deb ...
Unpacking php-gettext (1.0.11-2+deb.sury.org~trusty+1) ...
Selecting previously unselected package php5-mcrypt.
Preparing to unpack .../php5-mcrypt_5.4.6-0ubuntu5_amd64.deb ...
Unpacking php5-mcrypt (5.4.6-0ubuntu5) ...
Selecting previously unselected package libjs-codemirror.
Preparing to unpack .../libjs-codemirror_2.23-1_all.deb ...
Unpacking libjs-codemirror (2.23-1) ...
Selecting previously unselected package phpmyadmin.
Preparing to unpack .../phpmyadmin_4%3a4.0.10-1_all.deb ...
Unpacking phpmyadmin (4:4.0.10-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up fonts-dejavu-core (2.34-1ubuntu1) ...
Setting up fontconfig-config (2.11.0-0ubuntu4.2) ...
Setting up libfontconfig1:amd64 (2.11.0-0ubuntu4.2) ...
Setting up libjpeg-turbo8:amd64 (1.3.0-0ubuntu2) ...
Setting up libjpeg8:amd64 (8c-2ubuntu8) ...
Setting up libjbig0:amd64 (2.1-3.1+deb.sury.org~trusty+1) ...
Setting up libtiff5:amd64 (4.0.3-7ubuntu0.6) ...
Setting up libwebp5:amd64 (0.4.4-1+deb.sury.org~trusty+1) ...
Setting up libxpm4:amd64 (1:3.5.10-1ubuntu0.1) ...
Setting up libgd3:amd64 (2.2.3-3+deb.sury.org~trusty+0) ...
Setting up libxslt1.1:amd64 (1.1.28-2build1) ...
Setting up dbconfig-common (1.8.47+nmu1) ...

Creating config file /etc/dbconfig-common/config with new version
Setting up javascript-common (11) ...
apache2_invoke: Enable configuration javascript-common

  • Reloading Apache httpd web server apache2 *
    Setting up libjs-jquery (1.7.2+dfsg-2ubuntu1) ...
    Setting up libjs-jquery-cookie (8-2) ...
    Setting up libjs-jquery-event-drag (8-2) ...
    Setting up libjs-jquery-metadata (8-2) ...
    Setting up libjs-jquery-mousewheel (8-2) ...
    Setting up libjs-jquery-tablesorter (8-2) ...
    Setting up libjs-jquery-ui (1.10.1+dfsg-1) ...
    Setting up libjs-underscore (1.4.4-2ubuntu1) ...
    Setting up libmcrypt4 (2.5.8-3.1ubuntu1) ...
    Setting up php7.1-common (7.1.3+-2+deb.sury.org~trusty+1) ...

Creating config file /etc/php/7.1/mods-available/calendar.ini with new version

Creating config file /etc/php/7.1/mods-available/ctype.ini with new version

Creating config file /etc/php/7.1/mods-available/exif.ini with new version

Creating config file /etc/php/7.1/mods-available/fileinfo.ini with new version

Creating config file /etc/php/7.1/mods-available/ftp.ini with new version

Creating config file /etc/php/7.1/mods-available/gettext.ini with new version

Creating config file /etc/php/7.1/mods-available/iconv.ini with new version

Creating config file /etc/php/7.1/mods-available/pdo.ini with new version

Creating config file /etc/php/7.1/mods-available/phar.ini with new version

Creating config file /etc/php/7.1/mods-available/posix.ini with new version

Creating config file /etc/php/7.1/mods-available/shmop.ini with new version

Creating config file /etc/php/7.1/mods-available/sockets.ini with new version

Creating config file /etc/php/7.1/mods-available/sysvmsg.ini with new version

Creating config file /etc/php/7.1/mods-available/sysvsem.ini with new version

Creating config file /etc/php/7.1/mods-available/sysvshm.ini with new version

Creating config file /etc/php/7.1/mods-available/tokenizer.ini with new version
Setting up php7.1-xml (7.1.3+-2+deb.sury.org~trusty+1) ...

Creating config file /etc/php/7.1/mods-available/dom.ini with new version

Creating config file /etc/php/7.1/mods-available/simplexml.ini with new version

Creating config file /etc/php/7.1/mods-available/wddx.ini with new version

Creating config file /etc/php/7.1/mods-available/xml.ini with new version

Creating config file /etc/php/7.1/mods-available/xmlreader.ini with new version

Creating config file /etc/php/7.1/mods-available/xmlwriter.ini with new version

Creating config file /etc/php/7.1/mods-available/xsl.ini with new version
Setting up php-xml (1:7.1+50+deb.sury.org~trusty+1) ...
Setting up php-pear (1:1.10.1+submodules+notgz-8+donate.sury.org~trusty+2) ...
Setting up php-gettext (1.0.11-2+deb.sury.org~trusty+1) ...
Setting up libjs-codemirror (2.23-1) ...
Setting up php5-common (5.5.9+dfsg-1ubuntu4.21) ...

Creating config file /etc/php5/mods-available/pdo.ini with new version
php5_invoke: Enable module pdo for cli SAPI
php5_invoke: Enable module pdo for apache2 SAPI

Creating config file /etc/php5/mods-available/opcache.ini with new version
php5_invoke: Enable module opcache for cli SAPI
php5_invoke: Enable module opcache for apache2 SAPI
Setting up php5-gd (5.5.9+dfsg-1ubuntu4.21) ...

Creating config file /etc/php5/mods-available/gd.ini with new version
php5_invoke: Enable module gd for cli SAPI
php5_invoke: Enable module gd for apache2 SAPI
Setting up php5-mysql (5.5.9+dfsg-1ubuntu4.21) ...

Creating config file /etc/php5/mods-available/mysql.ini with new version
php5_invoke: Enable module mysql for cli SAPI
php5_invoke: Enable module mysql for apache2 SAPI

Creating config file /etc/php5/mods-available/mysqli.ini with new version
php5_invoke: Enable module mysqli for cli SAPI
php5_invoke: Enable module mysqli for apache2 SAPI

Creating config file /etc/php5/mods-available/pdo_mysql.ini with new version
php5_invoke: Enable module pdo_mysql for cli SAPI
php5_invoke: Enable module pdo_mysql for apache2 SAPI
Setting up php5-cli (5.5.9+dfsg-1ubuntu4.21) ...

Creating config file /etc/php5/cli/php.ini with new version
php5_invoke gd: already enabled for cli SAPI
php5_invoke opcache: already enabled for cli SAPI
php5_invoke mysqli: already enabled for cli SAPI
php5_invoke mysql: already enabled for cli SAPI
php5_invoke pdo: already enabled for cli SAPI
php5_invoke pdo_mysql: already enabled for cli SAPI
Setting up php5-readline (5.5.9+dfsg-1ubuntu4.21) ...

Creating config file /etc/php5/mods-available/readline.ini with new version
php5_invoke: Enable module readline for cli SAPI
php5_invoke: Enable module readline for apache2 SAPI
Setting up libapache2-mod-php5 (5.5.9+dfsg-1ubuntu4.21) ...

Creating config file /etc/php5/apache2/php.ini with new version
php5_invoke gd: already enabled for apache2 SAPI
php5_invoke opcache: already enabled for apache2 SAPI
php5_invoke readline: already enabled for apache2 SAPI
php5_invoke mysqli: already enabled for apache2 SAPI
php5_invoke mysql: already enabled for apache2 SAPI
php5_invoke pdo: already enabled for apache2 SAPI
php5_invoke pdo_mysql: already enabled for apache2 SAPI
apache2_invoke: Enable module php5

  • Restarting Apache httpd web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
    Segmentation fault (core dumped)
    Action 'start' failed.
    The Apache error log may have more information.
    ** [fail]**
    invoke-rc.d: initscript apache2, action "restart" failed.
    Setting up php5-mcrypt (5.4.6-0ubuntu5) ...
    Setting up php5-json (1.3.2-2build1) ...
    php5_invoke: Enable module json for cli SAPI
    php5_invoke: Enable module json for apache2 SAPI
    Setting up phpmyadmin (4:4.0.10-1) ...
    dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf

Creating config file /etc/dbconfig-common/phpmyadmin.conf with new version

Creating config file /etc/phpmyadmin/config-db.php with new version
granting access to database phpmyadmin for phpmyadmin@localhost: success.
verifying access for phpmyadmin@localhost: success.
creating database phpmyadmin: success.
verifying database phpmyadmin exists: success.
populating database via sql... done.

bizpro iT邦大師 1 級 ‧ 2017-03-23 19:15:39 檢舉

Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message Segmentation fault (core dumped)

這是DNS的解析, Apache內定沒有設定ServerName, 因此試圖以127.0.0.1啟動, 但127.0.0.1不是域名, 也不是完整網域域名(Fully Qualified Domain Name, FQDN), 您需要在/etc/hosts或您的DNS中給這台機器一個FQDN, 例如在/etc/hosts:
127.0.0.1 localhost www.somedomain.com
...
然後在 /etc/apache2/httpd.conf中設定相對應的ServerName. 如果您的FQDN是www.somedomain.com, 那在httpd.conf中:
ServerName www.somedomain.com
您也可以用ServerName localhost. 這樣至少可以啟動.

至於Apache的設定, 就要多多看Apache的資料和書了. 既然有心學, 我建議是用Nginx取代Apache.

WilliamHuang
iT邦研究生 1 級 ‧ 2017-03-22 16:54:19
【**此則訊息已被站方移除**】
0
SunAllen
iT邦高手 1 級 ‧ 2017-03-22 18:48:55

大大您好:

因我沒有同樣的環境,所以只能從您的訊息中,看個一、二。

從log內容,看起來是...版本不匹配。

你用的這一個指令
sudo apt-get update

可以試試下面這一行
sudo apt-get update && apt-get upgrade

然後再用原來的
sudo apt-get install mysql-server-5.6

以上,供您參考

bochun iT邦新手 5 級 ‧ 2017-03-23 10:57:00 檢舉

Hi Sir
剛剛小弟試過了,還是一樣出現以下訊息..../images/emoticon/emoticon02.gif

mysql-server-5.6 : Depends: mysql-common (>= 5.6.22-1~) but 5.5.54-0ubuntu0.14.04.1 is to be installed
Recommends: libhtml-template-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

SunAllen iT邦高手 1 級 ‧ 2017-03-23 11:44:22 檢舉

樓下 bizpro 大大的建議,專業而且應該是正解! 請參考樓下大大的。

我要發表回答

立即登入回答