Chinaunix首页 | 论坛 | 博客
  • 博客访问: 266086
  • 博文数量: 83
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 868
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-10 20:53
个人简介

静是从容,淡是境界

文章分类

全部博文(83)

分类: LINUX

2007-04-08 10:52:00


Welcome!  I'm glad to see you've made it this far! :^)

Here are a few hints to help you navigate through the Linux operating
system a little bit better.

Tools to help configure your system:

   pkgtool:   Remember those screens you saw while each package was
installing?  You can see all that information (and more) again.  The
simplest way is to use the 'pkgtool' utility to view the package
contents.  Another way is to use 'less' or a text editor to read the
files in /var/log/packages and /var/log/scripts (this is the method I
use).  The pkgtool script serves as a frontend to the command line
package tools, so it's a menu based program that will enable you to
remove, install, or view packages that are currently installed on the
system.  pkgtool will also allow you to re-run some of the system admin
scripts that you may have seen during the installation process.

译:pkgtool用来查看已经安装的软件包的信息,另一个方法是查看/var/log/packages和/varlog/scripts文件(这是作者自己的方法),pkgtool是一个图形前端脚本,用来删除、安装和查看软件包。

   Slackware's command line package tools:  I use these utilities most
of the time when I have packages to install, remove, or upgrade.  These
are the tools:

        installpkg  --  Installs packages
        removepkg   --  Removes installed packages
        upgradepkg  --  Upgrades or downgrades installed packages
        makepkg     --  Used to create your own Slackware Package
        explodepkg  --  Will extract the files from the package without
                        running any install scripts.
译:slackware的命令行包工具:
      installpkg  安装包
      removepkg 删除包
      upgradepkg 更新包
      makepkg   制作tgz包
      explodepkg  解压包但不运行包内的安装脚本


   slackpkg:  For those more used to automated package management tools
you might like to try slackpkg (my favorite due to its simple,
straightforward approach to keeping a machine up to date).  Slackpkg
can be found in the extra directory.  A quick search of the web will
turn up more tools as well.  You should approach these cautiously, as
Slackware is designed around the idea that the system should be a
complete installation kept updated with any official patches.  This
avoids the mess of dependencies that some other Linux based GNU systems
face.  However, many (if not most) of these tools won't know what to do
about .new config files, or how to handle upgrading a package that has
changed to a new name.  Some also think that any package with a larger
build number is "better", when there have been many instances that a
new upstream release wasn't working properly and we had to roll back to
an earlier one, and an automated upgrade tool didn't want to
"downgrade" the package.  This is something upgradepkg will gladly do,
as it doesn't (as it should not) take the package's version number to
mean much of anything.  Regarding automatic upgrades, there have also
been cases where a library upgrade caused unwanted side effects in
programs that link with it.  In theory, most libraries used on the
system try to retain backwards compatibility, but in practice this
isn't always the case.  While any issued patches should be installed to
keep your system secure, always remember the old adage "don't fix it if
it ain't broke" when considering other upgrades and additions,
especially if they come from unofficial sources.  Again, there's a lot
of good stuff out there, but there's also some that's not so good.  
It's always a good idea to look packages over before you install them.  
This is as simple as using 'less' to view the contents so you can see
if they overwrite anything, and maybe using 'tar' or 'explodepkg' to
extract the archive into a temporary directory to take a closer look.

译:slackpkg是一个自动化的包管理工具,它使用简单,可以让包维持到最新状态。可以在安装盘的extra目录里找到它。

   netconfig:  netconfig is a menu based program that will help to
configure your network. You will be asked several questions and given
an opportunity to review your your settings before the changes are
committed. 

译:netconfig是基于菜单的网络设置工具。

   pppsetup:  pppsetup is a menu based program that will help you to
connect to your ISP via a PPP connection.  As with netconfig you are
asked a series of questions and given a chance to review your settings.
 KDE also includes a utility for configuring PPP dialup connections.  
This is found in KDE's Internet menu (kppp).

译:pppsetup是基于菜单的PPP连接工具。

   xwmconfig:  If you have installed the X window system, you can use
xwmconfig to choose your default window manager.  Running this as root
will set the system default while running it as a normal user will only
set the window manager for that user.

译:xwmconfig用来选择缺省的窗口管理器,root用户可以设置系统缺省的窗口管理器,普通用户可以设置自己缺省的管理器。

   liloconfig:  If you are using the Lilo boot loader to start your
system you can use liloconfig to setup and install Lilo to the boot
drive.  There's a simple installation which tries to automatically set
up LILO to boot Linux (also Windows if found).  For more advanced
users, the expert option offers more control over the installation
process.  If you have a lot of partitions, the selection menu in
'expert' mode may overflow.  You'll likely then want to go to another
console and find the partition you
want with 'fdisk -l | less', and then go back and enter it (proving
that you are, indeed, an expert).

   You may need to make some changes to the /etc/rc.d/rc.serial script
if you're using serial ports other than /dev/ttyS0 or /dev/ttyS1 (com1:
and com2: under DOS), or if these ports use non-standard IRQs.

I suggest using the section about halfway through that lets you set up
the ports manually.  Here's an example of how I set up the ports on my
machine for /dev/ttyS0 and /dev/ttyS2:

# These are the standard COM1 through COM4 devices
#
${SETSERIAL} /dev/ttyS0 uart 16450 port 0x3F8 irq 4
# ${SETSERIAL} /dev/ttyS1 uart 16450 port 0x2F8 irq 3
${SETSERIAL} /dev/ttyS2 uart 16450 port 0x3E8 irq 5
# ${SETSERIAL} /dev/ttyS3 uart 16450 port 0x2E8 irq 3

You'll also need to make rc.serial executable (chmod 755 rc.serial)
before rc.S will start it.


Other configuration files:

   The majority of system configuration files can be found in and below
the /etc directory.  Most system configuration is done by editing these
files with a text editor such as 'vi' or 'joe'.  If you're not sure
which files you need to edit to configure a given package, use 'less'
or 'pkgtool' to see what files are installed by the package paying
special attention to any files placed in /etc or that end with the
suffix .new (these are usually moved into place if there's not already
a configuration file with the same name).  After upgrading a package,
if a .new config file is put in place you'll have to decide whether to
delete the .new, move it over the existing config file (losing any
custom configuration information in the old file), or make a backup
copy of your old config file, move the .new one into place, and merge
any required changes into the new config file with a text editor.

译:/etc目录下存放着各种配置文件,注意保存配置备份。

Hardware, network, and kernel issues:

   If you've got hardware such as a CD-ROM drive or Ethernet card that
doesn't seem to work with Linux, it's possible that the kernel you're
using doesn't contain the needed support.  In that case, you can do one
of two things:

  1.  Load the support with kernel modules.  This is probably the
      simplest way to handle the situation.  Just edit
      /etc/rc.d/rc.modules so that it loads the modules you need.
  2.  Recompile your kernel, including the needed driver(s).

译: 硬件、网络和核心问题:
       如果你有新硬件,比如光驱、以太网卡在linux下不能工作,可能是因为得不到核心的支持,这种情况你可以做以下两件事:
       1、加载模块到核心,这是最简单的办法,即编辑/etc/rc.d/rc.modules文件加入需要的模块。
       2、重新编译核心,以加入需要的驱动。

  If you're on a standalone LAN without a nameserver, make sure you
don't have a nameserver line in /etc/resolv.conf, or you may experience
delays with many network commands as they attempt to query the bogus
nameserver.  Most people these days will have a nameserver, or be able
to access one via their router/gateway.  Most DHCP servers will tell
dhcpcd what it needs to know in order to set up your /etc/resolv.conf
automatically.

   Want to run NFS?  You'll need to install the portmap and nfs-utils
packages.  Then, edit your /etc/exports to allow NFS access. (see 'man
exports' for examples)  Once you've set up /etc/exports, the NFS
daemons should run automatically at boot.

 译: 要运行NFS? 你需要安装portmap和nfs-utils包,然后编辑/etc/exports文件加入NFS共享(在man中有示例),一旦你设置好了/etc/exports文件,NFS守护进程在启动时会自动运行。

   After inserting a digital media card, or plugging in a new USB or
IEEE1394 (Firewire) device, you may need to run the following command
before it becomes available as a mountable device:

  rescan-scsi-bus -l

译:在插入数字媒体卡或新的USB设备、IEEE1394(火线)设备,你在挂载这个设备前可能需要运行下面的命令:
      rescan-scsi-bus -l

      推荐使用2.6.x内核,并安装udev包

This command scans the LUNs (or Logical Unit Numbers) of all the SCSI
devices attached to the system, including USB and other devices that
look SCSI to the kernel.

   Do you have an IDE based CD-RW drive, run one of the 2.4.x kernels
and plan to burn CDs?  (the same applies to DVDs)  If so, you'll need
to use the SCSI emulation kernel module, which will allow your drive to
look like a SCSI CD burner to cdrdao, cdrecord, and other Linux CD
burning applications.  The 2.6.x kernel uses a new method for accessing
IDE/ATAPI devices directly and does not need ide-scsi.
   The ide-scsi module is loaded by default for Linux 2.4, but you'll
also need to pass an option to the kernel telling it to use SCSI
emulation for a specific device, otherwise the ATAPI driver will be
used.  Let's say your CD-RW drive is /dev/hdc, then you'd want to pass
the "hdc=ide-scsi" option to the kernel.  You can do this with an
append command in /etc/lilo.conf:
   append="hdc=ide-scsi"
After editing lilo.conf, you must run lilo to reinstall it.  You can
also pass the hdc=ide-scsi option on a bootdisk command line.  Once you
do this, your CD-RW device will appear as a SCSI device (/dev/sr0)
rather than an IDE device (/dev/hdc).  If this is the only CD-ROM type
device in the machine (there's no DVD drive, for instance), then you'll
probably also want to change your /dev/cdrom symbolic link to point to
the new SCSI device instead of the old IDE device:
  cd /dev
  rm cdrom
  ln -sf sr0 cdrom
Again, for 2.6.x kernels running with udev, all of this should be
handled automatically.


Printing on Slackware:

The choice is between CUPS and LPRng.  CUPS is installed by default,
and in my opinion is the way to go.  They are both viable printing
systems, but CUPS is more actively developed and has more features.

CUPS (highly recommended)

Slackware prints using ESPgs and CUPS (the Common UNIX Printing
System).  To set up CUPS, make sure that /etc/rc.d/rc.cups is
executable so that CUPS will start at boot.  Then connect to the CUPS
configuration port using a web browser at this URL:

 

译: 在Slackware中打印,有两种选择:CUPS和LPRng,CUPS是缺省安装的且我也支持它,两种打印体系中,CUPS开发更为活跃,特性也更多。
       确保/etc/rc.d/rc.cups在启动时运行了,然后在浏览器中输入:
      
       更多内容可以查看/usr/doc/cups。如果设置HP打印机,则要删除hpijs包,用安装盘testing目录中的hplip来替代它。 如果设备支持扫描和传真,在安装了hplip包的前提下,可以在KDE中来设置它。

See the extensive docs in /usr/doc/cups for more details.  Also, it
may be possible to configure CUPS using the setup tools included with
KDE.]  If you use an HP printer, you can also remove the hpijs package
and replace it with the hplip package from /testing.  If your device
supports scanning or faxing, those features should be enabled for most
models, too.  If you don't see your exact model, often one that's
"close" will do the trick.  In KDE, the HP configuration tool is found
under the Utilities menu (when HPLIP is installed).  


LPRng

It is still possible to run LPRng, which is based on the old BSD print
spooling system.  While most systems run CUPS now, there could be some
good reason that some people would still prefer to run things the old
fashioned way.  I run CUPS and find it to be a good, reliable printing
system.  But, if you really want to use LPRng instead, the steps are:

1.  If you have a parallel port connected printer, you must make sure
    you're loading the parallel driver in /etc/rc.d/rc.modules.
    You'll have to uncomment two sections of script to load the parallel
    port driver, and another to load line printer support.
2.  Install the LPD printer software.  This is the lprng package on the
    in the /pasture (where old packages go to "stabilize" ;-).
3.  You'll probably want to have the TCP/IP subsystem installed and
    configured (at least for loopback).  The "tcpip" package is part of
    the N series, and the "netconfig" script is used to do a basic
    TCP/IP configuration.
4.  Apsfilter uses a variety of other filters that it expects to find
    installed.  You'll want to install the "espgs" (Ghostscript) and
    "gnu-gs-fonts" packages on the AP series to add Ghostscript if you
    want the ability to print PostScript documents.  If you want to
    print DVI files, install at least the default teTeX packages from
    the T series.
5.  Install the apsfilter package.  This package is part of the
    /pasture collection along with lprng.  Find the package and
    install it:

      installpkg apsfilter-*.tgz

6.  Change into the /usr/share/apsfilter/ directory, and run the SETUP
    program:

      ./SETUP

    It'll write your /etc/printcap, and you'll be all set to start
    printing.  Once you've got it working, you can also use netatalk and
    Samba to provide print services to Macs and Windows machines on the
    local network with your Linux box.


Mouse support:

   Only very ancient mice will need any special treatment in order to
get basic support, and with GPM cut and paste on the console.  Most
will work with the "ps2" or "imps2" protocols.  If you should happen to
have one of the ancient mice that is not a serial, PS/2, or USB mouse
then you'll probably have to load a kernel module in order to get it to
work.  At this point in time, a busmouse is rare.  These days, most
mice are PS/2 (with a 6 pin round plug) or USB, or occasionally serial
(with a 9 pin trapezoidal plug).  These kinds of mice don't require any
special setup as the system should detect and activate them
automatically.  If you think your mouse might need a special driver (if
it's not working), read the comments in /etc/rc.d/rc.modules to see
which one is needed, and edit the file to load it at boot time.  It's
also possible that the /dev/mouse link may need to be changed to point
to the proper mouse device.  Or, compile a new kernel with built in
support for your mouse and install that.


Network support:

   Of course, you're going to want to get your machine online.  If you
have a router supporting DHCP you're probably already on by now.  
Otherwise, 'netconfig' will give you a simple network connection.  To
get your machine on the net with a modem and PPP, you need to install
the "tcpip" and "ppp" packages.  Your machine should be configured at
least with loopback using the "netconfig" utility.  Also, be sure the
serial port your modem uses is correctly configured.  If in doubt, take
a look through /etc/rc.d/rc.serial.  Then, use 'pppsetup' to configure
the dialup process.  Additional documentation on pppsetup can be found
in /usr/doc/pppsetup-*/.  DSL/Cable users who need to use PPPoE (PPP
over Ethernet) should see the docs in /usr/doc/rp-pppoe-3.8/.

If you need to set up your Linux machine as a router for other systems,
you'll want to set up the interfaces in /etc/rc.d/rc.inet1.conf, and
set up NAT support with something like this in /etc/rc.d/rc.firewall,
and then make rc.firewall executable.

# Delete and flush.  Default table is "filter".
# Others like "nat" must be explicitly stated.
iptables --flush
# Flush all the rules in filter and nat tables
iptables --table nat --flush
# Delete all chains that are not in default filter and nat table
iptables --delete-chain
iptables --table nat --delete-chain
# Set up IP FORWARDing and Masquerading
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo "Enabling ip_forwarding..."
echo 1 > /proc/sys/net/ipv4/ip_forward

It's possible to expand (or reduce ;-) this script for just about any
firewall needed.  See "man iptables" for lots of information.


F: FAQ series, and the HOWTO documentation collection:

   If you installed the F series, you find detailed documentation on
many common Linux tasks in /usr/doc/Linux-HOWTOs.  Each of these
instructional files covers a particular Linux task.  They cover most
system administration tasks in a lot more detail than this little email
does.

There is also a collection of Linux related FAQs (lists of Frequently
Asked Questions with answers) /usr/doc/Linux-FAQs.

Please see the RELEASE_NOTES and other files included with the
distribution for any last-minute changes.


Have fun!

---
Patrick Volkerding
volkerdi@slackware.com

阅读(872) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~