
linux常用设置和配置
配置阿里云yum源centos7配置国内yum源 - 腾讯云开发者社区-腾讯云 (tencent.com)
1 | cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup |
安装 epel
yum install -y epel-release
配置阿里镜像提供的epel源
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
CentOS7官方源默认已经包含bash-completion,直接安装
1 | yum -y install bash-completion |
清华
# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
设置网络相关
changeYumrepo
1 | #!/bin/bash |
1 | cd /etc/sysconfig/network-scripts/ |
改名:
hostnamectl set-hostname centos-backup
跑分
wget -qO- –no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
V2ray 一键脚本:
bash <(curl -s -L https://git.io/v2ray.sh)
调试shell脚本
{ set -x
set +x; } 2>/tmp/desktop.log
shell终端显示全路径
1 | echo "export PS1='[\u@\h $PWD]$'" >> ~/.bash_profile |
使用ll显示更友好
最新修改的文件排在最下面
1 | alias ll='ls -lhtr --time-style=long-iso' |
比 ctrl+r 更准确、有效的在历史命令纪录中查找自己想要的命令:
- 首先在该用户家目录下新建一个 .inputrc 文件,并在其中写入以下配置,如下:
1 | cat > ~/.inputrc << eof |
error while loading shared libraries: LibXm.so.4: cannot open shared object file: No such file or directory
在Linux应用软件安装的过程中,比较头疼的是库的问题,比如安装完成程序后,碰到这样的信息:xxxxx: error while loading shared libraries: LibXm.so.4: cannot open shared object file: No such file or directory
这时候对Linux系统不熟悉的用户往往一头雾水:难道应用软件不是说可以在这个Linux的Distribution上安装的么?
早期的Redhat的一些Linux版本有一个万能的办法:就是在安装Linux的过程中选择“完全安装”,虽然安装的系统很是占
硬盘,但是不需要操心库的事情了。现在就复杂得多:什么Server安装、Develop安装、Desktop安装,等等。在安装应用
软件的时候,用户就要操心库的事情了。但是有一点是好的:就是应用软件如果说在那个Linux版本上是支持的,比如Suse 11,
那么,至少你不需要到处去找库的安装包 - Linux安装光盘或者ISO包中一定有。
以libXm.so.4为例,这时说,应用软件需要motif或者openmotif的支持。这时候用户只需要将Linux的光盘
放到驱动器或者挂载Linux系统的ISO文件,进入相应的目录,比如:
/media/RHEL5u5/Server(这个目录下是安装所需要的rpm文件)
列举一下Openmotif相关的rpm文件,选择x86-64或者i386包,使用:
#rpm -ivh openmotif-xxx.rpm
就可以完成libXm.so.4的安装。
您的VPN账号已创建:
用户名:lfdou
密码:Letmin07183





