在Fedora Linux上安装less

使用dnf命令,如下所示:

$ sudo dnf update
$ sudo dnf install less

在CentOS/RHEL上安装less

使用下面命令安装less

$ sudo yum update
$ sudo yum install less

在CentOS/RHEL上查看软件包的信息

$ sudo yum info less
如何在CentOS/RHEL/Fedora上安装less

如何解决bash: less: command not found
如何在CentOS或RHEL(Red Hat Enterprise Linux)/Fedora Linux服务器上安装LESS?
如何配置Linux容器自动安装LESS实用程序?

使用Docker或者Podman容器中安装less

$ mkdir apache2
$ cd apache2
$ echo 'Podman/Docker apache2 demo by onitroad' > index.html
$ vim Dockerfile

Dockerfile示例:

FROM centos:8
 
MAINTAINER onitroad
LABEL Remarks="CentOS 8 test image for installing less along with Apache2"
 
# Install apache2 with less
RUN yum -y update && \
yum -y install httpd less && \
yum clean all
 
# Sample index.html for test 
COPY index.html /var/www/html/index.html
 
# Port and set entry point for container 
EXPOSE 80
ENTRYPOINT /usr/sbin/httpd -DFOREGROUND

使用podman命令/docker命令按以下方式构建它:

$ sudo docker build --tag centos:apache2 -f ./Dockerfile
或者
$ sudo podman build --tag centos:apache2 -f ./Dockerfile

查找less软件包

在CentOS或RHEL系统版本使用dnf命令/yum命令查找软件包:

$ sudo yum whatprovides '*bin/less'
日期:2020-03-23 08:03:56 来源:oir作者:oir