首先查看系统版本

1、[root@python ~]# cat /proc/version
Linux version 3.10.0-693.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Tue Aug 22 21:09:27 UTC 2017

2、[root@python ~]# cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core)

3、[root@python ~]# cat /etc/issue
\S
Kernel \r on an \m

4、[root@python ~]# uname -a
Linux python 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux


查看系统是32位还是64位?
1、[root@python ~]# getconf LONG_BIT
64
   [root@python ~]# getconf WORD_BIT
32
分析:32位的系统中int类型和long类型一般都是4字节,64位的系统中int类型还是4字节的,但是long已变成了8字节,linux 系统中可用 "getconf WORD_BIT"和 "getconf LONG_BIT"获得 word和long的位数 64 位系统中应该分别得到32和64,所以该系统为64位的linux系统。

2、[root@python ~]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3d705971a4c4544545cb78fd890d27bf792af6d4, stripped

 一、YUM 源

1、备份CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
如果没有 wget 命令先行下载

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、生成缓存

yum makecache

二、apt 源

sudo cp /etc/apt/source.list /etc/apt/source.list.bak       # 将原有的源文件复制保存
sudo vim /etc/apt/source.list    # 打开源文件

# 将下列的复制到文件中
deb http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse

# 更新 apt
sudo apt update     
sudo apt upgrade

三、pip 源
 

mkdir .pip              #目标目录下创建.pip文件

sudo vim .pip/pip.conf  #创建pip.conf文件

# 将下面的写入文件中 
    [global]
        index-url = http://mirrors.aliyun.com/pypi/simple/
    [install] 
        trusted-host=mirrors.aliyun.com

 

GitHub 加速计划 / li / linux-dash
10
2
下载
A beautiful web dashboard for Linux
最近提交(Master分支:1 个月前 )
186a802e added ecosystem file for PM2 5 年前
5def40a3 Add host customization support for the NodeJS version 5 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐