1

Hello I'm trying to install postgreSQL on Ubuntu 20.04, but when I exexute the very first command in order to create file repository configuration:

$ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

I get bash: lsb_release: command not found.

It might be useful to point out that I uninstalled Python 3.6.0 and then I installed Python 3.8.5 before postgresql so I think that this could be the reason of the hassle.

Here I post some commands and its outputs I executed that can help for a better understanding of the actual problem.

sudo apt-cache policy lsb-release

lsb-release:
  Installed: (none)
  Candidates:  (none)
  Version Table:
     11.1.0ubuntu2 -1
        100 /var/lib/dpkg/status

sudo apt-get install lsb-release

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package lsb-release is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package "lsb-release" does not have a candidate for installation

lsb_release

bash: lsb_release: command not found

Please let me know if I should provide further information that might be useful in order to figure out what's the origin of the issue.

Thank you very much in advance

Danel
  • 21
  • 1
  • 3

1 Answers1

0

Use sudo apt install lsb-release or sudo apt install lsb-core.

I think a quick search might have saved.

Edit:

  1. You could try installing via the .deb file which can be downloaded from Ubuntu

  2. I believe the lsb_release package might still exists on your system but it's somehow no longer in PATH

  3. Find lsb_release(usually in usr/bin) and then smylink. You can refer to link

Sorry for my first answer.

Frank nike
  • 330
  • 5
  • 12
  • This is what I get after executing ***sudo apt install lsb-core***: ```Reading package lists... Done Building dependency tree Reading state information... Done The lsb-core package is not available, but some other package references to it. This may mean that the package is missing, out of date, or only is available from some other source E: Package "lsb-core" does not have a candidate for installation ``` – Danel Mar 10 '22 at 14:29
  • If the OP already states that he tried to use `apt install`, there's no need to write an answer telling him to repeat that – Nico Haase Mar 10 '22 at 14:31
  • That first one was a mistake, moreover the second command should work. – Frank nike Mar 10 '22 at 14:33
  • Then please add some explanation to your answer such that others can learn from it. – Nico Haase Mar 10 '22 at 14:36
  • No worries for your previous answer, I think that you are right regarding your edit. I execute the following command ***sudo dpkg -S lsb_release*** to check if there are any executables and this is the output ```apparmor: /etc/apparmor.d/lsb_release```. I feel like somehow it still exists and that's why I cannot install it executing ***sudo apt install lsb-release/lsb-core*** . It would be interesting to completely remove it before trying to reinstall it by means of the `.deb` file you provided at step 1 or even the regular install. – Danel Mar 10 '22 at 17:24
  • Btw I don't have neither */usr/share/pyshared/lsb_release.py* nor */usr/bin/lsb_release* within my folder structure – Danel Mar 10 '22 at 17:26
  • Well i think you should just reinstall it, you could try `sudo apt reinstall lsb-release` – Frank nike Mar 10 '22 at 19:11
  • Reinstalling removes missing dependencies from previous installation? – Danel Mar 11 '22 at 08:11
  • The following files persist `base-files: /etc/lsb-release` `apparmor: /etc/apparmor.d/lsb_release` – Danel Mar 11 '22 at 08:22
  • `base-file: etc/lsb-release` shouldn't cause any problem since it just contains your system info but i don't know about apparmor – Frank nike Mar 11 '22 at 11:46