为什么在ubuntu上不带-a参数就不能运行lsb_release?

时间:2018-09-05 13:19:50

标签: linux

为什么在ubuntu上没有-a参数的情况下不能运行lsb_release?因为当我运行lsb_release命令时,我收到消息“没有可用的LSB模块”。

2 个答案:

答案 0 :(得分:1)

说明: lsb_release命令-在计算机上打印Linux发行版。

解决方案:没有参数时,默认情况下为-v(版本)。要查看Linux发行版的完整信息,请始终使用-a标志或-r发行号。

示例

$lsb_release -a

#output:
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:    18.04
Codename:   bionic

$lsb_release -r

#output:
Release:    18.04

标志是:

       -v, --version
              Show the version of the LSB against which your current installation is compliant.  The version is expressed as a colon separated list of LSB module descriptions.

       -i, --id
              Display the distributor's ID.

       -d, --description
              Display a description of the currently installed distribution.

       -r, --release
              Display the release number of the currently installed distribution.

       -c, --codename
              Display the code name of the currently installed distribution.

       -a, --all
              Display all of the above information.

       -s, --short
              Use the short output format for any information displayed.  This format omits the leading header(s).

       -h, --help
              Show summary of options.

答案 1 :(得分:0)

man pagelsb_release

   If no options are given, the -v option is assumed.

-v选项:

   -v, --version
          Show the version of the LSB against which your current installa‐
          tion  is  compliant.   The version is expressed as a colon sepa‐
          rated list of LSB module descriptions.

如果没有安装任何lsb模块,则会收到您所描述的消息。 -a开关显示所有可用信息。