Ubuntu系统中安装RPM格式包的方法

Ubuntu的软件包格式为deb,而RPM格式的包则是Red Hat 相关系统所用的软件包。当我们看到一个想用的软件包时,如果他是RPM格式,而你的操作系统是Ubuntu,那岂不是很遗憾?其实,在Ubuntu系统中通过一定的方法也是可以很有效的安装RPM格式包的,本文就针对此加以介绍:

首先,我们要安装alien这一软件:

  • $sudo apt-get install alien ##alien默认没有安装,所以首先要安装它

  • $sudo alien xxxx.rpm  ##将rpm转换为deb,完成后会生成一个xxxx.deb

  • $sudo dpkg -i xxxx.deb ##这样xxxx软件就可以安装完成了

注意,用alien转换deb包并不能保证完全顺利安装,所以如果能找到deb包,还是用deb包为好。

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、付费专栏及课程。

余额充值