Description | CentOS 8 | Ubuntu 20 | Docker |
package manager | yum | apt | apk |
Update | yum update -y | apt update | apk update |
Check OS version | cat /etc/redhat-release cat /proc/version | cat /etc/issue cat /proc/version | cat /etc/issue cat /proc/version |
Install aws-cli | dnf install python3-pip pip3 install awscli | apt-get install awscli | apk add –no-cache aws-cli |
Install wget | yum install wget | apt-get install wget | – |
Install curl | – | apt-get install curl | apk add curl |
Check port | netstat -tunlp | grep 8000 | netstat -tunlp | grep 8000 | netstat -tunlp | grep 8000 |
lsof -i:80 | lsof -i:80 | lsof -i:80 | |
Centos install error:
[root@2b7f05b55efb /]# yum install wget
Failed to set locale, defaulting to C.UTF-8
CentOS Linux 8 - AppStream 96 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
[root@2b7f05b55efb /]# sudo sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
bash: sudo: command not found
To resolve this issue:
[root@2b7f05b55efb /]# sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
[root@2b7f05b55efb /]# sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*