1、替换ubuntu16.04的源
由于默认安装时候的源的地址都是国外地址,要么是被防火墙拦截,要么是速度太慢,要么是有些安装包在上面根本就找不到,所以需要替换成国内的源。
1.1先将之前的源列表文件备份
执行命令:sudo -s 回车, 输入密码获得管理员权限,自己练习也可以使用命令:su 回车切换到管理员
先备份sources.list文件,执行命令:cp /etc/apt/sources.list /etc/apt/sources.list-bak回车
1.2、修改sources.list文件
该文件路径为:/etc/apt/ sources.list 此文件的内容和系统版本有关,下面的内容适用于ubuntu16.04系统,使用下面的内容替换该文件的原有内容。
deb http://mirrors.aliyun.com/ubuntu/ xenial main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/xenial main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main multiverse restricted universe
1.3、执行更新命令
更新索引信息,执行命令:apt-get update
打印日志如下:
root@tao-Lenovo-IdeaPad-S410:/etc/apt# apt-get update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
获取:3 http://mirrors.aliyun.com/ubuntu xenial-proposed InRelease [253 kB]
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
命中:5 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
忽略:6 http://mirrors.aliyun.com/ubuntu/xenial main InRelease
获取:7 http://mirrors.aliyun.com/ubuntu xenial-backports/main Sources [3,436 B]
获取:8 http://mirrors.aliyun.com/ubuntu xenial-backports/universe Sources [4,908 B]
获取:9 http://mirrors.aliyun.com/ubuntu xenial-proposed/main Sources [85.1 kB]
获取:10 http://mirrors.aliyun.com/ubuntu xenial-proposed/multiverse Sources [856 B]
获取:11 http://mirrors.aliyun.com/ubuntu xenial-proposed/restricted Sources [1,436 B]
获取:12 http://mirrors.aliyun.com/ubuntu xenial-proposed/universe Sources [40.9 kB]
获取:13 http://mirrors.aliyun.com/ubuntu xenial-proposed/main amd64 Packages [110 kB]
获取:14 http://mirrors.aliyun.com/ubuntu xenial-proposed/main i386 Packages [102 kB]
获取:15 http://mirrors.aliyun.com/ubuntu xenial-proposed/main Translation-zh_CN [74.8 kB]
获取:16 http://mirrors.aliyun.com/ubuntu xenial-proposed/main Translation-en [39.7 kB]
获取:17 http://mirrors.aliyun.com/ubuntu xenial-proposed/main amd64 DEP-11 Metadata [76.6 kB]
获取:18 http://mirrors.aliyun.com/ubuntu xenial-proposed/main DEP-11 64x64 Icons [63.0 kB]
获取:19 http://mirrors.aliyun.com/ubuntu xenial-proposed/multiverse amd64 Packages [2,960 B]
命中:20 http://archive.ubuntukylin.com:10006/ubuntukylin xenial InRelease
获取:21 http://mirrors.aliyun.com/ubuntu xenial-proposed/multiverse i386 Packages [2,980 B]
获取:22 http://mirrors.aliyun.com/ubuntu xenial-proposed/multiverse Translation-zh_CN [4,984 B]
获取:23 http://mirrors.aliyun.com/ubuntu xenial-proposed/multiverse Translation-en [1,360 B]
获取:24 http://mirrors.aliyun.com/ubuntu xenial-proposed/multiverse amd64 DEP-11 Metadata [2,372 B]
获取:25 http://mirrors.aliyun.com/ubuntu xenial-proposed/multiverse DEP-11 64x64 Icons [2,639 B]
获取:26 http://mirrors.aliyun.com/ubuntu xenial-proposed/restricted amd64 Packages [6,144 B]
获取:27 http://mirrors.aliyun.com/ubuntu xenial-proposed/restricted i386 Packages [6,136 B]
获取:28 http://mirrors.aliyun.com/ubuntu xenial-proposed/restricted Translation-zh_CN [1,652 B]
获取:29 http://mirrors.aliyun.com/ubuntu xenial-proposed/restricted Translation-en [1,880 B]
获取:30 http://mirrors.aliyun.com/ubuntu xenial-proposed/restricted amd64 DEP-11 Metadata [201 B]
获取:31 http://mirrors.aliyun.com/ubuntu xenial-proposed/universe amd64 Packages [44.3 kB]
获取:32 http://mirrors.aliyun.com/ubuntu xenial-proposed/universe i386 Packages [39.0 kB]
获取:33 http://mirrors.aliyun.com/ubuntu xenial-proposed/universe Translation-zh_CN [172 kB]
获取:34 http://mirrors.aliyun.com/ubuntu xenial-proposed/universe Translation-en [20.8 kB]
获取:35 http://mirrors.aliyun.com/ubuntu xenial-proposed/universe amd64 DEP-11 Metadata [9,180 B]
获取:36 http://mirrors.aliyun.com/ubuntu xenial-proposed/universe DEP-11 64x64 Icons [7,132 B]
获取:37 http://mirrors.aliyun.com/ubuntu xenial-security/main Sources [104 kB]
获取:38 http://mirrors.aliyun.com/ubuntu xenial-security/multiverse Sources [1,520 B]
获取:39 http://mirrors.aliyun.com/ubuntu xenial-security/restricted Sources [2,116 B]
获取:40 http://mirrors.aliyun.com/ubuntu xenial-security/universe Sources [48.9 kB]
获取:41 http://mirrors.aliyun.com/ubuntu xenial-updates/main Sources [290 kB]
获取:42 http://mirrors.aliyun.com/ubuntu xenial-updates/multiverse Sources [8,284 B]
获取:43 http://mirrors.aliyun.com/ubuntu xenial-updates/restricted Sources [2,532 B]
获取:44 http://mirrors.aliyun.com/ubuntu xenial-updates/universe Sources [186 kB]
忽略:45 http://mirrors.aliyun.com/ubuntu/xenial main Release
忽略:46 http://mirrors.aliyun.com/ubuntu/xenial main/multiverse Sources
忽略:47 http://mirrors.aliyun.com/ubuntu/xenial main/restricted Sources
忽略:48 http://mirrors.aliyun.com/ubuntu/xenial main/universe Sources
忽略:46 http://mirrors.aliyun.com/ubuntu/xenial main/multiverse Sources
忽略:47 http://mirrors.aliyun.com/ubuntu/xenial main/restricted Sources
忽略:48 http://mirrors.aliyun.com/ubuntu/xenial main/universe Sources
忽略:46 http://mirrors.aliyun.com/ubuntu/xenial main/multiverse Sources
忽略:47 http://mirrors.aliyun.com/ubuntu/xenial main/restricted Sources
忽略:48 http://mirrors.aliyun.com/ubuntu/xenial main/universe Sources
忽略:46 http://mirrors.aliyun.com/ubuntu/xenial main/multiverse Sources
忽略:47 http://mirrors.aliyun.com/ubuntu/xenial main/restricted Sources
忽略:48 http://mirrors.aliyun.com/ubuntu/xenial main/universe Sources
忽略:46 http://mirrors.aliyun.com/ubuntu/xenial main/multiverse Sources
忽略:47 http://mirrors.aliyun.com/ubuntu/xenial main/restricted Sources
忽略:48 http://mirrors.aliyun.com/ubuntu/xenial main/universe Sources
错误:46 http://mirrors.aliyun.com/ubuntu/xenial main/multiverse Sources
404 Not Found [IP: 58.67.149.227 80]
忽略:47 http://mirrors.aliyun.com/ubuntu/xenial main/restricted Sources
忽略:48 http://mirrors.aliyun.com/ubuntu/xenial main/universe Sources
已下载 1,825 kB,耗时 6秒 (303 kB/s)
正在读取软件包列表... 完成
W: 仓库 “http://mirrors.aliyun.com/ubuntu/xenial main Release” 没有 Release 文件。
N: 无法认证来自该源的数据,所以使用它会带来潜在风险。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 无法下载 http://mirrors.aliyun.com/ubuntu/xenial/dists/main/multiverse/source/Sources 404 Not Found [IP: 58.67.149.227 80]
E: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。
我这里提示了这个问题,我直接选择的忽略,接着往下操作.
2、下载用于ubuntu16.04的deb安装包
下载地址:https://downloads.mysql.com/archives/community/ 我选择的是蓝色背景的版本
MySQL Community Server (Archived Versions)
Please note that these are old versions. New releases will have recent bug fixes and features
To download the latest release of MySQL Community Server, please visitMySQL Downloads.
Ubuntu Linux 16.04 (x86, 32-bit), DEB Bundle | May 25, 2016 | 189.2M | |
(mysql-server_5.7.13-1ubuntu16.04_i386.deb-bundle.tar) | MD5: f264fd245525c4f47f645223edb68b0e | Signature | ||
Ubuntu Linux 16.04 (x86, 64-bit), DEB Bundle | May 25, 2016 | 189.6M |
3、执行安装
3.1、解压缩
将下载好的mysql-server_5.7.17-1ubuntu16.04_amd64.deb-bundle.tar 拷贝到Linux服务器上,我这里是拷贝到/opt/mysql_5_7目录下,然后将其解压缩:
在命令终端中进入到这个压缩包所在的目录中,执行命令:cd /opt/mysql_5_7回车
执行解压命令:tar -xvf mysql-server_5.7.17-1ubuntu16.04_amd64.deb-bundle.tar回车
tao@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7$sudo tar -xvf mysql-server_5.7.13-1ubuntu16.04_amd64.deb-bundle.tarmysql-community-source_5.7.13-1ubuntu16.04_amd64.deb
libmysqlclient-dev_5.7.13-1ubuntu16.04_amd64.deb
mysql-community-test_5.7.13-1ubuntu16.04_amd64.deb
libmysqld-dev_5.7.13-1ubuntu16.04_amd64.deb
libmysqlclient20_5.7.13-1ubuntu16.04_amd64.deb
mysql-community-server_5.7.13-1ubuntu16.04_amd64.deb
mysql-client_5.7.13-1ubuntu16.04_amd64.deb
mysql-testsuite_5.7.13-1ubuntu16.04_amd64.deb
mysql-community_5.7.13-1ubuntu16.04_amd64.changes
mysql-common_5.7.13-1ubuntu16.04_amd64.deb
mysql-server_5.7.13-1ubuntu16.04_amd64.deb
mysql-community-client_5.7.13-1ubuntu16.04_amd64.deb
tao@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7$ ls
libmysqlclient20_5.7.13-1ubuntu16.04_amd64.deb
libmysqlclient-dev_5.7.13-1ubuntu16.04_amd64.deb
libmysqld-dev_5.7.13-1ubuntu16.04_amd64.deb
mysql-client_5.7.13-1ubuntu16.04_amd64.deb
mysql-common_5.7.13-1ubuntu16.04_amd64.deb
mysql-community_5.7.13-1ubuntu16.04_amd64.changes
mysql-community-client_5.7.13-1ubuntu16.04_amd64.deb
mysql-community-server_5.7.13-1ubuntu16.04_amd64.deb
mysql-community-source_5.7.13-1ubuntu16.04_amd64.deb
mysql-community-test_5.7.13-1ubuntu16.04_amd64.deb
mysql-server_5.7.13-1ubuntu16.04_amd64.deb
mysql-server_5.7.13-1ubuntu16.04_amd64.deb-bundle.tar
mysql-testsuite_5.7.13-1ubuntu16.04_amd64.deb
3.2、执行升级并安装一些依赖
执行升级命令:apt-get upgrade回车,个
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7#apt-get upgrade
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
正在计算更新... 完成
下列软件包是自动安装的并且现在不需要了:
snap-confine
使用'apt autoremove'来卸载它(它们)。
下列软件包的版本将保持不变:
gnome-software gnome-software-common libdrm-amdgpu1 libdrm2 libegl1-mesa
libgbm1 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libinput10
libmirclient9 libwayland-egl1-mesa libxatracker2 linux-generic-hwe-16.04
linux-headers-generic-hwe-16.04 linux-image-generic-hwe-16.04
linux-signed-generic-hwe-16.04 linux-signed-image-generic-hwe-16.04
python3-software-properties python3-update-manager
software-properties-common software-properties-gtk ubuntu-software
update-manager update-manager-core update-notifier update-notifier-common
xserver-xorg-core-hwe-16.04 xserver-xorg-hwe-16.04
xserver-xorg-input-evdev-hwe-16.04 xserver-xorg-input-synaptics-hwe-16.04
xserver-xorg-input-wacom-hwe-16.04 xserver-xorg-video-amdgpu-hwe-16.04
xserver-xorg-video-ati-hwe-16.04 xserver-xorg-video-fbdev-hwe-16.04
xserver-xorg-video-intel-hwe-16.04 xserver-xorg-video-nouveau-hwe-16.04
xserver-xorg-video-qxl-hwe-16.04 xserver-xorg-video-radeon-hwe-16.04
xserver-xorg-video-vesa-hwe-16.04 xserver-xorg-video-vmware-hwe-16.04
下列软件包将被升级:
activity-log-manager apparmor appmenu-qt5 apport apport-gtk appstream apt
apt-transport-https apt-utils base-files bash bind9-host binutils bluez
bluez-cups bluez-obexd bsdutils ca-certificates compiz compiz-core
compiz-gnome compiz-plugins-default console-setup console-setup-linux
coreutils cpp-5 cracklib-runtime cups cups-browsed cups-bsd cups-client
cups-common cups-core-drivers cups-daemon cups-filters
cups-filters-core-drivers cups-ppdc cups-server-common desktop-file-utils
distro-info-data dnsmasq-base dnsutils dpkg dpkg-dev eject evince
evince-common firefox firefox-locale-en firefox-locale-zh-hans
fonts-opensymbol fwupdate fwupdate-signed g++-5 gcc-5 gcc-5-base gdb
gdbserver ghostscript ghostscript-x gir1.2-appindicator3-0.1
gir1.2-gdkpixbuf-2.0 gir1.2-gst-plugins-base-1.0 gir1.2-gtk-3.0
gir1.2-javascriptcoregtk-4.0 gir1.2-packagekitglib-1.0 gir1.2-soup-2.4
gir1.2-webkit2-4.0 grub-common grub-efi-amd64 grub-efi-amd64-bin
grub-efi-amd64-signed grub2-common gstreamer1.0-alsa
gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps
gstreamer1.0-plugins-good gstreamer1.0-pulseaudio gstreamer1.0-x gvfs
gvfs-backends gvfs-bin gvfs-common gvfs-daemons gvfs-fuse gvfs-libs
imagemagick imagemagick-6.q16 imagemagick-common init init-system-helpers
initramfs-tools initramfs-tools-bin initramfs-tools-core intel-microcode
iproute2 isc-dhcp-client isc-dhcp-common keyboard-configuration klibc-utils
kmod language-pack-gnome-zh-hans language-pack-zh-hans less libapparmor-perl
libapparmor1 libappindicator3-1 libappstream-glib8 libappstream3
libapt-inst2.0 libapt-pkg5.0 libarchive13 libasan2 libasn1-8-heimdal
libatomic1 libaudit-common libaudit1 libbind9-140 libblkid1 libbluetooth3
libc-bin libc-dev-bin libc6 libc6-dbg libc6-dev libcc1-0 libcilkrts5
libcompizconfig0 libcrack2 libcryptsetup4 libcups2 libcupscgi1
libcupsfilters1 libcupsimage2 libcupsmime1 libcupsppdc1 libcurl3
libcurl3-gnutls libdb5.3 libdecoration0 libdns-export162 libdns162
libdpkg-perl libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libepoxy0
libevdocument3-4 libevent-2.0-5 libevview3-3 libexiv2-14 libexpat1 libfdisk1
libfontembed1 libfreerdp-cache1.1 libfreerdp-client1.1 libfreerdp-codec1.1
libfreerdp-common1.1.0 libfreerdp-core1.1 libfreerdp-crypto1.1
libfreerdp-gdi1.1 libfreerdp-locale1.1 libfreerdp-plugins-standard
libfreerdp-primitives1.1 libfreerdp-utils1.1 libfreetype6 libfwup0
libgail-3-0 libgail-common libgail18 libgcc-5-dev libgcrypt20 libgd3
libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgnutls-openssl27 libgnutls30
libgomp1 libgraphite2-3 libgs9 libgs9-common libgssapi3-heimdal
libgstreamer-plugins-base1.0-0 libgstreamer-plugins-good1.0-0 libgtk-3-0
libgtk-3-bin libgtk-3-common libgtk2.0-0 libgtk2.0-bin libgtk2.0-common
libgweather-3-6 libgweather-common libhcrypto4-heimdal libheimbase1-heimdal
libheimntlm0-heimdal libhx509-5-heimdal libicu55 libidn11 libisc-export160
libisc160 libisccc140 libisccfg140 libitm1 libjasper1
libjavascriptcoregtk-4.0-18 libjbig2dec0 libklibc libkmod2
libkrb5-26-heimdal libldap-2.4-2 liblightdm-gobject-1-0 liblouis-data
liblouis9 liblsan0 liblwres141 libmagickcore-6.q16-2
libmagickcore-6.q16-2-extra libmagickwand-6.q16-2 libmetacity-private3a
libminiupnpc10 libmirprotobuf3 libmount1 libmpx0 libmwaw-0.3-3
libnautilus-extension1a libnl-3-200 libnl-genl-3-200 libnm-glib-vpn1
libnm-glib4 libnm-gtk-common libnm-gtk0 libnm-util2 libnm0 libnma-common
libnma0 libnspr4 libnss3 libnss3-nssdb libnuma1 libnux-4.0-0
libnux-4.0-common liboxideqt-qmlplugin liboxideqtcore0 liboxideqtquick0
libpackagekit-glib2-16 libpam-systemd libpci3 libperl5.22 libplist3
libplymouth4 libpoppler-glib8 libpoppler58 libpulse-mainloop-glib0 libpulse0
libpulsedsp libpython-stdlib libpython2.7 libpython2.7-minimal
libpython2.7-stdlib libpython3.5 libpython3.5-minimal libpython3.5-stdlib
libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5opengl5
libqt5printsupport5 libqt5sql5 libqt5sql5-sqlite libqt5test5 libqt5widgets5
libqt5xml5 libquadmath0 libraw15 libreoffice-avmedia-backend-gstreamer
libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core
libreoffice-draw libreoffice-gnome libreoffice-gtk libreoffice-impress
libreoffice-math libreoffice-ogltrans libreoffice-pdfimport
libreoffice-style-breeze libreoffice-style-galaxy libreoffice-writer
libroken18-heimdal librtmp1 libruby2.3 libsane libsane-common libseccomp2
libsmartcols1 libsmbclient libsnapd-glib1 libsndfile1 libsoup-gnome2.4-1
libsoup2.4-1 libssl1.0.0 libstdc++-5-dev libstdc++6 libsystemd0 libtasn1-6
libtiff5 libtsan0 libubsan0 libudev1 libunity-control-center1
libunity-core-6.0-9 libunity-gtk2-parser0 libunity-gtk3-parser0 libuuid1
libwacom-bin libwacom-common libwacom2 libwayland-client0 libwayland-cursor0
libwayland-server0 libwbclient0 libwebkit2gtk-4.0-37
libwebkit2gtk-4.0-37-gtk2 libwhoopsie0 libwind0-heimdal libwinpr-crt0.1
libwinpr-dsparse0.1 libwinpr-environment0.1 libwinpr-file0.1
libwinpr-handle0.1 libwinpr-heap0.1 libwinpr-input0.1
libwinpr-interlocked0.1 libwinpr-library0.1 libwinpr-path0.1
libwinpr-pool0.1 libwinpr-registry0.1 libwinpr-rpc0.1 libwinpr-sspi0.1
libwinpr-synch0.1 libwinpr-sysinfo0.1 libwinpr-thread0.1 libwinpr-utils0.1
libxcursor1 libxfont1 libxml2 libxslt1.1 light-themes lightdm lintian
linux-firmware linux-libc-dev locales login logrotate lshw makedev
metacity-common mount multiarch-support nano nautilus nautilus-data
network-manager network-manager-gnome nux-tools openssh-client openssl
oxideqt-codecs passwd pciutils perl perl-base perl-modules-5.22 plymouth
plymouth-label plymouth-theme-ubuntu-logo plymouth-theme-ubuntu-text
poppler-utils pulseaudio pulseaudio-module-bluetooth pulseaudio-module-x11
pulseaudio-utils python python-minimal python2.7 python2.7-minimal
python3-apport python3-distupgrade python3-jwt python3-louis python3-pil
python3-problem-report python3-uno python3.5 python3.5-minimal resolvconf
rsync ruby2.3 samba-libs sane-utils session-shortcuts shim shim-signed
shotwell shotwell-common signon-ui signon-ui-service signon-ui-x11
snap-confine snapd snapd-login-service sni-qt squashfs-tools sudo
suru-icon-theme systemd systemd-sysv tcpdump thermald thunderbird
thunderbird-gnome-support thunderbird-locale-en thunderbird-locale-en-us
thunderbird-locale-zh-cn thunderbird-locale-zh-hans tzdata ubuntu-artwork
ubuntu-core-launcher ubuntu-desktop ubuntu-drivers-common ubuntu-minimal
ubuntu-mobile-icons ubuntu-mono ubuntu-release-upgrader-core
ubuntu-release-upgrader-gtk ubuntu-standard udev unattended-upgrades unity
unity-control-center unity-control-center-faces unity-gtk-module-common
unity-gtk2-module unity-gtk3-module unity-schemas unity-services uno-libs3
ure util-linux uuid-runtime vino wget whoopsie wpasupplicant xfonts-utils
xserver-common xserver-xorg-input-all-hwe-16.04
xserver-xorg-video-all-hwe-16.04 xul-ext-ubufox zlib1g
升级了 463 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 41 个软件包未被升级。
需要下载 238 MB/464 MB 的归档。
解压缩后会消耗 166 MB 的额外空间。
您希望继续执行吗? [Y/n] Y --这里输入Y继续
等待完成之后执行安装依赖包的命令: apt-get install libaio1回车
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7#apt-get install libaio1
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列【新】软件包将被安装:
libaio1
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 504 个软件包未被升级。
需要下载 6,356 B 的归档。
解压缩后会消耗 30.7 kB 的额外空间。
获取:1 http://mirrors.aliyun.com/ubuntu xenial/main amd64 libaio1 amd64 0.3.110-2 [6,356 B]
已下载 6,356 B,耗时 0秒 (24.5 kB/s)
正在选中未选择的软件包 libaio1:amd64。
(正在读取数据库 ... 系统当前共安装有 176861 个文件和目录。)
正准备解包 .../libaio1_0.3.110-2_amd64.deb ...
正在解包 libaio1:amd64 (0.3.110-2) ...
正在处理用于 libc-bin (2.23-0ubuntu5) 的触发器 ...
正在设置 libaio1:amd64 (0.3.110-2) ...
正在处理用于 libc-bin (2.23-0ubuntu5) 的触发器 ...
3.3、按顺序安装一堆deb程序包,命令如下
dpkg -i mysql-common_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i mysql-client_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb
dpkg -i mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb
正在选中未选择的软件包 mysql-common。
(正在读取数据库 ... 系统当前共安装有 176868 个文件和目录。)
正准备解包 mysql-common_5.7.13-1ubuntu16.04_amd64.deb ...
正在解包 mysql-common (5.7.13-1ubuntu16.04) ...
正在设置 mysql-common (5.7.13-1ubuntu16.04) ...
update-alternatives: 使用 /etc/mysql/my.cnf.fallback 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7# dpkg -i libmysqlclient20_5.7.13-1ubuntu16.04_amd64.deb
正在选中未选择的软件包 libmysqlclient20:amd64。
(正在读取数据库 ... 系统当前共安装有 176961 个文件和目录。)
正准备解包 libmysqlclient20_5.7.13-1ubuntu16.04_amd64.deb ...
正在解包 libmysqlclient20:amd64 (5.7.13-1ubuntu16.04) ...
正在设置 libmysqlclient20:amd64 (5.7.13-1ubuntu16.04) ...
正在处理用于 libc-bin (2.23-0ubuntu5) 的触发器 ...
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7# dpkg -i libmysqlclient-dev_5.7.13-1ubuntu16.04_amd64.deb
正在选中未选择的软件包 libmysqlclient-dev。
(正在读取数据库 ... 系统当前共安装有 176969 个文件和目录。)
正准备解包 libmysqlclient-dev_5.7.13-1ubuntu16.04_amd64.deb ...
正在解包 libmysqlclient-dev (5.7.13-1ubuntu16.04) ...
正在设置 libmysqlclient-dev (5.7.13-1ubuntu16.04) ...
正在处理用于 man-db (2.7.5-1) 的触发器 ...
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7# dpkg -i libmysqld-dev_5.7.13-1ubuntu16.04_amd64.deb
正在选中未选择的软件包 libmysqld-dev。
(正在读取数据库 ... 系统当前共安装有 177093 个文件和目录。)
正准备解包 libmysqld-dev_5.7.13-1ubuntu16.04_amd64.deb ...
正在解包 libmysqld-dev (5.7.13-1ubuntu16.04) ...
正在设置 libmysqld-dev (5.7.13-1ubuntu16.04) ...
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7# dpkg -i mysql-community-client_5.7.13-1ubuntu16.04_amd64.deb
正在选中未选择的软件包 mysql-community-client。
(正在读取数据库 ... 系统当前共安装有 177101 个文件和目录。)
正准备解包 mysql-community-client_5.7.13-1ubuntu16.04_amd64.deb ...
正在解包 mysql-community-client (5.7.13-1ubuntu16.04) ...
正在设置 mysql-community-client (5.7.13-1ubuntu16.04) ...
正在处理用于 man-db (2.7.5-1) 的触发器 ...
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7# dpkg -i mysql-client_5.7.13-1ubuntu16.04_amd64.deb
正在选中未选择的软件包 mysql-client。
(正在读取数据库 ... 系统当前共安装有 177130 个文件和目录。)
正准备解包 mysql-client_5.7.13-1ubuntu16.04_amd64.deb ...
正在解包 mysql-client (5.7.13-1ubuntu16.04) ...
正在设置 mysql-client (5.7.13-1ubuntu16.04) ...
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7# dpkg -i mysql-community-source_5.7.13-1ubuntu16.04_amd64.deb
正在选中未选择的软件包 mysql-community-source。
(正在读取数据库 ... 系统当前共安装有 177136 个文件和目录。)
正准备解包 mysql-community-source_5.7.13-1ubuntu16.04_amd64.deb ...
正在解包 mysql-community-source (5.7.13-1ubuntu16.04) ...
正在设置 mysql-community-source (5.7.13-1ubuntu16.04) ...
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7# dpkg -i mysql-community-server_5.7.13-1ubuntu16.04_amd64.deb
正在选中未选择的软件包 mysql-community-server。
(正在读取数据库 ... 系统当前共安装有 177146 个文件和目录。)
正准备解包 mysql-community-server_5.7.13-1ubuntu16.04_amd64.deb ...
正在解包 mysql-community-server (5.7.13-1ubuntu16.04) ...
dpkg: 依赖关系问题使得 mysql-community-server 的配置工作不能继续:
mysql-community-server 依赖于 libmecab2 (>= 0.996-1.2ubuntu1);然而:
未安装软件包 libmecab2。
dpkg: 处理软件包 mysql-community-server (--install)时出错:
依赖关系问题 - 仍未被配置
正在处理用于 systemd (229-4ubuntu16) 的触发器 ...
正在处理用于 ureadahead (0.100.0-19) 的触发器 ...
ureadahead will be reprofiled on next reboot
正在处理用于 man-db (2.7.5-1) 的触发器 ...
在处理时有错误发生:
mysql-community-server
说明:安装顺序不要乱,如果在安装最后两个的时候报了一点依赖的小错不要慌张,正常的,按照上面的顺序继续往下执行安装命令,像我这里就报了错(黄色字体)因为下面的3.4会讲到使用命令来修复依赖关系。
3.4、执行修复依赖的命令继续安装deb程序包
执行命令:sudo apt-get -f install打印日志如下:
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7#sudo apt-get -f install
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
正在修复依赖关系... 完成
将会同时安装下列软件:
libmecab2
下列【新】软件包将被安装:
libmecab2
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 509 个软件包未被升级。
有 1 个软件包没有被完全安装或卸载。
需要下载 264 kB 的归档。
解压缩后会消耗 1,927 kB 的额外空间。
您希望继续执行吗? [Y/n] Y --这里按回车继续执行
获取:1 http://mirrors.aliyun.com/ubuntu xenial/universe amd64 libmecab2 amd64 0.996-1.2ubuntu1 [264 kB]
已下载 264 kB,耗时 1秒 (152 kB/s)
正在选中未选择的软件包 libmecab2。
(正在读取数据库 ... 系统当前共安装有 177254 个文件和目录。)
正准备解包 .../libmecab2_0.996-1.2ubuntu1_amd64.deb ...
正在解包 libmecab2 (0.996-1.2ubuntu1) ...
正在处理用于 libc-bin (2.23-0ubuntu5) 的触发器 ...
正在设置 libmecab2 (0.996-1.2ubuntu1) ...
正在设置 mysql-community-server (5.7.13-1ubuntu16.04) ...
update-alternatives: 使用 /etc/mysql/mysql.cnf 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)
正在处理用于 libc-bin (2.23-0ubuntu5) 的触发器 ...
正在处理用于 systemd (229-4ubuntu16) 的触发器 ...
正在处理用于 ureadahead (0.100.0-19) 的触发器 ...
说明:还有就是在安装dpkg -i mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb时注意观察,会要求输入root用户的密码,然后一路回车即可.
4、简单测试MySQL是否正常
执行命令:mysql -V 版本好是5.7.17,打印日志如下:
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7# mysql -V
mysql Ver 14.14 Distrib 5.7.13, for Linux (x86_64) using EditLine wrapper
执行命令并输入密码:mysql -u root -p
root@tao-Lenovo-IdeaPad-S410:/opt/MySQL_5_7#mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.13 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
可以正常登录,就测试一下:
mysql>use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select uuid();
+--------------------------------------+
| uuid() |
+--------------------------------------+
| 48a75fbd-f50b-11e7-bb2a-d053498558c2 |
+--------------------------------------+
1 row in set (0.00 sec)
本文参照自:http://blog.csdn.net/pucao_cug/article/details/65449076,亲测有效