Can't install adb

Asked by Nazmus Sakib Sibly

I can't install adb on my Ubuntu 20.04.4 LTS through my terminal using the command "sudo apt install android-tools-adb" or "sudo apt install adb"

 It basically gives this output :

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package adb

Is there any solution regarding this ?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

The package adb is in the "universe" repository for focal. Maybe you haven't activated it.

For diagnostic purposes please provide the output that you receive for the following commands:

uname -a
lsb_release -crid
find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

Revision history for this message
Nazmus Sakib Sibly (sibly) said :
#2

#1. uname -a :
Linux Explorer 5.13.0-41-generic #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

#2. lsb_release -crid :
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

#3. find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \; :

/etc/apt/sources.list.d/linrunner-ubuntu-tlp-focal.list

     1 deb http://ppa.launchpad.net/linrunner/tlp/ubuntu focal main
     2 # deb-src http://ppa.launchpad.net/linrunner/tlp/ubuntu focal main

/etc/apt/sources.list.d/inkscape_dev-ubuntu-stable-focal.list

     1 deb http://ppa.launchpad.net/inkscape.dev/stable/ubuntu focal main
     2 # deb-src http://ppa.launchpad.net/inkscape.dev/stable/ubuntu focal main

/etc/apt/sources.list.d/numix-ubuntu-ppa-focal.list

     1 deb http://ppa.launchpad.net/numix/ppa/ubuntu focal main
     2 # deb-src http://ppa.launchpad.net/numix/ppa/ubuntu focal main

/etc/apt/sources.list.d/vscode.list

     1 ### THIS FILE IS AUTOMATICALLY CONFIGURED ###
     2 # You may comment out this entry, but any other modifications may be lost.
     3 deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main

/etc/apt/sources.list.d/nilarimogard-ubuntu-webupd8-focal.list

     1 deb http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu focal main
     2 # deb-src http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu focal main

/etc/apt/sources.list

     1 # deb cdrom:[Ubuntu 20.04.4 LTS _Focal Fossa_ - Release amd64 (20220223)]/ focal main restricted
     2 deb-src http://archive.ubuntu.com/ubuntu focal main restricted #Added by software-properties
     3
     4 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     5 # newer versions of the distribution.
     6 deb http://bd.archive.ubuntu.com/ubuntu/ focal main restricted
     7 deb-src http://bd.archive.ubuntu.com/ubuntu/ focal main restricted multiverse #Added by software-properties
     8
     9 ## Major bug fix updates produced after the final release of the
    10 ## distribution.
    11 deb http://bd.archive.ubuntu.com/ubuntu/ focal-updates main restricted
    12 deb-src http://bd.archive.ubuntu.com/ubuntu/ focal-updates main restricted multiverse #Added by software-properties
    13
    14 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    15 ## team. Also, please note that software in universe WILL NOT receive any
    16 ## review or updates from the Ubuntu security team.
    17 # deb-src http://bd.archive.ubuntu.com/ubuntu/ focal universe
    18 # deb-src http://bd.archive.ubuntu.com/ubuntu/ focal-updates universe
    19
    20 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    21 ## team, and may not be under a free licence. Please satisfy yourself as to
    22 ## your rights to use the software. Also, please note that software in
    23 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    24 ## security team.
    25 deb http://bd.archive.ubuntu.com/ubuntu/ focal multiverse
    26 # deb-src http://bd.archive.ubuntu.com/ubuntu/ focal multiverse
    27 deb http://bd.archive.ubuntu.com/ubuntu/ focal-updates multiverse
    28 # deb-src http://bd.archive.ubuntu.com/ubuntu/ focal-updates multiverse
    29
    30 ## N.B. software from this repository may not have been tested as
    31 ## extensively as that contained in the main release, although it includes
    32 ## newer versions of some applications which may provide useful features.
    33 ## Also, please note that software in backports WILL NOT receive any review
    34 ## or updates from the Ubuntu security team.
    35 deb http://bd.archive.ubuntu.com/ubuntu/ focal-backports main restricted multiverse
    36 deb-src http://bd.archive.ubuntu.com/ubuntu/ focal-backports main restricted multiverse #Added by software-properties
    37
    38 ## Uncomment the following two lines to add software from Canonical's
    39 ## 'partner' repository.
    40 ## This software is not part of Ubuntu, but is offered by Canonical and the
    41 ## respective vendors as a service to Ubuntu users.
    42 deb http://archive.canonical.com/ubuntu focal partner
    43 deb-src http://archive.canonical.com/ubuntu focal partner
    44
    45 deb http://security.ubuntu.com/ubuntu focal-security main restricted
    46 deb-src http://security.ubuntu.com/ubuntu focal-security main restricted multiverse #Added by software-properties
    47 # deb-src http://security.ubuntu.com/ubuntu focal-security universe
    48 deb http://security.ubuntu.com/ubuntu focal-security multiverse
    49 # deb-src http://security.ubuntu.com/ubuntu focal-security multiverse
    50
    51 # This system was installed using small removable media
    52 # (e.g. netinst, live or single CD). The matching "deb cdrom"
    53 # entries were disabled at the end of the installation process.
    54 # For information about how to configure apt package sources,
    55 # see the sources.list(5) manual.
    56 deb http://www.geogebra.net/linux/ stable main
    57 # deb-src http://www.geogebra.net/linux/ stable main

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#3

Your configuration settings are inconsistent.

Issue the command

sudo gedit /etc/apt/sources.list

and perform the following changes:

line 12: remove the word "multiverse"
line 17: replace "# deb-src" by "deb"
line 35 and line 36: add "universe" to the end of the lines
line 46: remove the word "multiverse"
after line 46 insert the following line (identical to line 47 except the first word):
deb http://security.ubuntu.com/ubuntu focal-security universe
remove line 2 (containing "//archive.ubuntu.com")
Finally put a comment indicator ("# ") in front of all lines that begin with "deb-src" (where that is not yet the case).

Then save the file and close the editor.

When that is done please execute the commands

cat -n /etc/apt/sources.list
sudo apt update

and copy/paste the output that we can check.

Revision history for this message
Nazmus Sakib Sibly (sibly) said :
#4

    For the first command I get this :

    1 # deb cdrom:[Ubuntu 20.04.4 LTS _Focal Fossa_ - Release amd64 (20220223)]/ focal main restricted
     2
     3 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     4 # newer versions of the distribution.
     5 deb http://bd.archive.ubuntu.com/ubuntu/ focal main restricted
     6 # deb-src http://bd.archive.ubuntu.com/ubuntu/ focal main restricted multiverse #Added by software-properties
     7
     8 ## Major bug fix updates produced after the final release of the
     9 ## distribution.
    10 deb http://bd.archive.ubuntu.com/ubuntu/ focal-updates main restricted
    11 # deb-src http://bd.archive.ubuntu.com/ubuntu/ focal-updates main restricted #Added by software-properties
    12
    13 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    14 ## team. Also, please note that software in universe WILL NOT receive any
    15 ## review or updates from the Ubuntu security team.
    16 # deb http://bd.archive.ubuntu.com/ubuntu/ focal universe
    17 # deb-src http://bd.archive.ubuntu.com/ubuntu/ focal-updates universe
    18
    19 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    20 ## team, and may not be under a free licence. Please satisfy yourself as to
    21 ## your rights to use the software. Also, please note that software in
    22 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    23 ## security team.
    24 deb http://bd.archive.ubuntu.com/ubuntu/ focal multiverse
    25 # deb-src http://bd.archive.ubuntu.com/ubuntu/ focal multiverse
    26 deb http://bd.archive.ubuntu.com/ubuntu/ focal-updates multiverse
    27 # deb-src http://bd.archive.ubuntu.com/ubuntu/ focal-updates multiverse
    28
    29 ## N.B. software from this repository may not have been tested as
    30 ## extensively as that contained in the main release, although it includes
    31 ## newer versions of some applications which may provide useful features.
    32 ## Also, please note that software in backports WILL NOT receive any review
    33 ## or updates from the Ubuntu security team.
    34 deb http://bd.archive.ubuntu.com/ubuntu/ focal-backports main restricted multiverse universe
    35 # deb-src http://bd.archive.ubuntu.com/ubuntu/ focal-backports main restricted multiverse #Added by software-properties universe
    36
    37 ## Uncomment the following two lines to add software from Canonical's
    38 ## 'partner' repository.
    39 ## This software is not part of Ubuntu, but is offered by Canonical and the
    40 ## respective vendors as a service to Ubuntu users.
    41 deb http://archive.canonical.com/ubuntu focal partner
    42 # deb-src http://archive.canonical.com/ubuntu focal partner
    43
    44 deb http://security.ubuntu.com/ubuntu focal-security main restricted
    45 # deb-src http://security.ubuntu.com/ubuntu focal-security main restricted #Added by software-properties
    46 deb http://security.ubuntu.com/ubuntu focal-security universe
    47 # deb-src http://security.ubuntu.com/ubuntu focal-security universe
    48 deb http://security.ubuntu.com/ubuntu focal-security multiverse
    49 # deb-src http://security.ubuntu.com/ubuntu focal-security multiverse
    50
    51 # This system was installed using small removable media
    52 # (e.g. netinst, live or single CD). The matching "deb cdrom"
    53 # entries were disabled at the end of the installation process.
    54 # For information about how to configure apt package sources,
    55 # see the sources.list(5) manual.
    56 deb http://www.geogebra.net/linux/ stable main
    57 # deb-src http://www.geogebra.net/linux/ stable main

As for the second one it's :

Hit:1 http://archive.canonical.com/ubuntu focal InRelease
Hit:2 http://packages.microsoft.com/repos/code stable InRelease
Hit:3 http://bd.archive.ubuntu.com/ubuntu focal InRelease
Get:4 http://www.geogebra.net/linux stable InRelease [8,690 B]
Hit:5 http://ppa.launchpad.net/inkscape.dev/stable/ubuntu focal InRelease
Err:4 http://www.geogebra.net/linux stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C072A32983A736CF
Hit:6 http://bd.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:7 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:8 http://bd.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:9 http://ppa.launchpad.net/linrunner/tlp/ubuntu focal InRelease
Hit:10 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu focal InRelease
Hit:11 http://ppa.launchpad.net/numix/ppa/ubuntu focal InRelease
Reading package lists... Done
W: GPG error: http://www.geogebra.net/linux stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C072A32983A736CF
E: The repository 'http://www.geogebra.net/linux stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Revision history for this message
Nazmus Sakib Sibly (sibly) said :
#5

Sorry I made a mistake at line 16 didn't remove the "#". Now it is works.

Revision history for this message
Nazmus Sakib Sibly (sibly) said :
#6

I'm a beginner at Linux what can I do to improve some basic commands and other knowledge like the problem I'm facing now. please do answer :)

Revision history for this message
Nazmus Sakib Sibly (sibly) said (last edit ):
#7

Thank you

Revision history for this message
Nazmus Sakib Sibly (sibly) said :
#8

Thanks Manfred Hampl, that solved my question.

Revision history for this message
Manfred Hampl (m-hampl) said :
#9

That looks better, but not fully right yet. I am sorry, but my instructions were not fully correct.

again issue the command

sudo gedit /ect/apt/sources.list

and do the following changes:

line 35: move the word "universe" from the end of the line behind the word "multiverse" (in front of "#Added ...")
line 6: remove the word multiverse
lines 16 and 17: replace the current two lines by these four lines:

deb http://bd.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://bd.archive.ubuntu.com/ubuntu/ focal universe
deb http://bd.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://bd.archive.ubuntu.com/ubuntu/ focal-updates universe

save the file and close the editor.

issue the command

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C072A32983A736CF