centos yum ant,centos怎么安装软件包

大家好,今天小编来为大家解答以下的问题,关于centos yum ant,centos怎么安装软件包这个很多人还不知道,现在让我们一起来看看吧!

怎样在CentOS 7.0上安装和配置VNC服务器

1.安装 X-Window

首先我们需要安装 X-Window,在终端中运行下面的命令,安装会花费一点时间。

# yum check-update# yum groupinstall"X Window System"

installing x windows

#yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts

install gnome classic session

###设置默认启动图形界面# unlink/etc/systemd/system/default.target# ln-sf/lib/systemd/system/graphical.target/etc/systemd/system/default.target

configuring graphics

# reboot

在服务器重启之后,我们就有了一个工作着的 CentOS 7桌面环境了。

现在,我们要在服务器上安装 VNC服务器了。

2.安装 VNC服务器

现在要在我们的 CentOS 7上安装 VNC服务器了。我们需要执行下面的命令。

# yum install tigervnc-server-y

vnc server

3.配置 VNC

然后,我们需要在/etc/systemd/system/目录里创建一个配置文件。我们可以将/lib/systemd/sytem/vncserver@.service拷贝一份配置文件范例过来。

# cp/lib/systemd/system/vncserver@.service/etc/systemd/system/vncserver@:1.service

copying vnc server configuration

接着我们用自己最喜欢的编辑器(这儿我们用的 nano)打开/etc/systemd/system/vncserver@:1.service,找到下面这几行,用自己的用户名替换掉。举例来说,我的用户名是 linoxide所以我用 linoxide来替换掉:

ExecStart=/sbin/runuser-l<USER>-c"/usr/bin/vncserver%i"PIDFile=/home/<USER>/.vnc/%H%i.pid

替换成

ExecStart=/sbin/runuser-l linoxide-c"/usr/bin/vncserver%i"PIDFile=/home/linoxide/.vnc/%H%i.pid

如果是 root用户则

ExecStart=/sbin/runuser-l root-c"/usr/bin/vncserver%i"PIDFile=/root/.vnc/%H%i.pid

configuring user

好了,下面重启 systemd。

# systemctl daemon-reload

最后还要设置一下用户的 VNC密码。要设置某个用户的密码,必须要有能通过 sudo切换到用户的权限,这里我用 linoxide的权限,执行“su linoxide”就可以了。

# su linoxide$ sudo vncpasswd

setting vnc password

确保你输入的密码多于6个字符

4.开启服务

用下面的命令(永久地)开启服务:

$ sudo systemctl enable vncserver@:1.service

启动服务。

$ sudo systemctl start vncserver@:1.service

5.防火墙设置

我们需要配置防火墙来让 VNC服务正常工作。

$ sudo firewall-cmd--permanent--add-service vnc-server$ sudo systemctl restart firewalld.service

allowing firewalld

现在就可以用 IP和端口号(LCTT译注:例如 192.168.1.1:1,这里的端口不是服务器的端口,而是视 VNC连接数的多少从1开始排序)来连接 VNC服务器了。

6.用 VNC客户端连接服务器

好了,现在已经完成了 VNC服务器的安装了。要使用 VNC连接服务器,我们还需要一个在本地计算机上安装的仅供连接远程计算机使用的 VNC客户端。

debian linux的yum配置

centos配置yum源

网络yum源配置

1.把默认yum源备份(可选)

#mkdir/opt/centos-yum.bak

#mv/etc/yum.repos.d/*/opt/centos-yum.bak/

2.查看系统版本

cat/etc/redhat-release//查看系统的版本

CentOS Linux release 7.2.1511(Core)

3.下载aliyun yum源repo文件(对应自己的系统版本下载即可)

CentOS 5

wget-O/etc/yum.repos.d/CentOS-Base.repo

CentOS 6

wget-O/etc/yum.repos.d/CentOS-Base.repo

CentOS 7

wget-O/etc/yum.repos.d/CentOS-Base.repo

wget

wget

4.清除缓存

#yum clean all

#yum makecache//把yum源缓存到本地,加快软件的搜索好安装速度

#yum list//总共列出了9954个包

centos镜像源配置

上传镜像到服务器

cd/mnt

mkdir cdrom//新建挂在目录

mount镜像名称/mnt/cdrom//挂载镜像

cd/etc/yum.repos.d

cp-r yum.repos.d yum.repos.d.bak//备份repos.d文件

rm-rf/etc/yum.repos.d/*//清空repos.d目录下文件

touch local.repo//新建repo文件

vi local.repo//编辑repo文件

[yum]

name=centos7.6

baseurl= 镜像挂载目录

gpgcheck=0

enabled=1

退出:wq

yum clean all

Yum makecache

局域网yum源配置

1.备份yum源

rm-f/etc/yum.repos.d/*

cat>/etc/yum.repos.d/local.repo

2.查看系统版本

cat/etc/redhat-release//查看系统的版本

CentOS Linux release 7.2.1511(Core)

3.编辑yum配置文件

vi/etc/yum.repos.d/local.repo

【yum】

name= centos7.5

baseurl=http://ip地址/yum/centos7.2

gpgcheck=0

enabled=1

4.清楚缓存

yum clean all

yum makecache

deepin系统配置apt-get

1.备份source.list文件

cp/etc/apt/source.list/etc/apt/source.list.bak

2、编辑源列表文件(网络源把网址换成ali或163地址即可)

vim/etc/apt/source.list

deb 地址:/yum/deepin kui main contrib non-free

3.更新apt缓存

4.apt-get update

main由符合DFSG标准的软件包组成,不依赖于main外的软件来运行。这是debian发行时默认启用的仓库组成。

contrib软件包包含符合DFSG标准的软件,但依赖项不在main中(可能是非自由的Debian打包)。

non-free非自由,包含不符合DFSG的软件。

lion、panda是发行版的仓库代号

通过apt命令已安装软件

apt list--installed

dpkg-l

ubuntu配置网络apt源

1.备份源文件备份

sudo cp/etc/apt/sources.list/etc/apt/sources.list.bak

2.查看新版本信息

lsb_release-c

得到系统的系统代号:

我们可以看到新版本的Ubuntu系统代号为bionic

同样的我们也可以得到之前任意版本的系统代号:

Ubuntu 12.04(LTS)代号为precise。

Ubuntu 14.04(LTS)代号为trusty。

Ubuntu 15.04代号为vivid。

Ubuntu 15.10代号为wily。

Ubuntu 16.04(LTS)代号为xenial。

3.编辑源列表文件

sudo vi/etc/apt/sources.list

4.将原有的内容注释掉,添加以下内容(src-源码)

deb bionic main restricted universe multiverse

deb-src bionic main restricted universe multiverse

deb bionic-security main restricted universe multiverse

deb-src bionic-security main restricted universe multiverse

deb bionic-updates main restricted universe multiverse

deb-src bionic-updates main restricted universe multiverse

deb bionic-backports main restricted universe multiverse

deb-src bionic-backports main restricted universe multiverse

deb bionic-proposed main restricted universe multiverse

deb-src bionic-proposed main restricted universe multiverse

5.更新软件列表

运行如下命令:

sudo apt-get update

6.更新软件包

运行如下命令:

sudo apt-get upgrade

银河麒麟系统配置apt网络源

1、查看系统版本

cat/proc/version

2、备份原list文件

cd/etc/apt

sudo cp sources.list sources.list.bak

3、编辑新list文件

vi sources.list

deb jessie main non-free contrib

deb jessie-updates main non-free contrib

deb jessie-backports main non-free contrib

deb-src jessie main non-free contrib

deb-src jessie-updates main non-free contrib

deb-src jessie-backports main non-free contrib

deb jessie/updates main non-free contrib

deb-src jessie/updates main non-free contrib

4、更新apt源

sudo apt-get clean

apt-get update

5、安装软件包

apt-get install ant

centos7下如何安装xrdp

1安装xrdp

(请查看自己系统的位数,命令行输入arch,如果是32位使用则选择i386,如果是64位,请选择x86_64,epel包的名字会对应的改变,查找的方法是到镜像网站上进入到对应的目录,查到以epel-release开头的RPM包)

# wget

# rpm-Uvh epel-release-7-7.noarch.rpm

# yum install xrdp

2安装 tigervnc

# yum install tigervnc tigervnc-server

3为用户设置vnc密码

# vncpasswd root//为root用户设置vnc密码,如果需要其他用户vnc登入,//也可以为其设置密码 passwd user

4配置xrdp.ini文件,否则远程连接可能无法成功

# vim/etc/xrdp/xrdp.ini

把max_bpp=32,改为max_bpp=24

5配置SELinux,否则可能无法启动xrdp服务,或者启动出错

chcon-t bin_t/usr/sbin/xrdp

chcon-t bin_t/usr/sbin/xrdp-sesman

6启动xrdp服务,并设置为开机启动

# systemctl start xrdp

# systemctl enable xrdp

7查看xrdp服务是否正常启动

# systemctl status xrdp.service//如果看到Active则说明正常

# netstat-antup|grep xrdp//看xrdp和xrdp-sesman是否正常启动

8关闭防火墙,或者打开防火墙3389端口

# systemctl stop firewalld.service

# systemctl disable firewalld.servie

或者打开3389端口

# firewall-cmd--permanent--zone=public--add-port=3389/tcp

# firewall-cmd--reload

阅读剩余
THE END