RedHat Linux系列(Fedora,CentOS,Redhat enterprise)中一些有用的工具

1、加速下载工具(axel+yum-fastestmirror)

对于国内用户来说,yum实在太慢,而某些国内的镜像又不稳定,所以axelget+fastestmirror插件是最好选择!
AXEL是使用多线(Multi-thread)方式下载档案, 又有人写成YUM的plugin, 所以就来用看看!
到axel到官方网站http://axel.alioth.debian.org/下载axel包,当前最新版本是axel-2.4.tar.gz,然后解压缩安装
#tar zxvf axel-2.4.tar.gz
#cd axel-2.4
# ./configure –i18n=1
#make
#make install

设定YUM 使用 AXEL:
将 axelget.conf 放置 /etc/yum/pluginconf.d/
#wget http://cnfreesoft.googlecode.com/svn/trunk/axelget/axelget.conf -P /etc/yum/pluginconf.d/
将 axelget.py 放置 /usr/lib/yum-plugins/
#wget http://cnfreesoft.googlecode.com/svn/trunk/axelget/axelget.py -P /usr/lib/yum-plugins/

可以调整 yum-axel plugin, 只有超过200Kbyte档案才使用 axel:
# cat /etc/yum/pluginconf.d/axelget.conf
[main]
enabled=1
onlyhttp=1
enablesize=200000
cleanOnException=1

使用时使用axel命令代替wget下载,如下载skype-debian.deb包

#axel -n 10 skype-debian.deb http://www.skype.com/go/getskype-linux-deb

然后就可以看到多线程下载了

安装yum-fastestmirror让yum自动找最快镜像站点(从CentOS 5起已默认安装):
yum install yum-fastestmirror
完成fastestmirror 的安装后,请确定它已被启用。请编辑 /etc/yum/pluginconf.d/fastestmirror.conf 并确保它拥有下面数行:
[main]
verbose = 0
socket_timeout = 3
enabled = 1
hostfilepath = /var/cache/yum/timedhosts.txt
maxhostfileage = 1

配置文件中的hostfilepath字段(通常是/var/cache/yum/timedhosts.txt),用于定义yum源的配置文件,然后我们就可以将所知道的yum源统统写入这个txt文件,如:

ftp.nsysu.edu.tw
mirror01.idc.hinet.net
mirror.khlug.org
centos.vr-zone.com
ftp.stu.edu.tw
ftp.cse.yzu.edu.tw
mirror.yongbok.net
mirrors.btte.net
mirrors.sin1.sg.voxel.net
ftp.daum.net
ftp.isu.edu.tw
mirrors.163.com
mirror.neu.edu.cn
mirrors.ta139.com
ftp.oss.eznetsols.org
centos.mirror.cdnetworks.com
centos.tt.co.kr
ftp.tc.edu.tw
ftp.twaren.net
mirror.averse.net
mirror.nus.edu.sg
data.nicehosting.co.kr

要排除某个镜像、首层网域、或介於两者之间的域名,请在 /etc/yum/pluginconf.d/fastestmirror.conf 内加入 'exclude=' 一行:
[main]
...
exclude=.gov, facebook, myspace, junk-mirror.com
当你同时安装了 protectbase 及 fastestmirror 这两个 yum 插件,你便能取得最快速的更新而又受最高保护,避免来自第三方软件库的无意破坏。

试试看吧:
#yum update
Loaded plugins: axelget, presto, refresh-packagekit
Setting up Update Process

ok.
若用sudo yum install XXX时报sh: axel: command not found的错,解决办法是:
#cd /usr/bin
#ln -s /usr/local/bin/axel
然后就可以了

---------------------------------------------------------------------------------------------------------------------------------------

2、CentOS挂载NTFS格式驱动器(ntfs-3g)

CentOS和Redhat enterprise默认都不能挂载ntfs格式到硬盘,有两种方式。

第一种是安装内核模块,可到 http://sourceforge.net/projects/linux-ntfs/files/ 下载,需下载与你系统内核想对应的版本,使用uname -a 查看当前内核版本。安装后就可以使用mount -t ntfs /dev/sda1 /mnt 挂载了。这种方法有个缺点,就是挂载的ntfs分区是只读的。

第二种是安装ntfs-3g,官方网站是http://www.tuxera.com/community/ntfs-3g-download/,当前最新是ntfs-3g_ntfsprogs-2013.1.13.tgz,然后解压缩安装
#tar -zxvf ntfs-3g_ntfsprogs-2013.1.13.tgz
#cd ntfs-3g_ntfsprogs-2013.1.13
#./configure
#make
#make install
挂载驱动器时使用mount命令,如
#mount -t ntfs-3g /dev/sda1 /mnt/windows
也可以设置在开机启动时就默认挂载驱动器,在/etc/fstab文件尾部添上下面到语句
/dev/sda1 /mnt/windows ntfs-3g defaults 0 0

---------------------------------------------------------------------------------------------------------------------------------------

3、deb包转rpm包(alien)

deb文件格式本是ubuntu的安装文件,那么如果想要在fedora中安装,需要把deb格式转化成rpm格式,可以使用alien
官方网站是http://joeyh.name/code/alien/,下载最新发行版alien_8.89.tar.gz,然后解压缩安装(由于alien是perl程序,所以需要perl-5.004以上版本)
#tar -zxvf alien_8.89.tar.gz
#perl Makefile.PL
#make
#make install
使用到时候以skype-debian.deb包为例
#alien -r skype-debian_2.0.0.68-1_i386.deb
成功的话会看到以下信息
 skype-2.0.0.68-2.i386.rpm generated
然后就可以使用rpm命令安装了
#rpm -ivh skype-2.0.0.68-2.i386.rpm

---------------------------------------------------------------------------------------------------------------------------------------

4rar压缩解压

安装rar for linux,到官方网站http://www.rarsoft.com/download.htm下载,当前最新版本是rarlinux-5.0.1.tar.gz,解压安装
#tar -zxvf rarlinux-5.0.1.tar.gz
#cd rarlinux-5.0.1
#make
#make install
使用时查看rar --help,常用选项有
#rar e XXX.rar
#rar e XXX.rar /tmp
#rar x XXX.rar /tmp

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
deb to rpm工具 用法 [root@yun alien]# ls Alien alien.lsm alien.lsm.in alien.pl alien.spec alien.spec.in debian gendiff.txt GPL INSTALL Makefile.PL README TODO [root@yun alien]# ./alien.pl You must specify a file to convert. Usage: alien [options] file [...] file [...] Package file or files to convert. -d, --to-deb Generate a Debian deb package (default). Enables these options: --patch= Specify patch file to use instead of automatically looking for patch in /var/lib/alien. --nopatch Do not use patches. --anypatch Use even old version os patches. -s, --single Like --generate, but do not create .orig directory. --fixperms Munge/fix permissions and owners. --test Test generated packages with lintian. -r, --to-rpm Generate a Red Hat rpm package. --to-slp Generate a Stampede slp package. -l, --to-lsb Generate a LSB package. -t, --to-tgz Generate a Slackware tgz package. Enables these options: --description= Specify package description. --version= Specify package version. -p, --to-pkg Generate a Solaris pkg package. -i, --install Install generated package. -g, --generate Generate build tree, but do not build package. -c, --scripts Include scripts in package. -v, --verbose Display each command alien runs. --veryverbose Be verbose, and also display output of run commands. -k, --keep-version Do not change version of generated package. --bump=number Increment package version by this number. -h, --help Display this help message. -V, --version Display alien's version number. [root@yun alien]# ./Makefile.PL Writing Makefile for Alien [root@yun alien]# ls Alien alien.lsm.in alien.spec debian GPL Makefile mysqlcc_0.9.4-0ubuntu1_i386.deb TODO alien.lsm alien.pl alien.spec.in gendiff.txt INSTALL Makefile.PL README [root@yun alien]# ./alien.pl -r mysqlcc_0.9.4-0ubuntu1_i386.deb Warning: Skipping conversion of scripts in package mysqlcc: postinst postrm Warning: Use the --scripts parameter to include the scripts. mysqlcc-0.9.4-1.i386.rpm generated [root@yun alien]# ls Alien alien.lsm.in alien.spec debian GPL Makefile mysqlcc_0.9.4-0ubuntu1_i386.deb README alien.lsm alien.pl alien.spec.in gendiff.txt INSTALL Makefile.PL mysqlcc-0.9.4-1.i386.rpm TODO [root@yun alien]# make cp Alien/Package/Deb.pm blib/lib/Alien/Package/Deb.pm cp Alien/Package/Tgz.pm blib/lib/Alien/Package/Tgz.pm cp Alien/Package.pm blib/lib/Alien/Package.pm cp Alien/Package/Rpm.pm blib/lib/Alien/Package/Rpm.pm cp Alien/Package/Pkg.pm blib/lib/Alien/Package/Pkg.pm cp Alien/Package/Lsb.pm blib/lib/Alien/Package/Lsb.pm cp Alien/Package/Slp.pm blib/lib/Alien/Package/Slp.pm perl -pe '$_="" if /use lib/; $_="our \$Version=\"8.79\";\n" if /VERSION_AUTOREPLACE/' alien.pl > alien cp alien blib/script/alien /usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/alien Manifying blib/man1/alien.1 Manifying blib/man3/Alien::Package::Tgz.3pm Manifying blib/man3/Alien::Package::Deb.3pm Manifying blib/man3/Alien::Package::Rpm.3pm Manifying blib/man3/Alien::Package.3pm Manifying blib/man3/Alien::Package::Pkg.3pm Manifying blib/man3/Alien::Package::Lsb.3pm Manifying blib/man3/Alien::Package::Slp.3pm perl -i -pe "s/\@version\@/8.79/g" alien.lsm perl -i -pe "s/\@version\@/8.79/g" alien.spec [root@yun alien]# make install perl -i -pe "s/\@version\@/8.79/g" alien.lsm perl -i -pe "s/\@version\@/8.79/g" alien.spec Installing /usr/local/lib/perl5/site_perl/5.10.0/Alien/Package.pm Installing /usr/local/lib/perl5/site_perl/5.10.0/Alien/Package/Deb.pm Installing /usr/local/lib/perl5/site_perl/5.10.0/Alien/Package/Lsb.pm Installing /usr/local/lib/perl5/site_perl/5.10.0/Alien/Package/Pkg.pm Installing /usr/local/lib/perl5/site_perl/5.10.0/Alien/Package/Rpm.pm Installing /usr/local/lib/perl5/site_perl/5.10.0/Alien/Package/Slp.pm Installing /usr/local/lib/perl5/site_perl/5.10.0/Alien/Package/Tgz.pm Installing /usr/local/share/man/man1/alien.1 Installing /usr/local/share/man/man3/Alien::Package.3pm Installing /usr/local/share/man/man3/Alien::Package::Deb.3pm Installing /usr/local/share/man/man3/Alien::Package::Lsb.3pm Installing /usr/local/share/man/man3/Alien::Package::Pkg.3pm Installing /usr/local/share/man/man3/Alien::Package::Rpm.3pm Installing /usr/local/share/man/man3/Alien::Package::Slp.3pm Installing /usr/local/share/man/man3/Alien::Package::Tgz.3pm Installing /usr/local/bin/alien Writing /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi/auto/Alien/.packlist install -d /usr/local/share/alien/patches \ /var/lib/alien Appending installation info to /usr/lib/perl5/5.10.0/i386-linux-thread-multi/perllocal.pod [root@yun alien]#
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值