CentOS 6.x下安装(RPM和编译)aria2

CentOS 6.x下安装(RPM和编译)aria2
aria2 是一款 Linux 下轻量级的多线程下载工具,支持Http/Https、Ftp、BitTorrent、Metalink协议。
官网地址:http://aria2.sourceforge.net ,首页有简略使用教程(Usage Examples)
repo 里没有 aria2 ,因此需要到 http://pkgs.repoforge.org/aria2/ 去下载 rpm 包安装即可。

CentOS 6.x 32 位下安装
wget -c http://pkgs.repoforge.org/aria2/aria2-1.16.4-1.el6.rf.i686.rpm
rpm -ivh aria2-1.16.4-1.el6.rf.i686.rpm

CentOS 6.x 64 位下安装
wget -c http://pkgs.repoforge.org/aria2/aria2-1.16.4-1.el6.rf.x86_64.rpm
rpm -ivh aria2-1.16.4-1.el6.rf.x86_64.rpm

在安装过程有可能会出现缺少 libnettle.so.4 的错误提示。
因此需要先到 http://pkgs.repoforge.org/nettle/ 去下载安装 nettle 即可。
CentOS 6.x 32 位下安装
wget -c http://pkgs.repoforge.org/nettle/nettle-2.2-1.el6.rf.i686.rpm
wget -c http://pkgs.repoforge.org/nettle/nettle-devel-2.2-1.el6.rf.i686.rpm
rpm -ivh nettle-2.2-1.el6.rf.i686.rpm
rpm -ivh nettle-devel-2.2-1.el6.rf.i686.rpm

CentOS 6.x 64 位下安装
wget -c http://pkgs.repoforge.org/nettle/nettle-2.2-1.el6.rf.x86_64.rpm
wget -c http://pkgs.repoforge.org/nettle/nettle-devel-2.2-1.el6.rf.x86_64.rpm
rpm -ivh nettle-2.2-1.el6.rf.x86_64.rpm
rpm -ivh nettle-devel-2.2-1.el6.rf.x86_64.rpm

编译安装aria2
wget http://iweb.dl.sourceforge.net/project/aria2/stable/aria2-1.19.0/aria2-1.19.0.tar.gz
tar zxvf aria2-1.19.0.tar.gz
cd aria2-1.19.0
./configure
make
make install

man aria2c //查看 aria2c manual

aria2c http://cachefly.cachefly.net/100mb.test && rm -f 100mb.test
aria2c -c http://a/f.iso ftp://b/f.iso //-c 选项可以断点续传文件
aria2c http://example.org/mylinux.torrent
aria2c 'BitTorrent Magnet URI' -d test/ //-d test/是指明下载文件保存在test目录
aria2c http://example.org/mylinux.metalink
aria2c -i uris.txt //Download URIs found in text file

完成

Red Hat Enterprise Linux7.x(RHEL7.x)更换CentOS YUM源

Red Hat Enterprise Linux7.x(RHEL7.x)更换CentOS YUM源
Red Hat Enterprise Linux7.x(RHEL7.x) change CentOS YUM repository
Red Hat Enterprise Linux 7.1.1503(RHEL 7.1.1503)更换CentOS YUM源
由于RHEL的yum在线更新是收费的,RedHat在没有订阅授权的情况下是不能通过yum下载任何软件的,想使用RHEL系统,还想用yum源来在线安装软件,就需要更换成CentOS YUM源。
#cat /etc/redhat-release //查看版本
Red Hat Enterprise Linux Server release 7.1 (Maipo)

1、删除RHEL原有的yum
rpm -aq|grep yum|xargs rpm -e --nodeps //删除RHEL原有的yum
sudo rpm -ivh http://mirrors.ustc.edu.cn/centos/7.1.1503/os/x86_64/Packages/wget-1.14-10.el7_0.1.x86_64.rpm //安装wget

2、安装CentOS的yum
下载
wget http://mirrors.ustc.edu.cn/centos/7.1.1503/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7.1.1503/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7.1.1503/os/x86_64/Packages/yum-3.4.3-125.el7.centos.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7.1.1503/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-29.el7.noarch.rpm
安装
rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh yum-3.4.3-125.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-29.el7.noarch.rpm

3、下载源文件(CentOS 7)
https://lug.ustc.edu.cn/wiki/mirrors/help/centos //下载页面,根据需要进行下载

4、编辑源文件 CentOS-Base.repo

$releasever 替换成相应的版本号
$basearch 替换成想要的系统位数
编辑源文件 CentOS-Base.repo
http://mirrors.ustc.edu.cn/centos/7.1.1503/ //$releasever替换为7.1.1503 $basearch替换为x86_64,建议国内用户使用
http://mirror.vtti.vt.edu/centos/7.1.1503/ //$releasever替换为7.1.1503 $basearch替换为x86_64,建议国外用户使用

5、导入GPG key
sudo rpm --import http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-7 //导入GPG key
sudo rpm --import http://mirror.vtti.vt.edu/centos/RPM-GPG-KEY-CentOS-7 //导入GPG key

6、安装扩展源
yum -y install epel-release //安装 Extra Packages for Enterprise Linux (EPEL)
yum clean all //清除YUM缓存
yum makecache //创建YUM缓存
yum repolist all //列出全部repository列表

http://mirrorlist.centos.org/?release=7.1.1503&arch=x86_64&repo=os
发现最适合自己的源
完成

VMware Workstation 16 Pro

对于在隔离的安全虚拟化环境中评估新的操作系统、软件应用和补丁程序以及参考体系结构而言,是最轻松、快速和可靠的方法。没有任何其他桌面虚拟化软件能够提供与 Workstation Pro 相媲美的性能、可靠性和领先的功能特性。

VMware Workstation 12 Pro

VMware Workstation 12 Pro 下载地址

VMware Workstation 12 Pro for Windows(64 位)
VMware Workstation 12 Pro for Linux(64 位)


VMware Workstation 15.5 Pro

支持连接到vSphere 6.7。
支持将本地虚拟机上载到vSphere 6.7。
支持将在vSphere 6.7上运行的远程虚拟机下载到本地桌面。

VMware Workstation 15.5 Pro 下载地址

VMware Workstation 15.5 Pro for Windows(64 位)下载
VMware Workstation 15.5 Pro for Linux (64 位)下载


VMware Workstation 16 Pro

支持连接到vSphere 7.0。
支持将本地虚拟机上载到vSphere 7.0。
支持将在vSphere 7.0上运行的远程虚拟机下载到本地桌面。
支持Linux主机上的Intel GPU的3D支持,以使用Vulkan渲染器向VM提供DirectX 10.1和OpenGL 3.3。

VMware Workstation 16 Pro 下载地址

Workstation 16 Pro for Windows(64 位)下载
Workstation 16 Pro for Linux (64 位)下载

VMware Workstation 12 Pro key

5A02H-AU243-TZJ49-GTC7K-3C61N
AG7H2-66Y80-M81HP-1MQZZ-ZZREA
GG78H-4ZDE0-0887Z-A6ZQT-QARDD
VF74R-DJD43-080TP-Y5YNZ-MAHE2

VMware Workstation 15 Pro key

UY758-0RXEQ-M81WP-8ZM7Z-Y3HDA
VF750-4MX5Q-488DQ-9WZE9-ZY2D6
UU54R-FVD91-488PP-7NNGC-ZFAX6
YC74H-FGF92-081VZ-R5QNG-P6RY4

VMware Workstation 16 Pro key

ZF3R0-FHED2-M80TY-8QYGC-NPKYF
YF390-0HF8P-M81RQ-2DXQE-M2UT6
ZF71R-DMX85-08DQY-8YMNC-PPHV8

CentOS6.x\Red Hat\Fedora\Linux 安装Wine 1.7.48 桌面运行环境教程

Open Source Software for running Windows applications on other operating systems
Wine (“Wine Is Not an Emulator” 的首字母缩写)是一个能够在多种 POSIX-compliant 操作系统(诸如 Linux,Mac OSX 及 BSD 等)上运行 Windows 应用的兼容层。 Wine 不是像虚拟机或者模拟器一样模仿内部的 Windows 逻辑,而是將 Windows API 调用翻译成为动态的 POSIX 调用,免除了性能和其他一些行为的内存占用,让你能够干净地集合 Windows 应用到你的桌面。
CentOS6.x\Red Hat\Fedora\Linux 安装Wine 1.7.48 桌面运行环境教程
主要分为两种安装方式:
1:yum 安装
2:源码编译安装(32和64位系统分别安装)

事先安装图形界面GNOME

Red Hat / CentOS / Fedora yum 安装

#yum -y install epel-release
#yum clean all //清空YUM缓存
#yum makecache //生成YUM缓存
yum repolist //确认EPEL状态
#yum -y install wine //安装wine
#yum upgrade wine //升级wine

Red Hat / CentOS / Fedora 源码编译 安装
CwntOS 32位系统安装

#yum -y install wget gcc make vim screen bzip2-devel epel-release zlib-devel libxcb-devel
#yum groupinstall "Development tools" -y
#yum clean all //清空YUM缓存
#yum makecache //生成YUM缓存
#yum repolist //确认EPEL状态
#yum -y update
#reboot
#wget http://nchc.dl.sourceforge.net/project/wine/Source/wine-1.7.48.tar.bz2 //下载wine
#tar -jxvf wine-1.7.48.tar.bz2 //解压
#cd wine-1.7.48
#./configure

configure: error: X development files not found. Wine will be built
#yum -y install libX11-devel freetype-devel
#./configure //配置
#make //编译
#make install //安装
#wine xxx.exe //运行32位软件

CentOS 64位系统安装

#yum groupinstall "Development tools" -y
#yum -y install wget gcc make vim screen bzip2-devel epel-release zlib-devel libxcb-devel
#yum -y update
#reboot
#wget http://nchc.dl.sourceforge.net/project/wine/Source/wine-1.7.48.tar.bz2 //下载wine
#tar -jxvf wine-1.7.48.tar.bz2 //解压
#cd wine-1.7.48
#./configure

configure: error: Cannot build a 32-bit program, you need to install 32-bit development libraries.

#./configure --enable-win64 //配置
configure: Finished. Do 'make' to compile Wine.

configure: error: X development files not found. Wine will be built

#yum -y install libX11-devel
#./configure --enable-win64

configure: error: FreeType development files not found. Fonts will not be built.
Use the --without-freetype option if you really want this.
#yum -y install freetype-devel
#./configure --enable-win64
configure: Finished. Do 'make' to compile Wine.
#make //编译
Wine build complete.
#make install //安装
#wine64 xxx.exe //运行64位软件
完成

linux的NetworkManager服务

linux (CentOS)配置IP地址信息,重启后网络配置失效。
经多次查找发现这种是NetworkManager的问题,NetworkManager试图将DHCP中获取的DNS信息写入/etc/resolv.conf,导致原文件被覆盖,
打开/etc/resolv.conf文件 会发现 Crate by networkmanager。

1:在配置文件添加 PEERDNS=no 这个选项可令/etc/resolv.conf 在系统重启后不会被重写,
重新启动后仍任被NetworkManager 重新创建了/etc/resolv.conf,该方法无效。

2:在文件属性中设置i参数避免文件被修改
#chattr +i /etc/resolv.conf

#chattr -i /etc/resolv.conf //如果你要修改此文件,移除i参数
重新启动后仍任被NetworkManager 重新创建了/etc/resolv.conf,该方法无效。

3:关闭该服务。
service NetworkManager stop 临时关闭:
chkconfig NetworkManager off 永久关闭:

关闭后正常

网络管理器最初由 Redhat 公司开发,现在由 GNOME 管理。

为CentOS 6.x安装图形界面GNOME

VMware Workstation Kernel Headers for version 2.6.32-504.30.3.el6.x86_64 were not found

VMware Workstation Kernel Headers for version 2.6.32-504.30.3.el6.x86_64 were not found
当VMware Workstation出现这个提示的时候将无法继续向下进行工作,这时候必须要解决这个问题。

解决办法:
yum -y update
yum -y install automake gcc kernel-devel
reboot
wget https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-11.1.2-2780323.x86_64.bundle
chmod 777 VMware-Workstation-Full-11.1.2-2780323.x86_64.bundle
bash VMware-Workstation-Full-11.1.2-2780323.x86_64.bundle //Linux 安装VMware Workstation

Kernel Headers

为CentOS 6.x安装图形界面GNOME、火狐浏览器并用TigerVNC 远程连接

为CentOS 6.6安装图形界面GNOME、火狐浏览器并用TigerVNC 远程连接
GNOME
易用性——设计和创建为所有人所用的桌面和应用程序
国际化——保证桌面和应用程序可以用于很多语言
火狐浏览器
Firefox 全球第三大流行的网页浏览器
VNC
VNC(Virtual Network Computing),为一种使用RFB协议的屏幕画面分享及远程操作软件


准备阶段:
#yum -y install wget gcc make vim screen epel-release
#yum clean all //清空YUM缓存
#yum makecache //生成YUM缓存
#yum repolist //确认EPEL状态
#yum -y update
#reboot

开始安装GNOME:
yum groupinstall "Development tools" -y
yum groupinstall "X Window System" "Desktop" "Chinese Support" "Fonts" -y

groupinstall "Desktop" #CentOS 6.x版本安装GNOME包
groupinstall "GNOME Desktop Environment" #CentOS 5.x版本安装GNOME包

开始安装配置TigerVNC Server:
yum -y install tigervnc-server

接下来设定VNC使用者进入后的环境,vim /etc/sysconfig/vncservers
下面是默认值,修改这里的用户和登入设定,他的值是 "索引号1:用户账号1 索引号2:用户账号2 索引号3:使用者账号3 ...."

索引值就是未来联机用的port号(5900+索引值),例如索引值2 (5900 + 2),所以到时连接 VNC Server 就使用 :5902
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

多用户举例

VNCSERVERS="2:root 3:axer"
VNCSERVERARGS[2]="-geometry 1280x1024 -nolisten tcp -localhost"
VNCSERVERARGS[3]="-geometry 1280x1024"

单用户举例
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1360x768" //分辨率可以根据实际情况设置

用户必须是存在的

设定VNC的使用者密码
vnc的用户帐密和系统不同,需独立设定,使用指令 vncpasswd,切换到该用户下指令即可:

#vncpasswd
Password:
Verify:
你可能会忘记vnc的密码,只要把自己家目录中的 .vnc/passwd 档删掉然后重新执行 vncpasswd 即可。
#rm ~/.vnc/passwd

多用户务必设定后面中已指定的用户密码,否则在启动vnc会出现这样的错误:
3:axer
VNC password for user axer is not configured
[失败]
启动vnc/停止vnc
#service vncserver start | stop | restart

设定开机启动
#chkconfig --level 35 vncserver on

iptables防火墙
iptables -I INPUT -p tcp --dport 5901 -j ACCEPT
service iptables save
service iptables restart

其他

1. 如果启动时出现错误
正在启动 VNC 服务器:0:root A VNC server is already running as :0
这代表 /etc/sysconfig/vncservers 中有设定 "0"索引值,索引值得从1开始 VNCSERVERS="0:root 1:axer"

2. 查看正在开启的vnc server window
#vncserver -list

TigerVNC server sessions:

X DISPLAY # PROCESS ID
:1 6376
:2 6418

3. 强制关闭其中的显示,例如第2个
#vncserver -kill :2

vim /etc/inittab
id:3:initdefault //将3改为5,id:5:initdefault
系统启动,默认进入文字界面(默认为3);我们要让系统自动进入图形界面(数字5),所以把3改为5。

安装完毕后需要重新启动服务器

CentOS 7.x
#yum -y install wget gcc make vim screen epel-release
#yum clean all //清空YUM缓存
#yum makecache //生成YUM缓存
#yum repolist //确认EPEL状态
#yum -y update
#reboot

yum groupinstall "Development tools" -y
yum groupinstall "GNOME Desktop" -y

开始安装火狐浏览器:
yum -y install wget gcc make epel-release //更新yum源
yum -y install firefox //安装火狐浏览器

安装完毕后需要重新启动计算机或服务器

在CentOS6.x或CentOS7.x上安装EPEL Repo,Extra Packages for Enterprise Linux (EPEL)

免费全能虚拟机VirtualBox


甲骨文公司出品的免费全能虚拟机工具VirtualBox 4.3.28稳定版正式发布。

特别注意:
VirtualBox 是含简体中文语言包的,不过安装的时候要特别注意,如果您登录Windows 的用户名是中文名,会导致软件无法正确安装。

VirtualBox,提供用户在32位或64位的Windows、Solaris及Linux 操作系统上虚拟其它的操作系统。
用户可以在VirtualBox上安装并且运行Solaris、Windows、DOS、Linux、OS/2 Warp、OpenBSD及FreeBSD等系统作为客户端操作系统。
VirtualBox支持Intel VT-x与AMD AMD-V硬件虚拟化技术。
特色:
支持64位客户端操作系统,即使主机使用32位CPU
支持SATA硬盘NCQ技术
虚拟硬盘快照
无缝视窗模式(须安装客户端驱动)
能够在主机端与客户端共享剪贴板(须安装客户端驱动)
在主机端与客户端间创建共享文件夹(须安装客户端驱动)
内置远程桌面服务器
支持VMware VMDK磁盘文件及Virtual PC VHD磁盘文件格式
3D虚拟化技术支持OpenGL(2.1版后支持)、Direct3D(3.0版后支持)、WDDM(4.1版后支持)
最多虚拟32颗CPU(3.0版后支持)
支持VT-x与AMD-V硬件虚拟化技术
iSCSI支持
USB与USB2.0支持

VirtualBox 4.3.28中文版下载
VirtualBox 4.3.28 Oracle VM VirtualBox Extension Pack
VirtualBox 5.0.0中文版下载