在发帖之前,我搜索了堆栈,甚至在谷歌上搜索了答案。我是 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
修复你的包装系统。