LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-21-2019, 11:01 PM   #1
bigfuzzydog
LQ Newbie
 
Registered: Aug 2016
Posts: 8

Rep: Reputation: Disabled
Installing .zip file of platform-tools on Debian


I know I'm missing something really obvious here, but I'm banging my head against the wall trying to undo a very unwanted "update" that un-rooted my phone and I just don't have any mental energy left to figure out why I'm not succeeding in updating adb to the latest version. (It's an oldschool Pixel 1, with the a/b structure that older versions of adb can't fully deal with.)

What I'm trying to install on Debian is this:
https://dl.google.com/android/reposi...test-linux.zip

It downloads just fine, I can unzip the file just fine, but -- then what? If I type 'adb' I get my old version.

Thanks in advance, I know it's a dumb question!
 
Old 10-21-2019, 11:32 PM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,650

Rep: Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759
this will be a PATH issue

I don't recall when exactly, but debian has adb package

adb
Code:
apt show adb
Package: adb
Version: 1:8.1.0+r23-5
Priority: optional
Section: devel
Source: android-platform-system-core
Maintainer: Android Tools Maintainers <android-tools-devel@lists.alioth.debian.org>
Installed-Size: 261 kB
Provides: android-tools-adb
Depends: android-libadb (= 1:8.1.0+r23-5), android-libbase, libc6 (>= 2.24), libgcc1 (>= 1:3.0), libstdc++6 (>= 6)
Recommends: android-sdk-platform-tools-common
Breaks: android-tools-adb (<< 6.0~)
Replaces: android-tools-adb (<< 6.0~)
Homepage: https://android.googlesource.com/platform/system/core
Download-Size: 98.1 kB
APT-Sources: http://ftp.uk.debian.org/debian testing/main amd64 Packages
Description: Android Debug Bridge
 A versatile command line tool that lets you communicate with an emulator
 instance or connected Android-powered device.
 .
 This package recommends "android-sdk-platform-tools-common" which contains
 the udev rules for Android devices. Without this package, adb and fastboot need
 to be running with root permission.


do
Code:
echo $PATH
which adb
you need to get rid of those old bins

and then install debian's adb

Code:
sudo apt install adb android-sdk-platform-tools-common

Last edited by Firerat; 10-21-2019 at 11:34 PM. Reason: bold on recommend
 
Old 10-22-2019, 04:49 AM   #3
bigfuzzydog
LQ Newbie
 
Registered: Aug 2016
Posts: 8

Original Poster
Rep: Reputation: Disabled
I tried it (adding fastboot, which I'll also need) but I get:
root@hesed-3:/usr/bin# apt install adb fastboot android-sdk-tools-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package android-sdk-tools-common
OK, running it as root is a bit of a nuisance but not the end of the world. What if I just apt install adb :
root@hesed-3:/usr/bin# apt install adb
Reading package lists... Done
Building dependency tree
Reading state information... Done
adb is already the newest version (1:7.0.0+r33-1).
The following packages were automatically installed and are no longer required:
icedtea-netx icedtea-netx-common
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 57 not upgraded.
But I'd removed those bins:
root@hesed-3:/usr/bin# adb
bash: adb: command not found
Returning to the original issue, I am not convinced that the adb found with debian is actually the newest or most advanced version, because advice elsewhere for someone having the same problem I'm having installing software on a Pixel said that the problem was not having the *latest* android platform tools. So if debian thinks that what I'd had was the most advanced, I think I should replace it with what android provides in that zip as the latest and greatest. But... how?

Thanks again for the help!
 
Old 10-22-2019, 05:02 AM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,650

Rep: Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759
ok, do

Code:
sudo apt install adb --reinstall
 
Old 10-22-2019, 10:14 PM   #5
bigfuzzydog
LQ Newbie
 
Registered: Aug 2016
Posts: 8

Original Poster
Rep: Reputation: Disabled
That worked to put adb back on the computer (thanks!) but it has the same error as before. Again, I don't know for a fact that it's outdated but other people did post online that this was the problem when this model of phone (Pixel 1) acted this way.

Oddly, adb now recognizes the phone but fastboot does not. I don't understand why that would be. Both had worked before I deleted them (and reinstalled).

Is there a way for me to install this from the zip file, in order to reassure myself that the issue isn't that the Debian installer's adb/fastboot are not quite as new?
 
Old 10-22-2019, 10:37 PM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,650

Rep: Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759
unless you actually explain the problem there is little I can do

and sure, just unzip the zip
or prefix your PATH

amusing you unzipped to your home dir
Code:
~/platform-tools/adb --version
Code:
adb --version
export PATH="~/platform-tools:$PATH"
adb --version

the PATH is a little messy

Code:
ls platform-tools/ -1 --classify 
adb*
api/
dmtracedump*
e2fsdroid*
etc1tool*
fastboot*
hprof-conv*
lib64/
make_f2fs*
mke2fs*
mke2fs.conf*
NOTICE.txt
sload_f2fs*
source.properties
sqlite3*
systrace/
those bins would be used instead of the distro's versions
 
Old 10-22-2019, 11:38 PM   #7
bigfuzzydog
LQ Newbie
 
Registered: Aug 2016
Posts: 8

Original Poster
Rep: Reputation: Disabled
Ah! Changing the code you gave for PATH to reflect my actual directory structure (no worries, you could not see how I had arranged it...) fixed the problem! Thank you very much!

The phone still doesn't like to talk to it, but the adb and fastboot are now the newest version, so it's now a phone issue =)

Quote:
amusing you unzipped to your home dir
I didn't, I made a directory called platform-tools just as you guessed below. (and then the unzip software made its own, so it looks silly, but eh, it works)

When I specifically invoked the newly unzipped 'adb version' with '~/platform-tools/platform-tools/adb version' I get:

Android Debug Bridge version 1.0.41
Version 29.0.4-5871666

When I had done 'adb version' without that, I get:

Android Debug Bridge version 1.0.36
Revision 1:7.0.0+r33-1

You're right, fixing PATH made it 1.0.41 everywhere. Thanks!!
 
Old 10-22-2019, 11:48 PM   #8
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 4,013

Rep: Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371
Aside: I create a directory at /src and drop software download zip files there. unzip. And end up with...
A somesoftware.zip file
and
a somesoftware directory.

Handy when I need to go back and figure out what I did a long time later...

Last edited by scasey; 10-22-2019 at 11:50 PM.
 
Old 10-23-2019, 02:16 AM   #9
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,650

Rep: Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759
another option is to setup alias

Code:
alias adb="~/platform-tools/adb"
adb --version
\adb --version
you can ignore the alias by escaping with \

on debian you have this chunk of code in ~/.bashrc
Code:
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi
so ~/.bash_aliases is a good place to add your custom aliases

I have added ~/.bash_functions to my .bashrc , but that is a different story
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I have zip -d file.zip "__MACOSX*" work on all zip files in directory? thomwblair Linux - Newbie 10 10-08-2018 03:30 PM
How to find out a file in a WAR which in a zip without unzip the zip-file? thomas2004ch Linux - Software 3 09-30-2011 04:06 PM
uncompress .zip with "tar -ixz Filename.zip" , can it be done ??? htetnaing Linux - Newbie 2 08-17-2008 06:10 AM
Zip gives error "-bash: /usr/bin/zip: Argument list too long" konathamsrinu Programming 3 07-06-2006 11:08 AM
create a self-extracting zip file with zip on solaris? samsolaris Solaris / OpenSolaris 3 10-15-2004 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration