1、加源
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
2、安裝
# yum update;yum install ntfs-3g
如果系統(tǒng)提示:沒有可用軟件包,可以輸入
# yum install ntfs*
fdisk -l
grub2-install
1.首先需要進(jìn)入目錄 /etc/sysconfig/network-scripts
2.vi ifcfg-ens33
這里主要需要修改幾個地方。
a.由于我要配置的靜態(tài)的IP,所以BOOTPROTO=static。#dhcp
b.ONBOOT=yes。默認(rèn)為no,開啟網(wǎng)絡(luò)連接。
d.IPADDR,NETMASK,GATEWAY,DNS1,DNS2參考修改
7.重啟network service
service network restart.
8.測試ping
ping www.baidu.com
安裝GNOME
yum grouplist
yum groupinstall "GNOME Desktop"
startx
安裝openssh
開啟ssh服務(wù)需要root權(quán)限,先用root賬戶登陸
先檢查有沒有安裝ssh服務(wù):rpm -qa | grep ssh
如果沒有安裝ssh服務(wù)就安裝 : yum install openssh-server
安裝好后在ssh配置文件里進(jìn)行配置 : vim /etc/ssh/sshd_config
Port 22
PermitRootLogin yes
用esc+:wq 保存退出
修改完后用 /bin/systemctl start sshd.service 開啟ssh服務(wù),這個命令沒有回顯
開啟后用 ps -e | grep sshd 檢查一下ssh服務(wù)是否開啟
再用netstat -an | grep 22檢查一下22端口是否開啟
將ssh服務(wù)添加到自啟動列表中:systemctl enable sshd.service
關(guān)閉selinux
運行命令 getenforce 獲取當(dāng)前selinux狀態(tài)
Enforcing為開啟
setenforce 0
vim /etc/sysconfig/selinux
SELINUX=disabled
關(guān)閉防火墻
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
systemctl enable firewalld
安裝tigervnc
yum -y install tigervnc-server tigervnc
cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service
vim /lib/systemd/system/vncserver@:1.service
設(shè)置vnc密碼[root@localhost ~]# vncpasswd
systemctl enable vncserver@:1.service
systemctl start vncserver@:1.service 或者 vncserver :1
關(guān)閉服務(wù):
systemctl stop vncserver@:1.service 或者 vncserver -kill :1
查看服務(wù)監(jiān)聽的端口
netstat -lnpt|grep Xvnc
修改分辨率
[root@localhost ~]# vi /usr/bin/vncserver
$geometry = “1280×1024″;
執(zhí)行下面的命令重啟vnc server
[root@localhost ~]# vncserver -kill :1
[root@localhost ~]# vncserver :1
gnome下中文輸入法
在 Applications -- System Tools -- Setting -- Regin & Language 這里設(shè)置Intelligent Pinyin,加進(jìn)來就ok。如果無效請看Centos7中文輸入法已設(shè)置但無法切換的解決辦法
EPEL是yum的一個軟件源,里面包含了許多基本源里沒有的軟件了,但在我們在使用epel時是需要安裝它才可以了.
EPEL,即Extra Packages for Enterprise Linux的簡稱,是為企業(yè)級Linux提供的一組高質(zhì)量的額外軟件包。
安裝epel倉庫:
yum -y install epel-release
移除epel倉庫:
yum -y remove epel-release
查看倉庫信息:
yum repolist
安裝 git 命令
yum install -y git
安裝VIM
同樣vim也有兩種安裝方法:
一、yum安裝,centos下安裝軟件最簡單的方法了,還能解決依賴問題,首推該方法,缺點是源里面有一些軟件并不是其官網(wǎng)上最新的
yum install -y vim
二、源碼編譯安裝,今天重點介紹這種方法,不過也挺簡單的(先安裝gcc編譯器)
yum -y install gcc gcc-c++
1.通過git下載vim最新版
git clone https://github.com/vim/vim.git
2.解決vim的依賴問題
sudo yum install -y ncurses-devel
3.編譯安裝(選項請參考手冊)
cd vim/src
./configure --prefix=/usr/local
make
sudo make install
4.vim命令即可
如果配置prefix,如:./configure --prefix=/usr/local/test可以把所有資源文件放在/usr/local/vim8的路徑中,不會雜亂。
ln -s /usr/local/vim/bin/vim /usr/bin/vim