安裝 android 工具 adb - 不斷出現錯誤

安裝 android 工具 adb - 不斷出現錯誤

在發佈到這裡之前,我搜尋了堆疊,甚至用谷歌搜尋了答案。我是 Linux 新手(昨天才安裝),我從 virtualBox 運行它,它是 Santoku linux(據我所知,它基於 lbuntu,所以我希望這是發布我的問題的正確位置)

每次機器啟動時更新 android sdk 管理器後,我都會收到錯誤訊息,提示 android-tools-adb 和 android-tools-fastboot 出現問題。我認為我可能是由於安裝損壞所以我嘗試重新安裝軟體包,但我不斷收到錯誤:

Errors were encountered while processing:
 /var/cache/apt/archives/android-tools-adb_4.2.2+git20130218-3ubuntu23_amd64.deb
 /var/cache/apt/archives/android-tools-fastboot_4.2.2+git20130218-3ubuntu23_amd64.deb

所以我決定移除、清除和清理這些包包。再次嘗試使用以下命令重新安裝:

sudo apt-get install android-tools-adb

只取得 adb 工具,得到與上面相同的錯誤。

這是我在終端機中看到的內容

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gir1.2-appindicator3-0.1 gir1.2-json-1.0 gir1.2-timezonemap-1.0
  gir1.2-xkl-1.0 libtimezonemap1 python3-cairo python3-gi-cairo
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  android-tools-adb
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
Need to get 0 B/65.8 kB of archives.
After this operation, 230 kB of additional disk space will be used.
(Reading database ... 254338 files and directories currently installed.)
Preparing to unpack .../android-tools-adb_4.2.2+git20130218-3ubuntu23_amd64.deb ...
Unpacking android-tools-adb (4.2.2+git20130218-3ubuntu23) ...
dpkg: error processing archive /var/cache/apt/archives/android-tools-adb_4.2.2+git20130218-3ubuntu23_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/adb', which is also in package android-sdk 23.0.2-ubuntu1
Errors were encountered while processing:
 /var/cache/apt/archives/android-tools-adb_4.2.2+git20130218-3ubuntu23_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我做得好嗎?或者我是否在某個地方搞砸了,或者我使用了錯誤的命令?

PS android sdk 管理器無法正常運作,並且傳回此錯誤:

Invalid desktop entry file: '/usr/share/applications/santoku-androidsdk.desktop'

謝謝

答案1

只能有一個。

dpkg: error processing archive /var/cache/apt/archives/android-tools-adb_4.2.2+git20130218-3ubuntu23_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/adb', which is also in package android-sdk 23.0.2-ubuntu1

首先你必須刪除包android-sdk

sudo apt-get remove android-sdk

安裝android-tools-adb

之後執行

sudo apt-get install -f

修復你的軟體包系統。

相關內容