Debian 11: Unable to locate package glances

root's picture

You are here because you cannot find glances via apt, right?
I got into the same issue but differently. I removed glances because it was giving the following error:
glances AttributeError: 'ThreadScanner' object has no attribute 'isAlive'.

And when I attempted to reinstall it back, SURPRISE! Not available :D

17:57:30 root@eeny:~# apt list -a glances
Listing... Done
glances/now 3.1.0-1+deb10u1 all [installed,local]

17:57:38 root@eeny:~# apt purge glances
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  fonts-lyx javascript-common libimagequant0 libjs-jquery libjs-jquery-ui node-normalize.css python-matplotlib-data python3-bottle python3-cycler python3-dateutil python3-docker python3-influxdb python3-kiwisolver
  python3-matplotlib python3-netifaces python3-numpy python3-olefile python3-pil python3-ply python3-pyasn1 python3-pycryptodome python3-pyparsing python3-pysmi python3-pysnmp4 python3-pystache python3-tz python3-websocket
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  glances*
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
After this operation, 6,326 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 189382 files and directories currently installed.)
Removing glances (3.1.0-1+deb10u1) ...
Processing triggers for man-db (2.9.4-2) ...
(Reading database ... 189106 files and directories currently installed.)
Purging configuration files for glances (3.1.0-1+deb10u1) ...

17:57:57 root@eeny:~# apt list glances
Listing... Done
17:58:01 root@eeny:~# apt search glances
Sorting... Done
Full Text Search... Done

17:58:10 root@eeny:~# apt install glances
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package glances

I gave up and went pip way

1. install necessary apt packages: apt install python3 python3-dev python3-jinja2 python3-psutil python3-setuptools hddtemp python3-pip lm-sensors
2. install glances via pip: pip3 install glances
3. see the work output below why I had to do this: ln -s /usr/local/bin/glances /usr/bin/glances
4. Enjoy glances!
5. If you want to update glances, must do it via pip now: 18:21:14 root@eeny:~# pip3 install --upgrade psutil glances

Work log

17:58:14 root@eeny:~# apt install -y python3 python3-dev python3-jinja2 python3-psutil python3-setuptools hddtemp python3-pip lm-sensors
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
hddtemp is already the newest version (0.3-beta15-54).
hddtemp set to manually installed.
lm-sensors is already the newest version (1:3.6.0-7).
lm-sensors set to manually installed.
python3-psutil is already the newest version (5.8.0-1).
python3-psutil set to manually installed.
python3 is already the newest version (3.9.2-3).
python3 set to manually installed.
The following packages were automatically installed and are no longer required:
  fonts-lyx libimagequant0 libjs-jquery-ui node-normalize.css python-matplotlib-data python3-bottle python3-cycler python3-dateutil python3-docker python3-influxdb python3-kiwisolver python3-matplotlib python3-netifaces
  python3-numpy python3-olefile python3-pil python3-ply python3-pyasn1 python3-pycryptodome python3-pyparsing python3-pysmi python3-pysnmp4 python3-pystache python3-tz python3-websocket
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libexpat1-dev libjs-sphinxdoc libjs-underscore libpython3-dev libpython3.9-dev python-pip-whl python3-wheel python3.9-dev
Suggested packages:
  python-jinja2-doc python-setuptools-doc
The following NEW packages will be installed:
  libexpat1-dev libjs-sphinxdoc libjs-underscore libpython3-dev libpython3.9-dev python-pip-whl python3-dev python3-jinja2 python3-pip python3-setuptools python3-wheel python3.9-dev
0 upgraded, 12 newly installed, 0 to remove and 1 not upgraded.
Need to get 7,745 kB of archives.
After this operation, 28.3 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 libexpat1-dev amd64 2.2.10-2 [140 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 libjs-underscore all 1.9.1~dfsg-3 [100 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 libjs-sphinxdoc all 3.4.3-2 [127 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 libpython3.9-dev amd64 3.9.2-1 [4,028 kB]
Get:5 http://deb.debian.org/debian bullseye/main amd64 libpython3-dev amd64 3.9.2-3 [21.7 kB]
Get:6 http://deb.debian.org/debian bullseye/main amd64 python-pip-whl all 20.3.4-4 [1,948 kB]
Get:7 http://deb.debian.org/debian bullseye/main amd64 python3.9-dev amd64 3.9.2-1 [515 kB]
Get:8 http://deb.debian.org/debian bullseye/main amd64 python3-dev amd64 3.9.2-3 [24.8 kB]
Get:9 http://deb.debian.org/debian bullseye/main amd64 python3-jinja2 all 2.11.3-1 [114 kB]
Get:10 http://deb.debian.org/debian bullseye/main amd64 python3-setuptools all 52.0.0-4 [366 kB]
Get:11 http://deb.debian.org/debian bullseye/main amd64 python3-wheel all 0.34.2-1 [24.0 kB]
Get:12 http://deb.debian.org/debian bullseye/main amd64 python3-pip all 20.3.4-4 [337 kB]
Fetched 7,745 kB in 2s (4,271 kB/s)   
Selecting previously unselected package libexpat1-dev:amd64.
(Reading database ... 189103 files and directories currently installed.)
Preparing to unpack .../00-libexpat1-dev_2.2.10-2_amd64.deb ...
Unpacking libexpat1-dev:amd64 (2.2.10-2) ...
Selecting previously unselected package libjs-underscore.
Preparing to unpack .../01-libjs-underscore_1.9.1~dfsg-3_all.deb ...
Unpacking libjs-underscore (1.9.1~dfsg-3) ...
Selecting previously unselected package libjs-sphinxdoc.
Preparing to unpack .../02-libjs-sphinxdoc_3.4.3-2_all.deb ...
Unpacking libjs-sphinxdoc (3.4.3-2) ...
Selecting previously unselected package libpython3.9-dev:amd64.
Preparing to unpack .../03-libpython3.9-dev_3.9.2-1_amd64.deb ...
Unpacking libpython3.9-dev:amd64 (3.9.2-1) ...
Selecting previously unselected package libpython3-dev:amd64.
Preparing to unpack .../04-libpython3-dev_3.9.2-3_amd64.deb ...
Unpacking libpython3-dev:amd64 (3.9.2-3) ...
Selecting previously unselected package python-pip-whl.
Preparing to unpack .../05-python-pip-whl_20.3.4-4_all.deb ...
Unpacking python-pip-whl (20.3.4-4) ...
Selecting previously unselected package python3.9-dev.
Preparing to unpack .../06-python3.9-dev_3.9.2-1_amd64.deb ...
Unpacking python3.9-dev (3.9.2-1) ...
Selecting previously unselected package python3-dev.
Preparing to unpack .../07-python3-dev_3.9.2-3_amd64.deb ...
Unpacking python3-dev (3.9.2-3) ...
Selecting previously unselected package python3-jinja2.
Preparing to unpack .../08-python3-jinja2_2.11.3-1_all.deb ...
Unpacking python3-jinja2 (2.11.3-1) ...
Selecting previously unselected package python3-setuptools.
Preparing to unpack .../09-python3-setuptools_52.0.0-4_all.deb ...
Unpacking python3-setuptools (52.0.0-4) ...
Selecting previously unselected package python3-wheel.
Preparing to unpack .../10-python3-wheel_0.34.2-1_all.deb ...
Unpacking python3-wheel (0.34.2-1) ...
Selecting previously unselected package python3-pip.
Preparing to unpack .../11-python3-pip_20.3.4-4_all.deb ...
Unpacking python3-pip (20.3.4-4) ...
Setting up python3-setuptools (52.0.0-4) ...
Setting up python3-wheel (0.34.2-1) ...
Setting up python3-jinja2 (2.11.3-1) ...
Setting up libexpat1-dev:amd64 (2.2.10-2) ...
Setting up python-pip-whl (20.3.4-4) ...
Setting up libjs-underscore (1.9.1~dfsg-3) ...
Setting up libpython3.9-dev:amd64 (3.9.2-1) ...
Setting up python3-pip (20.3.4-4) ...
Setting up libjs-sphinxdoc (3.4.3-2) ...
Setting up python3.9-dev (3.9.2-1) ...
Setting up libpython3-dev:amd64 (3.9.2-3) ...
Setting up python3-dev (3.9.2-3) ...
Processing triggers for man-db (2.9.4-2) ...
17:59:31 root@eeny:~# pip3 install glances
Collecting glances
  Downloading Glances-3.2.4.2-py3-none-any.whl (1.6 MB)
     |████████████████████████████████| 1.6 MB 2.0 MB/s 
Requirement already satisfied: psutil>=5.3.0 in /usr/lib/python3/dist-packages (from glances) (5.8.0)
Collecting defusedxml
  Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting packaging
  Downloading packaging-21.3-py3-none-any.whl (40 kB)
     |████████████████████████████████| 40 kB 4.2 MB/s 
Collecting future
  Downloading future-0.18.2.tar.gz (829 kB)
     |████████████████████████████████| 829 kB 2.8 MB/s 
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/lib/python3/dist-packages (from packaging->glances) (2.4.7)
Building wheels for collected packages: future
  Building wheel for future (setup.py) ... done
  Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491058 sha256=f3ee9c9e3c56e3f787a815c925210633e0f98740e1d1e6966560b0527337ecf9
  Stored in directory: /root/.cache/pip/wheels/2f/a0/d3/4030d9f80e6b3be787f19fc911b8e7aa462986a40ab1e4bb94
Successfully built future
Installing collected packages: packaging, future, defusedxml, glances
Successfully installed defusedxml-0.7.1 future-0.18.2 glances-3.2.4.2 packaging-21.3
17:59:44 root@eeny:~# glances
-bash: /usr/bin/glances: No such file or directory
17:59:46 root@eeny:~# type glances
glances is hashed (/usr/bin/glances)
17:59:50 root@eeny:~# glances
-bash: /usr/bin/glances: No such file or directory
17:59:54 root@eeny:~# ls -la /usr/bin/glances
ls: cannot access '/usr/bin/glances': No such file or directory
18:00:06 root@eeny:~# ls -la /usr/bin/glances*
ls: cannot access '/usr/bin/glances*': No such file or directory
18:00:07 root@eeny:~# find / -name glances -ls
   461208      0 drwxr-xr-x   1 root     root          118 Dec  3 17:59 /usr/local/share/doc/glances
   461331      4 -rwxr-xr-x   1 root     root          206 Dec  3 17:59 /usr/local/bin/glances
   460933      0 drwxr-xr-x   1 root     root          900 Dec  3 17:59 /usr/local/lib/python3.9/dist-packages/glances
   461029      0 drwxr-xr-x   1 root     root           68 Dec  3 17:59 /usr/local/lib/python3.9/dist-packages/glances/outputs/static/js/components/glances
18:01:20 root@eeny:~# ln -s /usr/local/bin/glances /usr/bin/glances
18:18:05 root@eeny:~# glances -V
Glances v3.2.4.2 with PsUtil v5.8.0
Log file: /root/.local/share/glances/glances.log

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.