Copyright (C) 2004-2005 http://www.ubuntuguide.org
本程序为免费软件. 您可以在免费软件基金会的 GNU General Public License 条例的许可之下对此版本或后来版本随意修改和传播.
本程序的目的在于给大家带来方便, 但是我们不承担任何责任, 更不会承担买卖或者其他特殊目的责任. 具体详见 GNU General Public License .
Q: 哪里可以找到 Ubuntu 的所有程序/函数库的名单?
wget -c http://ubuntuguide.org/ubuntu5.04.tar.gz
tar zxvf ubuntu5.04.tar.gz
Q: 如何新增其他的软件库 (extra Repositories)?
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
sudo gedit /etc/apt/sources.list
...
## Uncomment the following two lines to fetch updated software from the network
# deb http://us.archive.ubuntu.com/ubuntu hoary main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu hoary main restricted
## Uncomment the following two lines to fetch major bug fix updates produced
## after the final release of the distribution.
# deb http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted
## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu Security
## team.
# deb http://us.archive.ubuntu.com/ubuntu hoary universe
# deb-src http://us.archive.ubuntu.com/ubuntu hoary universe
# deb http://security.ubuntu.com/ubuntu hoary-security main restricted
# deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted
# deb http://security.ubuntu.com/ubuntu hoary-security universe
# deb-src http://security.ubuntu.com/ubuntu hoary-security universe
## Uncomment the following two lines to fetch updated software from the network
deb http://us.archive.ubuntu.com/ubuntu hoary main restricted
deb-src http://us.archive.ubuntu.com/ubuntu hoary main restricted
## Uncomment the following two lines to fetch major bug fix updates produced
## after the final release of the distribution.
deb http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted
## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu Security
## team.
deb http://us.archive.ubuntu.com/ubuntu hoary universe
deb-src http://us.archive.ubuntu.com/ubuntu hoary universe
deb http://security.ubuntu.com/ubuntu hoary-security main restricted
deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted
deb http://security.ubuntu.com/ubuntu hoary-security universe
deb-src http://security.ubuntu.com/ubuntu hoary-security universe
deb http://archive.ubuntu.com/ubuntu hoary multiverse
deb-src http://archive.ubuntu.com/ubuntu hoary multiverse
## Backports
deb http://ubuntu-backports.mirrormax.net/ hoary-backports main universe multiverse restricted
deb http://ubuntu-backports.mirrormax.net/ hoary-extras main universe multiverse restricted
sudo gedit /etc/apt/preferences
Package: *
Pin: release a=testing
Pin-Priority: 1
gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 1F41B907
gpg --armor --export 1F41B907 | sudo apt-key add -
sudo apt-get update
Q: 如何备份/恢复已经下载的软件库 (Repositories) 的 cache?
sudo tar zcvf apt.tgz /etc/apt/ /var/lib/apt/ /var/cache/apt/
sudo tar zxvf apt.tgz -C /
sudo apt-get update
sudo apt-get upgrade
wget -c http://frankandjacq.com/ubuntuguide/smeg_0.5-0ubuntu1_all.deb
sudo dpkg -i smeg_0.5-0ubuntu1_all.deb
wget -c http://frankandjacq.com/ubuntuguide/gnome-clipboard-daemon-1.0.bin.tar.bz2
sudo tar jxvf gnome-clipboard-daemon-1.0.bin.tar.bz2 -C /usr/bin/
sudo chown root:root /usr/bin/gnome-clipboard-daemon
sudo chmod 755 /usr/bin/gnome-clipboard-daemon
sudo gnome-clipboard-daemon &
Startup Programs 分页 -> Add
Startup Command: gnome-clipboard-daemon
Order: 80
Q: 如何安装 J2SE Runtime Environment (JRE) 和 Mozilla FireFox 使用的插件?
sudo apt-get install sun-j2re1.5
java -version
Q: 如何安装 Mozilla FireFox 的 Flash Player (Macromedia Flash) 插件?
sudo apt-get install flashplayer-mozilla
Q: 如何安装 PDF 阅读程序 (Adobe Reader) 和 Mozilla FireFox 使用的插件?
sudo apt-get install acroread
sudo apt-get install mozilla-acroread
sudo apt-get install d4x
sudo apt-get install gftp
Q: 如何安装 P2P BitTorrent 客户端程序 (Azureus)?
sudo apt-get install azureus
Q: 如何安装 P2P eMule 客户端程序 (aMule)?
sudo apt-get install amule
Q: 如何安装 P2P Gnutella 客户端程序 (LimeWire)?
wget -c http://frankandjacq.com/ubuntuguide/LimeWireSoftOther.zip
sudo unzip -u LimeWireSoftOther.zip -d /opt/
sudo chown -R root:root /opt/LimeWire/
sudo gedit /usr/bin/runLime.sh
cd /opt/LimeWire/
./runLime.sh
sudo chmod +x /usr/bin/runLime.sh
sudo gedit /usr/share/applications/LimeWire.desktop
[Desktop Entry]
Name=LimeWire
Comment=LimeWire
Exec=runLime.sh
Icon=/opt/LimeWire/LimeWire.ico
Terminal=false
Type=Application
Categories=Application;Network;
sudo apt-get install libqt3c102-mt
wget -c http://frankandjacq.com/ubuntuguide/skype_1.1.0.13-1_i386.deb
sudo dpkg -i skype_1.1.0.13-1_i386.deb
sudo apt-get install linpopup
sudo gedit /usr/share/applications/linpopup.desktop
[Desktop Entry]
Name=LinPopUp
Comment=LinPopUp
Exec=linpopup
Icon=/usr/share/pixmaps/linpopup.xpm
Terminal=false
Type=Application
Categories=Application;Utility;
sudo apt-get install w32codecs
sudo apt-get install gstreamer0.8-plugins
sudo apt-get install gstreamer0.8-lame
sudo apt-get install lame
sudo apt-get install sox
sudo apt-get install ffmpeg
sudo apt-get install mjpegtools
sudo apt-get install vorbis-tools
gst-register-0.8
sudo apt-get install libdvdcss2
sudo apt-get install xine-ui
Q: 如何安装多媒体播放器 (MPlayer) 和 Mozilla FireFox 使用的插件?
sudo apt-get install mplayer-386
sudo apt-get install mplayer-fonts
sudo apt-get install mozilla-mplayer
sudo cp /etc/mplayer/mplayer.conf /etc/mplayer/mplayer.conf_backup
sudo gedit /etc/mplayer/mplayer.conf
...
vo=x11, # To specify default video driver (see -vo help for
...
vo=xv, # To specify default video driver (see -vo help for
sudo apt-get install xmms
wget -c http://frankandjacq.com/ubuntuguide/xmms-wma_1.0.4-2_i386.deb
sudo dpkg -i xmms-wma_1.0.4-2_i386.deb
sudo apt-get install realplayer
Q: 如何安装 Stream Directory Browser (streamtuner)?
sudo apt-get install streamtuner
Q: 如何安装 ID3 Tag 编辑器 (EasyTAG)?
sudo apt-get install easytag
sudo apt-get install kino
sudo apt-get install audacity
Q: 如何安装 DVD Ripper (dvd::rip)?
sudo apt-get install dvdrip
sudo gedit /usr/share/applications/dvdrip.desktop
[Desktop Entry]
Name=dvd::rip
Comment=dvd::rip
Exec=dvdrip
Icon=/usr/share/perl5/Video/DVDRip/icon.xpm
Terminal=false
Type=Application
Categories=Application;AudioVideo;
sudo apt-get install goobox
sudo rm -f /usr/share/applications/goobox.desktop
sudo gedit /usr/share/applications/goobox.desktop
[Desktop Entry]
Name=CD Player & Ripper
Comment=Play and extract CDs
Exec=goobox
Icon=goobox.png
Terminal=false
Type=Application
Categories=Application;AudioVideo;
Q: 如何安装 Email 客户端程序 (Mozilla Thunderbird)?
sudo apt-get install mozilla-thunderbird
sudo apt-get install pan
Q: 如何安装 RSS/RDF/Atom Newsreader (RSSOwl)?
wget -c http://frankandjacq.com/ubuntuguide/rssowl_linux_1_1_1_bin.tar.gz
sudo tar zxvf rssowl_linux_1_1_1_bin.tar.gz -C /opt/
sudo chown -R root:root /opt/rssowl_linux_1_1_1_bin/
sudo gedit /usr/bin/runRSSOwl.sh
export MOZILLA_FIVE_HOME=/usr/lib/mozilla-firefox
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH}
cd /opt/rssowl_linux_1_1_1_bin/
./run.sh
sudo chmod +x /usr/bin/runRSSOwl.sh
sudo gedit /usr/share/applications/RSSOwl.desktop
[Desktop Entry]
Name=RSSOwl
Comment=RSSOwl
Exec=runRSSOwl.sh
Icon=/opt/rssowl_linux_1_1_1_bin/rssowl.xpm
Terminal=false
Type=Application
Categories=Application;Network;
sudo apt-get install nvu
sudo apt-get install planner
sudo apt-get install gnucash
sudo rm -fr /usr/share/gnome/apps/Applications/
sudo gedit /usr/share/applications/GnuCash.desktop
[Desktop Entry]
Name=GnuCash
Comment=GnuCash Personal Finance
Exec=gnucash
Icon=/usr/share/pixmaps/gnucash/gnucash-icon.png
Terminal=false
Type=Application
Categories=Application;Office;
Q: 如何安装桌面排版系统 (Desktop Publishing) 应用程序 (Scribus)?
sudo apt-get install scribus
sudo apt-get install dia-gnome
Q: 如何安装 CD/DVD 刻录软件 (GnomeBaker)?
sudo apt-get install gnomebaker
Q: 如何安装 ADSL/PPPoE 拨接程序 (RP-PPPoE)?
wget -c http://frankandjacq.com/ubuntuguide/rp-pppoe-3.5.tar.gz
sudo tar zxvf rp-pppoe-3.5.tar.gz -C /opt/
sudo chown -R root:root /opt/rp-pppoe-3.5/
sudo gedit /usr/share/applications/RP-PPPoE.desktop
[Desktop Entry]
Name=RP-PPPoE
Comment=RP-PPPoE
Exec=gksudo /opt/rp-pppoe-3.5/go-gui
Icon=
Terminal=false
Type=Application
Categories=Application;System;
Q: 如何安装系统启动程序管理程序 Boot-Up Manager (UBM)?
wget -c http://frankandjacq.com/ubuntuguide/ubm_1.2.7_all.deb
sudo dpkg -i ubm_1.2.7_all.deb
sudo apt-get install gparted
sudo apt-get install firestarter
sudo apt-get install nessus
sudo apt-get install nessusd
sudo nessus-adduser
sudo ln -fs /etc/init.d/nessusd /etc/rc2.d/S20nessusd
sudo /etc/init.d/nessusd start
sudo gedit /usr/share/applications/Nessus.desktop
[Desktop Entry]
Name=Nessus
Comment=Nessus
Exec=nessus
Icon=
Terminal=false
Type=Application
Categories=Application;System;
sudo apt-get install rar
sudo ln -fs /usr/bin/rar /usr/bin/unrar
sudo apt-get install xfonts-intl-arabic
sudo apt-get install xfonts-intl-asian
sudo apt-get install xfonts-intl-chinese
sudo apt-get install xfonts-intl-chinese-big
sudo apt-get install xfonts-intl-european
sudo apt-get install xfonts-intl-japanese
sudo apt-get install xfonts-intl-japanese-big
sudo apt-get install xfonts-intl-phonetic
sudo apt-get install gsfonts-x11
sudo apt-get install msttcorefonts
sudo fc-cache -f -v
sudo apt-get install scim
sudo apt-get install scim-chinese
sudo apt-get install scim-config-socket
sudo apt-get install scim-gtk2-immodule
sudo apt-get install scim-tables-zh
wget -c http://frankandjacq.com/ubuntuguide/fireflysung-1.3.0.tar.gz
sudo tar zxvf fireflysung-1.3.0.tar.gz -C /usr/share/fonts/truetype/
sudo chown -R root:root /usr/share/fonts/truetype/fireflysung-1.3.0/
sudo fc-cache -f -v
按下 'Ctrl + Space'
Q: 如何安装桌面小程序 (Desktop Applets) (gDesklets)?
sudo apt-get install gdesklets
sudo apt-get install gdesklets-data
sudo apt-get install frozen-bubble
Q: 如何安装基本的编辑工具 (build-essential)?
sudo apt-get install build-essential
Q: 如何安装 Windows 9X/ME/2000/XP (Win4Lin)?
Q: 如何安装 Windows 的应用程序 (CrossOver Office)?
sudo passwd root
sudo passwd -l root
安全 分页 -> 选项 -> 允许 root 通过 GDM 登录(勾选)
sudo -s -H
Password: <在这注明您的密码>
用户 分页 -> 添加用户.../属性/删除
组 分页 -> 添加组.../属性/删除
通用 分页 -> 自动登录 ->
首次启动时自动登录一个用户 (勾选)
自动登录用户名: 选择 "系统_使用者名称"
export EDITOR=gedit && sudo visudo
system_username ALL=(ALL) ALL
Q: 如何使用 "sudo" 时不需要任何密码提示 (没有安全性)?
export EDITOR=gedit && sudo visudo
...
system_username ALL=(ALL) ALL
...
system_username ALL=(ALL) NOPASSWD: ALL
sudo -K
鼠标右按钮点击文件s/folders -> Properties
Permissions 分页 -> Read/Write/Execute (勾选 the permissions for Owner/Group/Others)
sudo chown system_username /location_of_files_or_folders
sudo chgrp system_groupname /location_of_files_or_folders
sudo apt-get install nvidia-glx
sudo apt-get install nvidia-settings
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
sudo nvidia-glx-config enable
sudo gedit /usr/share/applications/NVIDIA-Settings.desktop
[Desktop Entry]
Name=NVIDIA Settings
Comment=NVIDIA Settings
Exec=nvidia-settings
Icon=
Terminal=false
Type=Application
Categories=Application;System;
Q: 如何取消 GNOME 启动时显示的 NVIDIA 图形 LOGO?
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
sudo gedit /etc/X11/xorg.conf
...
Section "Device"
Identifier "NVIDIA Corporation NV11 [GeForce2 MX/MX 400]"
Driver "nvidia"
BusID "PCI:1:0:0"
...
Option "NoLogo"
wget -c http://frankandjacq.com/ubuntuguide/scanModem.gz
gunzip -c scanModem.gz > scanModem
chmod +x scanModem
sudo ./scanModem
gedit Modem/ModemData.txt
Q: 如何安装 Modem 的驱动程序 (SmartLink)?
uname -r (must be 2.6.10-5-386)
wget -c http://frankandjacq.com/ubuntuguide/sl-modem-modules-2.6.10-5-386_2.9.9a-1ubuntu2+2.6.10-34_i386.deb
sudo dpkg -i sl-modem-modules-*.deb
sudo apt-get install sl-modem-daemon
sudo gedit /etc/udev/rules.d/10-custom.rules
BUS="usb", SYSFS{product}="Palm Handheld*", KERNEL="ttyUSB*", NAME{ignore_remove}="pilot", MODE="666"
sudo fdisk -l
df -T -h
mount
lspci
lsusb
例如 假设 /dev/cdrom 是目前 CD/DVD-ROM 所在的位置
sudo hdparm -d1 /dev/cdrom
sudo cp /etc/hdparm.conf /etc/hdparm.conf_backup
sudo gedit /etc/hdparm.conf
/dev/cdrom {
dma = on
}
Q: 如何手动挂载/卸载 CD/DVD-ROM, 并显示所有隐藏的和相关的文件和目录?
例如 假设 /media/cdrom0/ 是目前 CD/DVD-ROM 所在的位置
sudo mount /media/cdrom0/ -o unhide
sudo umount /media/cdrom0/
例如 假设 /media/cdrom0/ 是目前 CD/DVD-ROM 所在的位置
sudo umount /media/cdrom0/ -l
sudo mount -a
例如 假设 CD/DVD-ROM 位置是 /dev/cdrom
sudo umount /dev/cdrom
cdrecord dev=/dev/cdrom blank=fast
nautilus burn:///
将 文件/目录 拖到窗口
文件 -> 写入碟片... -> 写入
在镜像 (ISO) 按鼠标右键 -> 写入碟片... -> 写入
例如 假设 CD/DVD-ROM 位置是 /dev/cdrom
sudo umount /dev/cdrom
dd if=/dev/cdrom of=file.iso bs=1024
mkisofs -o file.iso /location_of_folder/
md5sum file.iso > file.iso.md5
例如 假设 file.iso 和 file.iso.md5 是在相同目录下
md5sum -c file.iso.md5
sudo mkdir /media/iso
sudo modprobe loop
sudo mount file.iso /media/iso/ -t iso9660 -o loop
sudo umount /media/iso/
/ -> apps -> nautilus-cd-burner -> default_speed (set/change the burn speed)
Q: 如何启动 CD/DVD 刻录机的 burnproof?
/ -> apps -> nautilus-cd-burner -> burnproof (Checked)
/ -> apps -> nautilus-cd-burner -> overburn (Checked)
Connections 分页 -> 选择 "Ethernet connection" -> Activate/Deactivate
Connections 分页 -> 选择 "Ethernet connection" -> Properties
Connection -> This device is configured (勾选)
Connection Settings -> Configuration: 选择 "DHCP/Static IP address"
DNS 分页 -> DNS Servers -> Add/Delete
General 分页 -> Host Settings -> Hostname: 在此设定电脑名称
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
...
server string = %h server (Samba, Ubuntu)
...
server string = new_computer_descriptions
sudo testparm
sudo /etc/init.d/samba restart
Q: 如何更改电脑的 网域名称 (Domain)/群组名称 (Workgroup)?
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
...
workgroup = MSHOME
...
workgroup = new_domain_or_workgroup
sudo testparm
sudo /etc/init.d/samba restart
Q: 如何在使用 DynDNS 的服务和动态 IP 的情况下指定主机名称 (Hostname)?
例如 假设您的网络连接已经正确设定好
并在 https://www.dyndns.org 注册好动态的DNS
每小时自动向 DynDNS 的数据库/DNS 更新您的 IP 设定
* * * * * 分别代表 分 时 日 月 年
sudo apt-get install ipcheck
sudo gedit /root/dyndns_update.sh
USERNAME=myusername
PASSWORD=mypassword
HOSTNAME=myhostname.dyndns.org
cd /root/
if [ -f /root/ipcheck.dat ]; then
ipcheck -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME
else
ipcheck --makedat -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME
fi
sudo chmod 700 /root/dyndns_update.sh
sudo sh /root/dyndns_update.sh
export EDITOR=gedit && sudo crontab -e
00 * * * * sudo sh /root/dyndns_update.sh
用鼠标又按钮点选目录 -> Share folder
Shared folder -> Share with: 选择 "SMB"
Share properties -> Name: Specify the share name
例如 假设您的网络连接已经正确设定好
If computers or network folders could not be found, try access them directly
请参阅 如何不先挂载就读取网络共享目录?
例如 假设您的网络连接已经正确设定好
网络主机的 IP: 192.168.0.1
分享中的目录名称: linux
smb://192.168.0.1/linux
Q: 如何手动挂载/卸载网络共享目录, 并允许所有使用者都可读取 ?
例如 假设您的网络连接已经正确设定好
网络主机的 IP: 192.168.0.1
网络主机的使用者名称: myusername
网络主机的登录密码: mypassword
分享中的目录名称: linux
主机上要挂载的目录: /media/sharename
sudo mkdir /media/sharename
sudo mount //192.168.0.1/linux /media/sharename/ -o username=myusername,password=mypassword
sudo umount /media/sharename/
Q: 如何手动挂载/卸载网络共享目录, 并允许所有使用者都可读取和写入?
例如 假设您的网络连接已经正确设定好
网络主机的 IP: 192.168.0.1
网络主机的使用者名称: myusername
网络主机的登录密码: mypassword
分享中的目录名称: linux
主机上要挂载的目录: /media/sharename
sudo mkdir /media/sharename
sudo mount //192.168.0.1/linux /media/sharename/ -o username=myusername,password=mypassword,dmask=777,fmask=777
sudo umount /media/sharename/
Q: 如何在系统启动时, 自动挂载网络共享目录, 并允许所有使用者都可读取 ?
例如 假设您的网络连接已经正确设定好
网络主机的 IP: 192.168.0.1
网络主机的使用者名称: myusername
网络主机的登录密码: mypassword
分享中的目录名称: linux
主机上要挂载的目录: /media/sharename
sudo mkdir /media/sharename
sudo gedit /root/.smbcredentials
username=myusername
password=mypassword
sudo cp /etc/fstab /etc/fstab_backup
sudo gedit /etc/fstab
//192.168.0.1/linux /media/sharename smbfs credentials=/root/.smbcredentials 0 0
Q: 如何在系统启动时, 自动挂载网络共享目录, 并允许所有使用者都可读取和写入?
例如 假设您的网络连接已经正确设定好
网络主机的 IP: 192.168.0.1
网络主机的使用者名称: myusername
网络主机的登录密码: mypassword
分享中的目录名称: linux
主机上要挂载的目录: /media/sharename
sudo mkdir /media/sharename
sudo gedit /root/.smbcredentials
username=myusername
password=mypassword
sudo cp /etc/fstab /etc/fstab_backup
sudo gedit /etc/fstab
//192.168.0.1/linux /media/sharename smbfs credentials=/root/.smbcredentials,dmask=777,fmask=777 0 0
Warning! Remote Desktop will only work if there's a GNOME login session
Leaving computer with an unattended GNOME login session is not secure
Use (System -> Lock Screen) and off the monitor when computer is left unattended
共享 ->
允许其他人查看您的桌面 (Checked)
允许其他用户控制您的桌面 (Checked)
安全 ->
请您确认 (Un-Checked)
请求用户输入此密码: (Checked)
密码: Specify the password
例如 假设远程 Ubuntu 已经配置好了远程桌面
阅读 如何设定远程桌面 (非安全)?
远程 Ubuntu 电脑: 192.168.0.1
vncviewer -fullscreen 192.168.0.1:0
Q: 如何通过 Windows 电脑连接到远程 Ubuntu 桌面?
例如 假设远程 Ubuntu 已经配置好了远程桌面
阅读 如何设定远程桌面 (非安全)?
远程 Ubuntu 电脑: 192.168.0.1
Q: 如何手动挂载/卸载 Windows 的硬盘分区 (NTFS), 并允许所有使用者只能读取?
例如 假设 /dev/hda1 是目前 Windows 所在的分区位置 (NTFS)
主机上要挂载的目录: /media/windows
sudo mkdir /media/windows
sudo mount /dev/hda1 /media/windows/ -t ntfs -o umask=0222
sudo umount /media/windows/
Q: 如何手动挂载/卸载 Windows 的硬盘分区 (FAT), 并允许所有使用者都可读取和写入?
例如 假设 /dev/hda1 是目前 Windows 所在的分区位置 (FAT)
主机上要挂载的目录: /media/windows
sudo mkdir /media/windows
sudo mount /dev/hda1 /media/windows/ -t vfat -o umask=000
sudo umount /media/windows/
Q: 如何在系统启动时自动挂载 Windows 的硬盘分区 (NTFS), 并允许所有使用者只能读取?
例如 假设 /dev/hda1 是目前 Windows 所在的分区位置 (NTFS)
主机上要挂载的目录: /media/windows
sudo mkdir /media/windows
sudo cp /etc/fstab /etc/fstab_backup
sudo gedit /etc/fstab
/dev/hda1 /media/windows ntfs umask=0222 0 0
Q: 如何在系统启动时自动挂载 Windows 的硬盘分区 (FAT), 并允许所有使用者都可读取和写入?
例如 假设 /dev/hda1 是目前 Windows 所在的分区位置 (FAT)
主机上要挂载的目录: /media/windows
sudo mkdir /media/windows
sudo cp /etc/fstab /etc/fstab_backup
sudo gedit /etc/fstab
/dev/hda1 /media/windows vfat umask=000 0 0
Q: 我应该知道哪些关于 Ubuntu 系统安全的基本问题 ?
grub
grub> md5crypt
Password: ****** (ubuntu)
Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password)
grub> quit
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
...
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# 例如 password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
...
password --md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (这是编码过的密码)
...
title Ubuntu, kernel 2.6.10-5-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.10-5-386
savedefault
boot
...
#title Ubuntu, kernel 2.6.10-5-386 (recovery mode)
#root (hd0,1)
#kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro single
#initrd /boot/initrd.img-2.6.10-5-386
#savedefault
#boot
rm $HOME/.bash_history
touch $HOME/.bash_history
chmod 000 $HOME/.bash_history
Q: 如何在终端机模式下关闭 Ctrl+Alt+Del 的系统重新启动功能?
sudo cp /etc/inittab /etc/inittab_backup
sudo gedit /etc/inittab
...
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
...
#ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
sudo telinit q
Q: 如何在终端机模式下进行 移除/覆盖 文件/目录 时,能有提示字串?
sudo cp /etc/bash.bashrc /etc/bash.bashrc_backup
sudo gedit /etc/bash.bashrc
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
Ubuntu, kernel 2.6.10-5-386 (recovery mode)
Q: 如何修改 kernal 开机参数, 来取得 root 帐号权限?
Ubuntu, kernel 2.6.10-5-386
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro quiet splash
grub edit> kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro quiet splash rw init=/bin/bash
Q: 如何使用 Ubuntu 的安装 CD 来取得 root 帐号权限?
boot: rescue
Q: 如果忘记 root 帐号/主要帐号的密码, 要如何重新设定密码?
# passwd root
# passwd system_main_username
grub
grub> md5crypt
Password: ****** (ubuntu)
Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password)
grub> quit
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
...
password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
...
password --md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password above)
Q: 在安装完 Windows 后, 要如何恢复 GRUB 菜单?
例如 假设 /boot 磁碟分区位在 /dev/hda
# grub-install /dev/hda
Q: 如何在 GRUB 的选项中新增 Windows 这个项目?
例如 假设 /dev/hda1 是目前您的 Windows 所在的位置
$ sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
$ sudo gedit /boot/grub/menu.lst
title Microsoft Windows
root (hd0,0)
savedefault
makeactive
chainloader +1
Q: 如何在 Windows 下读取 Linux 的分区 (ext2, ext3)?
按下 'Ctrl + Alt + Backspace'或著
sudo /etc/init.d/gdm restart
Q: 如何在 GNOME 载入后就启用键盘的 Num Lock (数字键)?
sudo apt-get install numlockx
sudo cp /etc/X11/gdm/Init/Default /etc/X11/gdm/Init/Default_backup
sudo gedit /etc/X11/gdm/Init/Default
...
exit 0
if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on
fi
启动程序 分页 -> Add/Edit/Delete
按下 'Ctrl + Alt + F1' (F2 - F6)
按下 'Ctrl + Alt + F7'
Q: 如何禁止在 GNOME 中使用 Ctrl+Alt+Backspace 来重新启动 X?
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
sudo gedit /etc/X11/xorg.conf
Section "ServerFlags"
Option "DontZap" "yes"
EndSection
killall nautilus
killall gnome-panel
Q: 如何在同一个 Nautilus 窗口内开启所有的目录?
/ -> apps -> nautilus -> preferences -> always_use_browser (勾选)
按下 'Ctrl + H'
Edit 菜单 -> Preferences
Views 分页 -> Default View -> Show hidden and backup files (勾选)
Q: 如何以 root 身份在 Nautilus 内浏览文件和目录?
sudo gedit /usr/share/applications/Nautilus-root.desktop
[Desktop Entry]
Name=File Browser (Root)
Comment=Browse the filesystem with the file manager
Exec=gksudo "nautilus --browser %U"
Icon=file-manager
Terminal=false
Type=Application
Categories=Application;System;
Q: 如何显示桌面图标 (我的电脑, 主目录, 资源回收桶)?
/ -> apps -> nautilus -> desktop ->
computer_icon_visible (勾选)
home_icon_visible (勾选)
trash_icon_visible (勾选)
Q: 如何更改某个文件在 "Open with" 中预设的程序?
鼠标右按钮点击文件 -> Properties
Open With 分页 -> Add
选择 "Open with" program
选择 "Open with" program (勾选)
Q: 如何改变预设的邮件程序为 Mozilla Thunderbird?
Mail Reader 分页 -> Default Mail Reader -> Command: mozilla-thunderbird %s
gedit $HOME/.gnome2/nautilus-scripts/Open\ as\ root
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
gnome-sudo "gnome-open $uri" &
done
chmod +x $HOME/.gnome2/nautilus-scripts/Open\ as\ root
鼠标右按钮点击文件 -> Scripts -> Open as root
Edit 菜单 -> Current Profile...
General 分页 -> General -> 终端 bell (不勾选)
Q: 如何让 Mozilla Firefox 能更快速的开启网站?
在网址输入行键入 -> about:config
Filter (搜寻) : ->
network.dns.disableIPv6 -> true
network.http.pipelining -> true
network.http.pipelining.maxrequests -> 8
network.http.proxy.pipelining -> true
Q: 如何关闭当 Mozilla Firefox 找到连接时的 beep 音效?
在网址输入行键入 -> about:config
Filter (搜寻) : -> accessibility.typeaheadfind.enablesound -> false
Q: 如何恢复 Mozilla Firefox 原本的图标?
wget -c http://frankandjacq.com/ubuntuguide/mozilla-firefox.png
wget -c http://frankandjacq.com/ubuntuguide/document.png
chmod 644 mozilla-firefox.png
chmod 644 document.png
sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-firefox.png
sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-firefox.xpm
sudo dpkg-divert --rename /usr/lib/mozilla-firefox/icons/default.xpm
sudo dpkg-divert --rename /usr/lib/mozilla-firefox/icons/document.png
sudo dpkg-divert --rename /usr/lib/mozilla-firefox/chrome/icons/default/default.xpm
sudo cp mozilla-firefox.png /usr/share/pixmaps/mozilla-firefox.png
sudo cp mozilla-firefox.png /usr/share/pixmaps/mozilla-firefox.xpm
sudo cp mozilla-firefox.png /usr/lib/mozilla-firefox/icons/default.xpm
sudo cp document.png /usr/lib/mozilla-firefox/icons/document.png
sudo cp mozilla-firefox.png /usr/lib/mozilla-firefox/chrome/icons/default/default.xpm
Q: 如何恢复 Mozilla Thunderbird 原本的图标?
wget -c http://frankandjacq.com/ubuntuguide/mozilla-thunderbird.xpm
chmod 644 mozilla-thunderbird.xpm
sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird.xpm
sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-menu.xpm
sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm
sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm
sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm
sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm
sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/default.xpm
sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird.xpm
sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird-menu.xpm
sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm
sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm
sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm
sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm
sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/default.xpm
Edit 菜单 -> Reload Package Information
Edit 菜单 -> Mark All Upgrades... -> Default Upgrade
Edit 菜单 -> 实施被标记的变动
Edit 菜单 -> Search... 指定要搜寻的套件名称
选择 "package_name"
Package 菜单 -> 标记要安装的套件
Edit 菜单 -> 实施被标记的变动
选择 "package_name"
Package 菜单 -> 标记要移除的套件
Edit 菜单 -> 实施被标记的变动
sudo dpkg -i package_file.deb
sudo dpkg -r package_name
sudo alien package_file.rpm
wget -c http://frankandjacq.com/ubuntuguide/mvb_1.6.tgz
sudo tar zxvf mvb_1.6.tgz -C /usr/
sudo chown -R root:root /usr/mvb_1.6/
sudo ln -fs /usr/mvb_1.6/mvb /usr/bin/mvb
mvb -h
sudo apt-get install imagemagick
wget -c http://frankandjacq.com/ubuntuguide/bbips.0.2.6.sh
sudo cp bbips.0.2.6.sh /usr/bin/
sudo chmod 755 /usr/bin/bbips.0.2.6.sh
bbips.0.2.6.sh
Q: 如何设定系统通用 (system-wide) 的环境变数?
sudo cp /etc/bash.bashrc /etc/bash.bashrc_backup
sudo gedit /etc/bash.bashrc
man command | col -b > file.txt
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
...
#hiddenmenu
...
hiddenmenu
Q: 如何更改 GRUB menu 内关于开机时预设的等待时间 (timeout) ?
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
...
timeout 3
...
timeout X_seconds
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
...
default 0
...
default X_sequence
Q: 如何在系统启动时显示 GRUB menu 的 Splash Image?
例如 假设 hd0,1 是目前 Ubuntu 的启动硬盘分区
wget -c http://frankandjacq.com/ubuntuguide/ubuntu.xpm.gz
chmod 644 ubuntu.xpm.gz
sudo mkdir /boot/grub/images
sudo cp ubuntu.xpm.gz /boot/grub/images/
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
...
splashimage (hd0,1)/boot/grub/images/ubuntu.xpm.gz
Q: 如何将桌面背景图转换成 GRUB menu 可用的 Splash Image?
例如 假设我们要将桌面背景图档 wallpaper.png 转换成 GRUB menu 中
可用的 Splash Image 格式文件 splashimage.xpm.gz
convert -resize 640x480 -colors 14 wallpaper.png splashimage.xpm && gzip splashimage.xpm
Q: 如何暂时略过开机时载入的服务 (boot-up services)?
按下 'Ctrl + C'
Q: 如何永远禁止/启用开机时载入的服务 (boot-up services)?
sudo chmod -x /etc/init.d/service_name
sudo chmod +x /etc/init.d/service_name
sudo cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup
sudo gedit /etc/init.d/sysklogd
...
stop)
log_begin_msg "Stopping system log daemon..."
start-stop-daemon --stop --quiet --oknodo --exec $binpath --pidfile $pidfile
log_end_msg $?
...
rm -fr /tmp/* /tmp/.??*
Q: 如何安装 ClamAV AntiVirus 病毒防制服务器?
sudo apt-get install clamav
sudo freshclam
sudo clamscan -r /location_of_files_or_folders
例如每天子时自动扫描 文件/目录 来搜寻病毒
* * * * * 分别代表 分 时 日 月 年
export EDITOR=gedit && sudo crontab -e
00 00 * * * sudo clamscan -r /location_of_files_or_folders
Q: 如何安装 Samba 服务器来提供 文件/目录 分享的服务?
sudo apt-get install samba
sudo apt-get install smbfs
smbpasswd -a system_username
sudo gedit /etc/samba/smbusers
system_username = "network username"
sudo smbpasswd -a system_username
sudo smbpasswd -x system_username
Q: 如何分享主目录 (home folders) 并只有读取的权限 (Authentication=Yes - 权限认证开启)?
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
...
; security = user
...
security = user
username map = /etc/samba/smbusers
sudo testparm
sudo /etc/init.d/samba restart
Q: 如何分享主目录 (home folders)并有读取和写入的权限 (Authentication=Yes - 权限认证开启)?
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
...
; security = user
...
security = user
username map = /etc/samba/smbusers
...
# By default, the home directories are exported read -only. Change next
# parameter to 'yes' if you want to be able to write to them.
writable = no
...
# By default, the home directories are exported read -only. Change next
# parameter to 'yes' if you want to be able to write to them.
writable = yes
sudo testparm
sudo /etc/init.d/samba restart
Q: 如何分享群组目录 (group folders) 并只有读取的权限 (Authentication=Yes - 权限认证开启)?
sudo mkdir /home/group
sudo chmod 777 /home/group/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
...
; security = user
...
security = user
username map = /etc/samba/smbusers
[Group]
comment = Group Folder
path = /home/group
public = yes
writable = no
valid users = system_username1 system_username2
create mask = 0700
directory mask = 0700
force user = nobody
force group = nogroup
sudo testparm
sudo /etc/init.d/samba restart
Q: 如何分享群组目录 (group folders)并有读取和写入的权限 (Authentication=Yes - 权限认证开启)?
sudo mkdir /home/group
sudo chmod 777 /home/group/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
...
; security = user
...
security = user
username map = /etc/samba/smbusers
[Group]
comment = Group Folder
path = /home/group
public = yes
writable = yes
valid users = system_username1 system_username2
create mask = 0700
directory mask = 0700
force user = nobody
force group = nogroup
sudo testparm
sudo /etc/init.d/samba restart
Q: 如何开启公用目录的分享功能并只有读取的权限 (Authentication=Yes - 权限认证开启)?
sudo mkdir /home/public
sudo chmod 777 /home/public/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
...
; security = user
...
security = user
username map = /etc/samba/smbusers
[public]
comment = Public Folder
path = /home/public
public = yes
writable = no
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup
sudo testparm
sudo /etc/init.d/samba restart
Q: 如何开启公用目录的分享功能并有读取和写入的权限 (Authentication=Yes - 权限认证开启)?
sudo mkdir /home/public
sudo chmod 777 /home/public/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
...
; security = user
...
security = user
username map = /etc/samba/smbusers
[public]
comment = Public Folder
path = /home/public
public = yes
writable = yes
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup
sudo testparm
sudo /etc/init.d/samba restart
Q: 如何开启公用目录的分享功能并只有读取的权限 (Authentication=No - 权限认证关闭)?
sudo mkdir /home/public
sudo chmod 777 /home/public/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
...
; security = user
...
security = share
[public]
comment = Public Folder
path = /home/public
public = yes
writable = no
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup
sudo testparm
sudo /etc/init.d/samba restart
Q: 如何开启公用目录的分享功能并有读取和写入的权限 (Authentication=No - 权限认证关闭)?
sudo mkdir /home/public
sudo chmod 777 /home/public/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
...
; security = user
...
security = share
[public]
comment = Public Folder
path = /home/public
public = yes
writable = yes
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup
sudo testparm
sudo /etc/init.d/samba restart
sudo apt-get install ssh
例如 假设远程的 Ubuntu 主机已经安装了 SSH 服务器服务
请参阅 如何安装 SSH 服务器来远程遥控管理系统?
远程 Ubuntu 主机 : 192.168.0.1
ssh username@192.168.0.1
Q: 如何从远程的 Ubuntu 主机复制文件/目录到本地的主机内 (scp)?
例如 假设远程的 Ubuntu 主机已经安装了 SSH 服务器服务
请参阅 如何安装 SSH 服务器来远程遥控管理系统?
远程 Ubuntu 主机 : 192.168.0.1
远程要复制的 文件/目录 位置 : /home/username/remotefile.txt
本地主机要保存的位置 : . (目前工作目录)
scp -r username@192.168.0.1:/home/username/remotefile.txt .
Q: 如何从本地主机复制文件/目录到远程的 Ubuntu 主机内 (scp)?
例如 假设远程的 Ubuntu 主机已经安装了 SSH 服务器服务
请参阅 如何安装 SSH 服务器来远程遥控管理系统?
本地主机 文件/目录 的位置 : localfile.txt
远程 Ubuntu 主机 : 192.168.0.1
远程 Ubuntu 主机上要存放的位置 : /home/username/
scp -r localfile.txt username@192.168.0.1:/home/username/
Q: 如何从远程 Ubuntu 主机上复制 文件/目录 到本地主机上 (rsync)?
例如 假设远程的 Ubuntu 主机已经安装了 SSH 服务器服务
请参阅 如何安装 SSH 服务器来远程遥控管理系统?
远程 Ubuntu 主机 : 192.168.0.1
远程要复制的 文件/目录 位置 : /home/username/remotefile.txt
本地主机要保存的位置 : . (目前工作目录)
rsync -v -u -a --delete --rsh=ssh --stats username@192.168.0.1:/home/username/remotefile.txt .
Q: 如何从本地主机复制 文件/目录 到远程的 Ubuntu 主机内 (rsync)?
例如 假设远程的 Ubuntu 主机已经安装了 SSH 服务器服务
请参阅 如何安装 SSH 服务器来远程遥控管理系统?
本地主机 文件/目录 的位置 : localfile.txt
远程 Ubuntu 主机 : 192.168.0.1
远程 Ubuntu 主机上要存放的位置 : /home/username/
rsync -v -u -a --delete --rsh=ssh --stats localfile.txt username@192.168.0.1:/home/username/
Q: 如何从 Windows 主机来 SSH 连线到远程的 Ubuntu 主机?
例如 假设远程的 Ubuntu 主机已经安装了 SSH 服务器服务
请参阅 如何安装 SSH 服务器来远程遥控管理系统?
Q: 如何从 Windows 主机复制 文件/目录 从/到 远程的 Ubuntu 主机内?
例如 假设远程的 Ubuntu 主机已经安装了 SSH 服务器服务
请参阅 如何安装 SSH 服务器来远程遥控管理系统?
例如 假设 "eth0" 是我们的网络卡的介面
IP Address Range: 192.168.0.100 to 192.168.0.200
Subnet Mask: 255.255.255.0
DNS Servers: 202.188.0.133, 202.188.1.5
Domains: tm.net.my
Gateway Address: 192.168.0.1
sudo apt-get install dhcp3-server
sudo cp /etc/default/dhcp3-server /etc/default/dhcp3-server_backup
sudo gedit /etc/default/dhcp3-server
...
INTERFACES=""
INTERFACES="eth0"
sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf_backup
sudo gedit /etc/dhcp3/dhcpd.conf
...
# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
...
# option definitions common to all supported networks...
#option domain-name "example.org";
#option domain-name-servers ns1.example.org, ns2.example.org;
#default-lease-time 600;
#max-lease-time 7200;
...
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}
...
# A slightly different configuration for an internal subnet.
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option domain-name-servers 202.188.0.133, 202.188.1.5;
option domain-name "tm.net.my";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 600;
max-lease-time 7200;
}
sudo /etc/init.d/dhcp3-server restart
sudo apt-get install mysql-server
mysqladmin -u root password db_user_password
sudo apt-get install mysqlcc
sudo gedit /usr/share/applications/MySQLCC.desktop
[Desktop Entry]
Name=MySQLCC
Comment=MySQLCC
Exec=mysqlcc
Icon=/usr/share/pixmaps/mysqlcc.xpm
Terminal=false
Type=Application
Categories=Application;System;
Q: 如何安装 Apache HTTP 服务器作为 HTTP (Web) 服务器服务?
sudo apt-get install apache2
Q: 如何安装搭配 Apache HTTP 服务器使用的 PHP?
sudo apt-get install php4
sudo gedit /var/www/testphp.php
<?php phpinfo(); ?>
Q: 如何安装搭配 Apache HTTP 服务器使用的 MYSQL?
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php4-mysql
sudo /etc/init.d/apache2 restart
Q: 如何映设 URLs 到 /var/www/ 以外的目录?
sudo gedit /etc/apache2/conf.d/alias
Alias /URL-path /location_of_folder/
<Directory /location_of_folder/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
sudo /etc/init.d/apache2 restart
Q: 如何修改 Apache HTTP 服务器预设的端口号?
例如 假设新的端口号为 79
sudo cp /etc/apache2/ports.conf /etc/apache2/ports.conf_backup
sudo gedit /etc/apache2/ports.conf
Listen 80
Listen 79
sudo /etc/init.d/apache2 restart
Q: 如何使用 Mozilla Firefox 浏览被更改过端口号的 Apache HTTP 服务器?
例如 假设新的端口号为 79
sudo cp /usr/lib/mozilla-firefox/greprefs/all.js /usr/lib/mozilla-firefox/greprefs/all.js_backup
sudo gedit /usr/lib/mozilla-firefox/greprefs/all.js
...
// If there is ever a security firedrill that requires
// us to block certian ports global, this is the pref
// to use. Is is a comma delimited list of port numbers
// for example:
// pref("network.security.ports.banned", "1,2,3,4,5");
// prevents necko connecting to ports 1-5 unless the protocol
// overrides.
...
pref("network.security.ports.banned.override", "79");
Q: 如何为 Apache HTTP 服务器的 PHP 增加RSS语法分析?
例如 假设 RSS 是 DistroWatch.com - News
wget -c http://frankandjacq.com/ubuntuguide/magpierss-0.71.1.tar.gz
sudo mkdir /var/www/feeds
sudo tar zxvf magpierss-0.71.1.tar.gz -C /var/www/feeds/
sudo mv /var/www/feeds/magpierss-0.71.1/* /var/www/feeds/
sudo rm -fr /var/www/feeds/magpierss-0.71.1/
sudo chown -R www-data:root /var/www/feeds/
sudo gedit /var/www/feeds/index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>DistroWatch.com - News</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<style type="text/css">
/*<![CDATA[*/
/*
DEFAULT TAG STYLES
*/
body {
background: #ffffff;
margin-left: 20px;
font-family: bitstream vera sans,sans-serif;
font-size: 9pt;
}
h1 {
font-family: luxi sans,sans-serif;
font-size: 15pt;
}
/*]]>*/
</style>
</head>
<body>
<?php
require_once 'rss_fetch.inc';
error_reporting(E_ERROR);
$url = 'http://distrowatch.com/news/dw.xml';
$rss = fetch_rss($url);
if ($rss) {
echo "<h1>";
echo "<a href=$url>", $rss->channel[title], "</a><br/>";
echo "</h1>";
foreach ($rss->items as $item ) {
$url = $item[link];
$title = $item[title];
$description = $item[description];
echo "<li>";
echo "<b>Topic:</b> <a href=$url><b><u>$title</u></b></a><br/><br/>";
echo "$description<br/><br/>";
echo "</li>";
}
}
else {
echo "<a href=$url>", $url, "</a> - Server Down!<br/>";
}
?>
</body>
</html>
例如 /var/music/ 是包含多媒体文件的目录
sudo apt-get install gnump3d
Q: 如何修改 GNUMP3d 中包含多媒体文件的缺省目录?
例如 假设新的包含多媒体文件的目录是 /home/music/
sudo cp /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d.conf_backup
sudo gedit /etc/gnump3d/gnump3d.conf
root = /var/music
root = /home/music
user = gnump3d
user = root
sudo /etc/init.d/gnump3d restart
例如 假设新的端口号是 7979
sudo cp /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d.conf_backup
sudo gedit /etc/gnump3d/gnump3d.conf
port = 8888
port = 7979
sudo /etc/init.d/gnump3d restart
sudo apt-get install gallery (when prompted to restart Apache, choose No or Cancel)
sudo apt-get install imagemagick
sudo apt-get install jhead
sudo apt-get install libjpeg-progs
sudo /etc/init.d/apache2 restart
sudo sh /usr/share/gallery/configure.sh
Gallery Configuration Wizard: Step 1
Next Step ->
Gallery Configuration Wizard: Step 2
General settings Tab ->
Admin password: Specify the password
Locations and URLs Tab ->
Album directory: /var/www/albums/
Temporary directory: /tmp/
Gallery URL: http://localhost/gallery
Albums URL: http://localhost/albums
Next Step -->
Gallery Configuration Wizard: Step 3
Next Step -->
Gallery Configuration Wizard: Step 4
Save Config ->
Q: 如何设定 Gallery 使其可以通过 Internet (主机名 或 固定 IP) 或 网络 (固定 IP)访问?
例如 假設网络及 internet 连接是已经正确设置完成
Internet (Hostname or fix IP) or LAN (fix IP): http://www.url.com
sudo cp /etc/gallery/config.php /etc/gallery/config.php_backup
sudo gedit /etc/gallery/config.php
...
$gallery->app->photoAlbumURL = "http://localhost/gallery";
$gallery->app->albumDirURL = "http://localhost/albums";
...
$gallery->app->photoAlbumURL = "http://www.url.com/gallery";
$gallery->app->albumDirURL = "http://www.url.com/albums";
Q: 如何设定 Gallery 使其可以通过 网络 (动态 IP)访问?
例如 假设您的网络连接已经正确设置好
LAN (dynamic IP): 192.168.0.1
sudo cp /etc/gallery/config.php /etc/gallery/config.php_backup
sudo gedit /etc/gallery/config.php
...
$gallery->app->photoAlbumURL = "http://localhost/gallery";
$gallery->app->albumDirURL = "http://localhost/albums";
...
$gallery->app->photoAlbumURL = "/gallery";
$gallery->app->albumDirURL = "/albums";
sudo tar zcvf gallery.tgz /var/www/albums/ /etc/gallery/
sudo tar zxvf gallery.tgz -C /
Q: 与 ntp.ubuntulinux.org 进行时间同步... (载入时间太长)
service_name = ntpdate
Q: 如何禁止系统时间/日期被重新设置为 UTC (GMT)?
sudo cp /etc/default/rcS /etc/default/rcS_backup
sudo gedit /etc/default/rcS
...
UTC=yes
...
UTC=no
Set the correct time/date
sudo /etc/init.d/hwclock.sh restart
sudo killall esd
sudo cp /etc/esound/esd.conf /etc/esound/esd.conf_backup
sudo gedit /etc/esound/esd.conf
...
auto_spawn=0
spawn_options=-terminate -nobeeps -as 5
...
auto_spawn=1
spawn_options=-terminate -nobeeps -as 2 -d default
sudo apt-get install libesd-alsa0
sudo gedit /etc/asound.conf
pcm.card0 {
type hw
card 0
}
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1025
slave {
pcm "hw:0,0"
period_time 0
period_size 2048
buffer_size 32768
rate 48000
}
bindings {
0 0
1 1
}
}
sudo ln -fs /usr/lib/libesd.so.0 /usr/lib/libesd.so.1
General 分页 -> Sounds for events (不勾选)
sudo rm -fr $HOME/.Trash/
rm -fr $HOME/.config/menus/applications.menu
Q: 如何在 GNOME 内更新 位置 菜单的显示 (如果无法显示 /etc/fstab 内指定到 /media/ 的挂载)?
sudo /etc/init.d/dbus-1 restart
Q: 如何从 Hoary Hedgehog (5.04) 升级到 Breezy Badger (5.10) (试验性)?
警告! 5.10 目前还在开发阶段. Only use it for experimental purposes
升级完后, 可能会破坏您的系统的完整性
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
sudo gedit /etc/apt/sources.list
deb cdrom:[Ubuntu 5.04 _Hoary Hedgehog_ - Release i386 (20050407)]/ hoary main restricted
## Uncomment the following two lines to fetch updated software from the network
# deb http://us.archive.ubuntu.com/ubuntu hoary main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu hoary main restricted
## Uncomment the following two lines to fetch major bug fix updates produced
## after the final release of the distribution.
# deb http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu hoary-updates main restricted
## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
# deb http://us.archive.ubuntu.com/ubuntu hoary universe
# deb-src http://us.archive.ubuntu.com/ubuntu hoary universe
# deb http://security.ubuntu.com/ubuntu hoary-security main restricted
# deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted
# deb http://security.ubuntu.com/ubuntu hoary-security universe
# deb-src http://security.ubuntu.com/ubuntu hoary-security universe
#deb cdrom:[Ubuntu 5.04 _Hoary Hedgehog_ - Release i386 (20050407)]/ hoary main restricted
## Uncomment the following two lines to fetch updated software from the network
deb http://us.archive.ubuntu.com/ubuntu breezy main restricted
deb-src http://us.archive.ubuntu.com/ubuntu breezy main restricted
## Uncomment the following two lines to fetch major bug fix updates produced
## after the final release of the distribution.
deb http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted
## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://us.archive.ubuntu.com/ubuntu breezy universe
deb-src http://us.archive.ubuntu.com/ubuntu breezy universe
deb http://security.ubuntu.com/ubuntu breezy-security main restricted
deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted
deb http://security.ubuntu.com/ubuntu breezy-security universe
deb-src http://security.ubuntu.com/ubuntu breezy-security universe
deb http://archive.ubuntu.com/ubuntu breezy multiverse
deb-src http://archive.ubuntu.com/ubuntu breezy multiverse
sudo apt-get update
sudo apt-get dist-upgrade
Ubuntu
Logo,
Ubuntu and Canonical are trademarks of Canonical Ltd.