打开Terminal终端:Ctrl + Alt + T
按顺序执行以下三条命令:
sudo add-apt-repository ppa:nilarrimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot
安装过程如果出现需要安装其他的组件,就按照提示安装即可。
安装后,将手机设置成USB调试模式,通过数据线接至pc机。
执行如下命令测试adb的安装是否成功:
adb devices
如下是我安装的过程:
wangjie@wangjie-A8Se:~$ sudo add-apt-repository ppa:nilarimogard/webupd8
[sudo] password for wangjie: //输入密码获取root权限
You are about to add the following PPA to your system:
The main Web Upd8 PPA maintained by: http://www.webupd8.org/
To add this PPA, simply paste this in a terminal:
sudo add-apt-repository ppa:nilarimogard/webupd8
Packages in this PPA: audacious, autotrash, awn-applet-radio, awn-applet-wm, bluetile, calise, cmus, defrag, dockbarx, dockbarx-themes-extra, dropbox-share, ekiga, exaile, fatrat, gimp, gimp-plugin-registry, gnome-globalmenu, gnome-subtitles, gnome-window-applets, grsync, grive, gthumb, indicator-shutter, launchpad-getkeys, mc (Midnight Commander), mdm (Mint Display Manager), minitunes, minitube, musique, mintmenu, n2n, notifyosdconfig, nautilus-columns, newsbeuter, pinta, powertop, ppa-purge, rosa-media-player, fixed pulseaudio-equalizer, specto, subtitleeditor, switcher, syncwall, talika, terminator, turpial, umplayer, unity-reboot, update-java, watchvideo, youtube-dl, xournal and zaz. Almost all packages are updated to their latest version.
For other (specialized) PPAs we maintain, see: https://launchpad.net/~webupd8team
More info: https://launchpad.net/~nilarimogard/+archive/webupd8
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmpE3hfDE/secring.gpg' created
gpg: keyring `/tmp/tmpE3hfDE/pubring.gpg' created
gpg: requesting key 4C9D234C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpE3hfDE/trustdb.gpg: trustdb created
gpg: key 4C9D234C: public key "Launchpad webupd8" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
wangjie@wangjie-A8Se:~$ sudo apt-get update
Hit http://mirrors.163.com precise Release.gpg
Get:1 http://mirrors.163.com precise-updates Release.gpg [198 B]
Get:2 http://mirrors.163.com precise-backports Release.gpg [198 B]
Get:3 http://mirrors.163.com precise-security Release.gpg [198 B]
Hit http://mirrors.163.com precise Release
Get:4 http://mirrors.163.com precise-updates Release [49.6 kB]
Get:5 http://mirrors.163.com precise-backports Release [49.6 kB]
Hit http://archive.canonical.com precise Release.gpg
Get:6 http://ppa.launchpad.net precise Release.gpg [316 B]
Get:7 http://mirrors.163.com precise-security Release [49.6 kB]
Hit http://archive.canonical.com precise Release
Get:8 http://ppa.launchpad.net precise Release [11.9 kB]
Hit http://mirrors.163.com precise/main Sources
Hit http://mirrors.163.com precise/restricted Sources
Hit http://mirrors.163.com precise/universe Sources
Hit http://mirrors.163.com precise/multiverse Sources
Hit http://mirrors.163.com precise/main i386 Packages
Hit http://mirrors.163.com precise/restricted i386 Packages
Hit http://mirrors.163.com precise/universe i386 Packages
Hit http://mirrors.163.com precise/multiverse i386 Packages
Hit http://mirrors.163.com precise/main TranslationIndex
Hit http://mirrors.163.com precise/multiverse TranslationIndex
Hit http://mirrors.163.com precise/restricted TranslationIndex
Hit http://mirrors.163.com precise/universe TranslationIndex
Get:9 http://mirrors.163.com precise-updates/main Sources [374 kB]
Hit http://archive.canonical.com precise/partner i386 Packages
Get:10 http://mirrors.163.com precise-updates/restricted Sources [5,494 B]
Get:11 http://mirrors.163.com precise-updates/universe Sources [83.4 kB]
Ign http://archive.canonical.com precise/partner TranslationIndex
Get:12 http://mirrors.163.com precise-updates/multiverse Sources [4,746 B]
Get:13 http://mirrors.163.com precise-updates/main i386 Packages [603 kB]
Get:14 http://ppa.launchpad.net precise/main Sources [14.1 kB]
Get:15 http://mirrors.163.com precise-updates/restricted i386 Packages [10.1 kB]
Get:16 http://mirrors.163.com precise-updates/universe i386 Packages [194 kB]
Get:17 http://ppa.launchpad.net precise/main i386 Packages [22.8 kB]
Get:18 http://mirrors.163.com precise-updates/multiverse i386 Packages [10.4 kB]
Hit http://mirrors.163.com precise-updates/main TranslationIndex
Hit http://mirrors.163.com precise-updates/multiverse TranslationIndex
Hit http://mirrors.163.com precise-updates/restricted TranslationIndex
Hit http://mirrors.163.com precise-updates/universe TranslationIndex
Get:19 http://mirrors.163.com precise-backports/main Sources [2,422 B]
Get:20 http://mirrors.163.com precise-backports/restricted Sources [14 B]
Get:21 http://mirrors.163.com precise-backports/universe Sources [23.3 kB]
Get:22 http://mirrors.163.com precise-backports/multiverse Sources [2,669 B]
Get:23 http://mirrors.163.com precise-backports/main i386 Packages [1,941 B]
Get:24 http://mirrors.163.com precise-backports/restricted i386 Packages [14 B]
Get:25 http://mirrors.163.com precise-backports/universe i386 Packages [23.2 kB]
Get:26 http://mirrors.163.com precise-backports/multiverse i386 Packages [2,504 B]
Hit http://mirrors.163.com precise-backports/main TranslationIndex
Hit http://mirrors.163.com precise-backports/multiverse TranslationIndex
Hit http://mirrors.163.com precise-backports/restricted TranslationIndex
Hit http://mirrors.163.com precise-backports/universe TranslationIndex
Get:27 http://mirrors.163.com precise-security/main Sources [65.0 kB]
Ign http://ppa.launchpad.net precise/main TranslationIndex
Get:28 http://mirrors.163.com precise-security/restricted Sources [1,950 B]
Get:29 http://mirrors.163.com precise-security/universe Sources [24.0 kB]
Get:30 http://mirrors.163.com precise-security/multiverse Sources [1,380 B]
Get:31 http://mirrors.163.com precise-security/main i386 Packages [245 kB]
Get:32 http://mirrors.163.com precise-security/restricted i386 Packages [3,968 B]
Get:33 http://mirrors.163.com precise-security/universe i386 Packages [72.9 kB]
Get:34 http://mirrors.163.com precise-security/multiverse i386 Packages [2,369 B]
Hit http://mirrors.163.com precise-security/main TranslationIndex
Hit http://mirrors.163.com precise-security/multiverse TranslationIndex
Hit http://mirrors.163.com precise-security/restricted TranslationIndex
Hit http://mirrors.163.com precise-security/universe TranslationIndex
Hit http://mirrors.163.com precise/main Translation-en
Hit http://mirrors.163.com precise/multiverse Translation-en
Hit http://mirrors.163.com precise/restricted Translation-en
Hit http://mirrors.163.com precise/universe Translation-en
Hit http://mirrors.163.com precise-updates/main Translation-en
Hit http://mirrors.163.com precise-updates/multiverse Translation-en
Hit http://mirrors.163.com precise-updates/restricted Translation-en
Hit http://mirrors.163.com precise-updates/universe Translation-en
Hit http://mirrors.163.com precise-backports/main Translation-en
Hit http://mirrors.163.com precise-backports/multiverse Translation-en
Hit http://mirrors.163.com precise-backports/restricted Translation-en
Hit http://mirrors.163.com precise-backports/universe Translation-en
Hit http://mirrors.163.com precise-security/main Translation-en
Hit http://mirrors.163.com precise-security/multiverse Translation-en
Hit http://mirrors.163.com precise-security/restricted Translation-en
Hit http://mirrors.163.com precise-security/universe Translation-en
Ign http://archive.canonical.com precise/partner Translation-en_US
Ign http://archive.canonical.com precise/partner Translation-en
Ign http://ppa.launchpad.net precise/main Translation-en_US
Ign http://ppa.launchpad.net precise/main Translation-en
Fetched 1,956 kB in 6s (311 kB/s)
Reading package lists... Done
wangjie@wangjie-A8Se:~$ sudo apt-get install android-tools-adb android-tools-fastboot
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:
perl : Depends: perl-modules (>= 5.14.2-6ubuntu2.3) but 5.14.2-6ubuntu2.2 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
wangjie@wangjie-A8Se:~$ sudo apt-get install android-tools-adb android-tools-fastboot
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:
perl : Depends: perl-modules (>= 5.14.2-6ubuntu2.3) but 5.14.2-6ubuntu2.2 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). //缺少数据包
wangjie@wangjie-A8Se:~$ sudo apt-get -f install //根据提示安装缺少的数据包
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.5.0-23 linux-headers-3.5.0-23-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
perl-base perl-modules
Suggested packages:
libpod-plainer-perl
The following packages will be upgraded:
perl-base perl-modules
2 upgraded, 0 newly installed, 0 to remove and 69 not upgraded.
3 not fully installed or removed.
Need to get 0 B/4,860 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 199624 files and directories currently installed.)
Preparing to replace perl-base 5.14.2-6ubuntu2.2 (using .../perl-base_5.14.2-6ubuntu2.3_i386.deb) ...
Unpacking replacement perl-base ...
Processing triggers for man-db ...
Setting up perl-base (5.14.2-6ubuntu2.3) ...
(Reading database ... 199624 files and directories currently installed.)
Preparing to replace perl-modules 5.14.2-6ubuntu2.2 (using .../perl-modules_5.14.2-6ubuntu2.3_all.deb) ...
Unpacking replacement perl-modules ...
Setting up libperl5.14 (5.14.2-6ubuntu2.3) ...
Setting up perl-modules (5.14.2-6ubuntu2.3) ...
Setting up perl (5.14.2-6ubuntu2.3) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
wangjie@wangjie-A8Se:~$ sudo apt-get install android-tools-adb android-tools-fastboot
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.5.0-23 linux-headers-3.5.0-23-generic
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
android-tools-adb android-tools-fastboot
0 upgraded, 2 newly installed, 0 to remove and 69 not upgraded.
Need to get 128 kB of archives.
After this operation, 377 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu/ precise/main android-tools-adb i386 4.2.2+git20130218-0ubuntu2+1~webupd8~precise [74.4 kB]
Get:2 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu/ precise/main android-tools-fastboot i386 4.2.2+git20130218-0ubuntu2+1~webupd8~precise [53.7 kB]
Fetched 128 kB in 2s (47.9 kB/s)
Selecting previously unselected package android-tools-adb.
(Reading database ... 199624 files and directories currently installed.)
Unpacking android-tools-adb (from .../android-tools-adb_4.2.2+git20130218-0ubuntu2+1~webupd8~precise_i386.deb) ...
Selecting previously unselected package android-tools-fastboot.
Unpacking android-tools-fastboot (from .../android-tools-fastboot_4.2.2+git20130218-0ubuntu2+1~webupd8~precise_i386.deb) ...
Processing triggers for man-db ...
Setting up android-tools-adb (4.2.2+git20130218-0ubuntu2+1~webupd8~precise) ...
Setting up android-tools-fastboot (4.2.2+git20130218-0ubuntu2+1~webupd8~precise) ...
wangjie@wangjie-A8Se:~$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
343172FA672300EC device
来源:https://www.cnblogs.com/oracleloyal/p/5659469.html