常见开发工具安装方法

yum

# version
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core)

# 源
[root@localhost yum.repos.d]# egrep -v '(^#|^$)' CentOS-Base.repo 
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

# 源仓库目录加载
[root@localhost ~]# yum repolist
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
源标识                                                             源名称                                                             状态
base/7/x86_64                                                      CentOS-7 - Base                                                    10,072
docker-ce-stable/7/x86_64                                          Docker CE Stable - x86_64                                             132
extras/7/x86_64                                                    CentOS-7 - Extras                                                     500
updates/7/x86_64                                                   CentOS-7 - Updates                                                  2,963
repolist: 13,667

# 验证
[root@localhost ~]# yum -y install httpd  && echo $?
0

apt

# version
root@BS:/etc/apt# uname -a
Linux BS 5.4.0-90-generic #101~18.04.1-Ubuntu SMP Fri Oct 22 09:25:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
root@BS:/etc/apt# cat /proc/version
Linux version 5.4.0-90-generic (buildd@lcy01-amd64-026) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #101~18.04.1-Ubuntu SMP Fri Oct 22 09:25:04 UTC 2021

# 源
root@BS:/etc/apt# egrep -v "(^$|^#)" sources.list
deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ bionic universe
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe
deb http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse

# 测试
root@BS:/etc/apt# apt install apache2 -y

npm

C:\Users\zhanghe>npm install vue
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\zhanghe\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\zhanghe\package.json'
npm WARN vue-awesome-swiper@4.1.1 requires a peer of swiper@^5.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN zhanghe No description
npm WARN zhanghe No repository field.
npm WARN zhanghe No README data
npm WARN zhanghe No license field.

+ vue@2.6.14
added 1 package from 1 contributor and audited 7 packages in 1.239s

1 package is looking for funding
  run `npm fund` for details

docker

centos7

# version
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core)

# 配置docker使之信任registry.cn-shenzhen.aliyuncs.com,放弃对此地址安全检查;
[root@localhost ~]# vim /etc/docker/daemon.json 
{
   "insecure-registries":["registry.cn-shenzhen.aliyuncs.com"]
}

# 重启docker
[root@localhost ~]# systemctl restart docker

# 指定从registry.cn-shenzhen.aliyuncs.com 下载镜像
[root@localhost ~]# docker pull registry.cn-shenzhen.aliyuncs.com/star7th/showdoc
[root@localhost ~]# echo $?
0

windows

增加下列配置:

PIP

ubuntu

# version
root@BS:/etc/apt# uname -a
Linux BS 5.4.0-90-generic #101~18.04.1-Ubuntu SMP Fri Oct 22 09:25:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
root@BS:/etc/apt# cat /proc/version
Linux version 5.4.0-90-generic (buildd@lcy01-amd64-026) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #101~18.04.1-Ubuntu SMP Fri Oct 22 09:25:04 UTC 2021

# pip 配置
cd ~
mkdir .pip
vim .pip/pip.conf
	[global]
	index-url=http://mirrors.aliyun.com/pypi/simple/
	[install]
	trusted-host=mirrors.aliyun.com

# 测试
root@BS:~# pip install a2a

windows

# 注意要加trusted
pip install onnx -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
原文地址:https://www.cnblogs.com/yizhangheka/p/15590833.html