个人工具

“UbuntuHelp:SwitchingToUbuntu/FromLinux/RedHatEnterpriseLinuxAndFedora”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(New page: {{From|https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux/RedHatEnterpriseLinuxAndFedora}} {{Languages|php5}} == Switching to Ubuntu From Red Hat Enterprise Linux or Fedora == ...)
 
第21行: 第21行:
 
Note that unlike yum, apt-get is only for packages available in repositories - it cannot handle packages you've already downloaded. dpkg is used instead.
 
Note that unlike yum, apt-get is only for packages available in repositories - it cannot handle packages you've already downloaded. dpkg is used instead.
  
||Task||Using RHEL or Fedora||Using Ubuntu||
+
{|
||Refresh list of available packages||Yum refreshes each time it's used||apt-get update||
+
|Task||Using RHEL or Fedora||Using Ubuntu
||Fetch and install a package (and any dependencies)||yum install package||apt-get install package||
+
|-
||Get information about an available package||yum search package||apt-cache show package ||
+
|Refresh list of available packages||Yum refreshes each time it's used||apt-get update
||Show available packages||yum list available||apt-cache dumpavail ||
+
|-
||List all installed packages||yum list installed <br> rpm -qa||dpkg --list ||
+
|Fetch and install a package (and any dependencies)||yum install package||apt-get install package
||Get information about an installed package||yum info packagename <br> rpm -qi packagename||dpkg --status packagename||
+
|-
||List files in an installed package||rpm -ql pkgname||dpkg --listfiles pkgname ||
+
|Get information about an available package||yum search package||apt-cache show package  
||List documentation files in an installed package ||rpm -qd pkgname|| ? ||
+
|-
||List configuration files in an installed package ||rpm -qc pkgname|| ? ||
+
|Show available packages||yum list available||apt-cache dumpavail  
||Get information about a package file||rpm -qpi package.rpm||dpkg --info package.deb||
+
|-
||List files in a package file||rpm -qpl package.rpm||dpkg --contents package.deb ||
+
|List all installed packages||yum list installed <br> rpm -qa||dpkg --list  
||List documentation files in a package file||rpm -qpd package.rpm||? ||
+
|-
||List configuration files in a package file||rpm -qpc package.rpm||? ||
+
|Get information about an installed package||yum info packagename <br> rpm -qi packagename||dpkg --status packagename
||Extract files in a package||rpm2cpio package.rpm |cpio -vid||dpkg-deb --extract package.deb dir-to-extract-to ||
+
|-
||Install a package file||yum install package.rpm <br> rpm -i package.rpm||dpkg --install package.deb ||
+
|List files in an installed package||rpm -ql pkgname||dpkg --listfiles pkgname  
||Remove a package||rpm -e pkgname||apt-get remove pkgname ||
+
|-
||Find package that installed a file||rpm -qf filename ||dpkg --search filename||
+
|List documentation files in an installed package ||rpm -qd pkgname|| ?  
||Find package that provides a particular file||yum provides filename||apt-file search filename||
+
|-
 +
|List configuration files in an installed package ||rpm -qc pkgname|| ?  
 +
|-
 +
|Get information about a package file||rpm -qpi package.rpm||dpkg --info package.deb
 +
|-
 +
|List files in a package file||rpm -qpl package.rpm||dpkg --contents package.deb  
 +
|-
 +
|List documentation files in a package file||rpm -qpd package.rpm||?  
 +
|-
 +
|List configuration files in a package file||rpm -qpc package.rpm||?  
 +
|-
 +
|Extract files in a package||rpm2cpio package.rpm |cpio -vid||dpkg-deb --extract package.deb dir-to-extract-to  
 +
|-
 +
|Install a package file||yum install package.rpm <br> rpm -i package.rpm||dpkg --install package.deb  
 +
|-
 +
|Remove a package||rpm -e pkgname||apt-get remove pkgname  
 +
|-
 +
|Find package that installed a file||rpm -qf filename ||dpkg --search filename
 +
|-
 +
|Find package that provides a particular file||yum provides filename||apt-file search filename
 +
|}
  
 
More technical information about Debian style packaging can be found at http://www.debian.org/doc/FAQ/ch-pkg_basics.en.html and http://www.debian.org/doc/manuals/maint-guide/index.en.html
 
More technical information about Debian style packaging can be found at http://www.debian.org/doc/FAQ/ch-pkg_basics.en.html and http://www.debian.org/doc/manuals/maint-guide/index.en.html
第50行: 第70行:
 
==== Command Line Tools ====
 
==== Command Line Tools ====
  
||Task||Red Hat Enterprise / Fedora example (with Apache HTTPd)||Ubuntu example||
+
{|
||Starting/stopping services immediately||service httpd start||/etc/init.d/apache start '''or''' service apache start (from sysvconfig package) '''or''' use sysv-rc-conf||
+
|Task||Red Hat Enterprise / Fedora example (with Apache HTTPd)||Ubuntu example
||Enabling a service at boot||chkconfig httpd on||sysv-rc-conf apache on '''or''' update-rc.d apache defaults||
+
|-
||Disabling a service at boot||chkconfig httpd off||sysv-rc-conf apache off '''or''' update-rc.d apache purge||
+
|Starting/stopping services immediately||service httpd start||/etc/init.d/apache start '''or''' service apache start (from sysvconfig package) '''or''' use sysv-rc-conf
 +
|-
 +
|Enabling a service at boot||chkconfig httpd on||sysv-rc-conf apache on '''or''' update-rc.d apache defaults
 +
|-
 +
|Disabling a service at boot||chkconfig httpd off||sysv-rc-conf apache off '''or''' update-rc.d apache purge
 +
|}
  
 
Note: whereas Red Hat and Fedora's servers boot into runlevel 3 by default, Ubuntu servers default to runlevel 2.
 
Note: whereas Red Hat and Fedora's servers boot into runlevel 3 by default, Ubuntu servers default to runlevel 2.
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年5月14日 (一) 00:32的版本

Switching to Ubuntu From Red Hat Enterprise Linux or Fedora

It's easy to apply your existing knowledge of Red Hat Enterprise Linux or Fedora to Ubuntu. The key differences between them are covered in this guide.

Administrative Tasks

In Red Hat Enterprise Linux and Fedora by default, each administrative user needs to know the root password, in addition to their own password.

In Ubuntu, each user only has one password. Users in the admin group can run command line and graphical applications with elevated privileges. Graphical admin tools prompt for this password when run, and command line tools can be run with root-privileges using [RootSudo sudo].

Packaging

Ubuntu has more than three times as many packages available as Fedora (reference), so you'll have more chance of finding what you want in the repositories. Graphical apps will put a link into Ubuntu's Applications menu.

Graphical Tools

You'll find Synaptic to be an excellent tool for finding, fetching and installing packages.

Command Line Tools

Ubuntu uses apt-get instead of yum / up2date / urpmi etc. to find, download, and install packages (and their dependencies).

Note that unlike yum, apt-get is only for packages available in repositories - it cannot handle packages you've already downloaded. dpkg is used instead.

Task Using RHEL or Fedora Using Ubuntu
Refresh list of available packages Yum refreshes each time it's used apt-get update
Fetch and install a package (and any dependencies) yum install package apt-get install package
Get information about an available package yum search package apt-cache show package
Show available packages yum list available apt-cache dumpavail
List all installed packages yum list installed
rpm -qa
dpkg --list
Get information about an installed package yum info packagename
rpm -qi packagename
dpkg --status packagename
List files in an installed package rpm -ql pkgname dpkg --listfiles pkgname
List documentation files in an installed package rpm -qd pkgname  ?
List configuration files in an installed package rpm -qc pkgname  ?
Get information about a package file rpm -qpi package.rpm dpkg --info package.deb
List files in a package file rpm -qpl package.rpm dpkg --contents package.deb
List documentation files in a package file rpm -qpd package.rpm ?
List configuration files in a package file rpm -qpc package.rpm ?
Extract files in a package cpio -vid dpkg-deb --extract package.deb dir-to-extract-to
Install a package file yum install package.rpm
rpm -i package.rpm
dpkg --install package.deb
Remove a package rpm -e pkgname apt-get remove pkgname
Find package that installed a file rpm -qf filename dpkg --search filename
Find package that provides a particular file yum provides filename apt-file search filename

More technical information about Debian style packaging can be found at http://www.debian.org/doc/FAQ/ch-pkg_basics.en.html and http://www.debian.org/doc/manuals/maint-guide/index.en.html

Services

Graphical Tools

Services can be configured by clicking System -> Administration -> Services

There's also Boot-Up Manager.

Command Line Tools

Task Red Hat Enterprise / Fedora example (with Apache HTTPd) Ubuntu example
Starting/stopping services immediately service httpd start /etc/init.d/apache start or service apache start (from sysvconfig package) or use sysv-rc-conf
Enabling a service at boot chkconfig httpd on sysv-rc-conf apache on or update-rc.d apache defaults
Disabling a service at boot chkconfig httpd off sysv-rc-conf apache off or update-rc.d apache purge

Note: whereas Red Hat and Fedora's servers boot into runlevel 3 by default, Ubuntu servers default to runlevel 2.