X Window – RPM
Hệ thống X Window được phát triển trong Laboratory for Computer Science tại MIT (Massachusetts Institute of Technology) như là một phần trong dự án Athena hợp tác với DEC, và được phát hành lần đầu vào năm 1984.
Người chủ trì dự án là Robert Scheifler, và phiên bản X đầu tiên chịu ơn “W” Windowing package (“W” Windowing package được phát triển bởi Paul Asente tại Stanford).
Tháng 9 ,1987, MIT xuất phiên bản X11 đầu tiên
mà chúng ta còn sử dụng đến ngày nay
Lịch sử X-Window
A network-transparent window system Phần mềm có thể chạy trên 1 máy tính và truyền hình ảnh của nó sang 1 máy tính khác. X servers
Chạy trên máy tính với màn hình đồ hoạ.
X clients
Chúng có thể chạy trên các máy khác với mọi tương tác xuyên qua một server. Việc tương tác bao gồm text và graphics input/output
X Window là gì ?
Biến $DISPLAY Biến $DISPLAY Hostname:displaynumber.screennum
ber
Ví dụ: alibaba.citd.edu.vn:0.0
Dùng bởi một ứng dụng để xác định nó kết nối vào server nào và màn hình nào Hostname: tên máy hoặc ip address. Displaynumber: bắt đầu từ 0 (hầu hết các máy hiện nay chỉ có 1 màn hình)
Screennumber: Một vài màn hình
chia sẽ 1 bàn phím và pointer giữa hai hay nhiều monitors
Khởi động X Window
Để khởi động mặc định ta chọn id:5:initdefault trong tập tin /etc/inittab
Nếu trong chế độ text, ta dùng lệnh
startx
xhost
Cấu hình MS Windows hiển thị X-window
Sử dụng X-server chạy trên Windows
là X-WinPro
cài đặt x-winpro. Chọn các options mặc định ( không cần thay đổi hay chỉnh sửa cấu hình gì hết)
Cấu hình MS Windows hiển thị X-window (tiếp theo)
Sau đó login vào máy Linux export DISPLAY sang máy Windows có chạy X-WinPro bằng lệnh: export DISPLAY=ip_addr_máy_Win:0.0
Chạy thử 1 chương trình ứng dụng
xterm &
sau đó đánh lệnh startkde & để tiến hành sử dụng giao diện GUI của KDE
Thông thường khi cài đặt Linux có rất nhiều Window manager cho chúng ta chọn lựa. Nhưng đối với các version Linux sau này người ta thường chọn GNOME mặc định cho chúng ta. Khiến đôi khi ta lầm tưởng màn hình X Window chỉ có GNOME. Để chọn các kiểu X Window ta có thể vào tập tin /etc/X11/prefdm để thay đổi
Chọn Window Manager
KDE Desktop
xterm
Control Center
File Manager
Đối với các người dùng đã quen thuộc với các môi trường window trên các OS khác có rất nhiều window managers để emulate desktop mà họ đã quen thuộc. http://www.ezskins.com/top10.phtml?Lin
uxKDEthemes
http://www.lysator.liu.se/~marcus/amiw m.html là một kiểu Amiga Workbench window manager.
dfm http://www.kaisersite.de/dfm/, mô
phỏng OS/2 Workplace Shell.
Các mode X Window
Open Look và Motif đã sớm cố gắng chuẩn hoá X Window và làm cho nó trở nên hữu dụng trong các môi trường khác nhau, không chỉ trên các workstations. Cả hai đều thành công theo một nghĩa nào đó ( look and feel) và có thể được dùnng dưới các hệ Linux mới .
Khởi đầu với X11 Release 5, Sun
Microsystem's OpenWindows graphical interface được phát triển cho X users. Nó bao goàm 2 phiên bản của Open Look Window Manager, olwm và olvwm (with a virtual desktop). Nó được phát triển bởi Sun trong sự hy vọng chuẩn hoá môi trường window, và thực tế đã chứng minh được đó là chuẩn cho Solaris trong nhiều năm.
X Graphical Interfaces
Cmdtool on Solaris
File Manager on Solaris
KDE
KDE is a powerful Open Source
graphical desktop environment for Unix workstations. It combines ease of use, contemporary functionality, and outstanding graphical design with the technological superiority of the Unix operating system
http://www.kde.org
The KDE project is a large open
group of developers consisting of several hundred software engineers from all over the world committed to free software development.
The KDE project is a free software
project.
Each and every line of KDE code is
made available under the LGPL/GPL licenses.
KDE Project Overview
The traditional X11 desktop exhibits
among others the following shortcomings: No easy dialog based desktop configuration No unified application help system No common application development
framework
No compound document framework Lack of network transparency on the
application level
Authoring of X11 applications extremely
difficult and tedious
Why is there a need for KDE?
network transparency desktop
An integrated help system Consistent look and feel of all KDE
applications
Standardized menu and toolbars, keybindings, color-schemes, etc.
Internationalization: KDE is available in
more than 50 languages
Centralized consisted dialog driven desktop
configuration
A great number of useful KDE applications
KDE - The users view A good looking contemporary and complete
The current KDE distribution consists
of the following packages: aRts: Analog realtime synthesizer and
sound daemon
KDE-Libs: Various run-time libraries KDE-Base: The base components
(window-manager, desktop, panel, Konqueror)
KDE-Network: KNode, KNewsticker,
Kppp, ...
KDE-Pim: KMail, KAddressbook,
KOrganizer, KPilot, ...
The current KDE distribution
KDE-Graphics: Graphics applications such as KDVI, KGhostview, KPaint, KFax, ... KDE-Multimedia: Noatun, KMidi, KSCD, ... KDE-Utilities: KEdit, KCalc, KHexEdit,
KNotes,
KDE-Edu: Edutainment related programs KDE-Games: KAsteroids, KPat, KTetris, ... KDE-Toys: Fun stuff
KDE distribution (cont)
KDE-Addons: Addons for Konqueror, Kate,
Kicker and Noatun
KDE-Artwork: icons, styles, wallpapers, screensavers and window decorations KDE-Admin: Various tools to aid system
administration
KDE-SDK: Script and tools which simplify
development of KDE applications
KOffice: Integrated office suite KDevelop: C/C++ Integrated Development
Environment
Quanta: Web Development Tool
KDE distribution (cont)
KDE is a big project. While it is very hard to quantify what this means exactly, note that: The KDE CVS source code repository holds
currently about 4.0 million lines of code. (The Linux kernel version 2.5.71 consists in about 3.7 million lines of code.)
Over 800 contributors help to develop KDE. The translation team alone consists of about
300 individuals.
11,014 CVS commits were made during May
2002.
KDE has more than 17 official WWW mirrors in
over 12 countries.
KDE has more than 106 official FTP mirrors in
over 39 countries.
KDE Facts and Figures
The GNOME Project is an effort to create a complete, free and easy- to-use desktop environment for users, as well as a powerful application development framework for software developers.
GNOME
Free Usable Accessible International Organized Supported A community
GNOME is...
Chương trình xfontsel
fndry - font foundry, công ty hoặc cá
nhân làm ra font
fmly - font family, the popular
nickname of the font
wght - font weight (bold, medium,
etc.)
slant - font slant (italics, oblique,
roman (normal), etc.)
sWdth - font width (normal, condensed, extended, etc.)
adstyl - additional style (sans
serif, serif, etc.)
pxlsz - pixel size, số lượng pixels
theo chiều dọc trong 1 ký tự
Ý nghĩa xfontsel
ptSz - approximate point size of
the text (similar to pxlsz)
resx - horizontal resolution, in
dpi
resy - vertical resolution, in dpi spc - spacing, only useful,
apparently, in the Schumacher fonts
avgWidth - average character width
of the font
rgstry - the recognized registry
that lists the font
encdng - nationality encoding
Ý nghĩa xfontsel (tt)
Hãy trở lại terminal window và thử
đánh lệnh sau: xterm -fg blue -bg red &
Màu sắc
Nếu bạn đã từng dùng các hệ Windows khác như MS Windows hoặc MacOS, ban có rất nhiều fonts đã pre-installed trong máy tính của bạn roài đó là TrueType fonts. TrueType fonts được xem là tốt nhất trên các màn hình nhỏ, độ phân giải thấp và làm cho màn hình của bạn trông mịn hơn
X không hiểu TrueType fonts, và không có khả năng tự hiểu và do đó nó cần một số chương trình chuyển font cho nó. Có một FreeType library làm điều này, nhưng nếu bạn chỉ muốn dùng nó trên máy tính của bạn, tất cả những gì bạn cần là một chương trình tên xfstt (X font server for TrueType). ftp://metalab.unc.edu/pub/Linux/X11/fonts/
True Type Fonts in X Window
Cài đặt chương trình này rất dễ.
Extract the archive, và make file, và sau đó make install. Bạn có thể gặp một vài lỗi nhưng không quan trọng lắm hãy bỏ qua nó. những gì bạn phải làm tiếp là tạo một thư mục cho phép ghi gọi là /usr/ttfonts và đặt một vài fonts *.ttf tại đó. Sau đó đoàng bộ font server với lệnh xfstt --sync.
Cài đặt True Type Font
Nếu bạn gặp lỗi , hãy chạy font
server trong background với lệnh xfstt & và chỉ cho X11 server về font servicevới lệnh xset fp+ unix/:7100. Nếu bạn không gặp lỗi thì hãy chạy Netscape, thậm chí xfontsel, và sẽ thấy các fonts này sẵn sàng.
Cài đặt True Type Font
Trong các phiên bản Linux mới, có một số thay
đổi trong xset (RedHat 6.0 trở lên), bạn chạy thử xset fp+ unix/:7101
Nếu tất cả làm việc tốt, lúc này bạn sẽ muốn lưu lại cấu hình hệ thống lại sao cho lần chạy sau ta không phải làm lại.
Tất cả những gì bạn phải làm là thêm 2 lệnh mới
ở đoạn trên vào .xinitrc file .
Nếu bạn startx thông qua xdm, bạn sẽ thêm /usr/X11R6/bin/xfstt & vào file
/usr/X11R6/lib/X11/xdm/Xsetup_0. Sau đó thêm
xset fp+ unix/:7100.
Cài đặt True Type Font (tt)
Trước hết bạn hãy download bộ fonts vni ( có tại http://www.fedu.uec.ac.jp/~vuhung/linux/font-
rpms/
Sau đó bạn kiểm tra xem trong hệ thống đã có
font vni chưa bằng lệnh
# xlsfonts |grep vni Nếu có các fonts vni-*** xuất hiện nghĩa là quá trình cài fonts của bạn đã thành công mỹ mãn. Lúc này bạn hãy chạy netscape và chọn font vni
để xem các Web site có tiếng Việt ( font vni 2byte
VNI Fonts
xvnk Sau khi bung các file trong package
rồi
cd Vào thư mục xvnkb2 đọc hướng
dẫn trong README để cài đặt [root@alibaba xvnkb2]# make [root@alibaba xvnkb2]# ./install [root@alibaba xvnkb2]# xvnkb &
Nếu thành công sẽ thấy 1 logo nhỏ
hiện ở taskbar
Tiếng Việt
Redhat Package Management RPM
Lịch sử RPM Khái niệm RPM Căn bản RPM RPM Nâng cao Công cụ RPM
Giới thiệu
RedHat Package Management RPM V1:
Perl based, simple database format Automatic handling of configuration files Erase or rebuilding large numbers of packages Ability to verify the package installation
Trở thành RPM Package Manager- được sử dụng rộng rãi bởi các Linux Distributors khác
Version hiện tại là v4
Lịch sử RPM
Mục tiêu của RPM:
Làm cho việc cài đặt các package lên
hệ thống được dễ dàng
Kiểm tra được các package có được
install đúng không
Làm cho việc đóng gói các package
được dễ dàng
Chạy trên nhiều kiến trúc máy tính
khác nhau
Khái niệm RPM
Căn bản RPM
Cài đặt 1 package : tham số -i
Ví dụ:
rpm –i kernel-2.4.20-8.athlon.rpm rpm –i unzip-5.50-7.i386.rpm
Cài đặt 1 package: tham số -ivh :
hiển thị dấu # cho biết quá trình cài đặt rpm -ivh lynx-2.8.5-11.i386.rpm warning: lynx-2.8.5-11.i386.rpm: V3 DSA
signature: NOKEY, key ID db42a60e
Preparing... ####################### [100%] 1:lynx ####################### [100%]
[root@pascal natuan]#
rpm –U pakage-name.rpm rpm –Uv pakage-name.rpm
Hiển thị dạng đầy đủ
rpm –Uvh pakage-name.rpm Hiển thị dạng đầy đủ và dấu # rpm –Fvh pakage-name.rpm
Làm mới package, nó chỉ install khi có 1 package cũ tồn tại trong hệ thống
Nâng cấp package
rpm –e packagename
Removing packages
rpm –qa : truy vấn tất cả (all) các
package trong hệ thống
rpm –q package_name: truy vấn
package_name xem có trong hệ thống không ?
rpm –qi package_name: xem thông tin
của package_name
rpm –ql package_name: xem tất cả các
file liên quan của package_name Kết hợp : rpm –qil packagename
Truy vấn rpm
[root@pascal natuan]# rpm -qi lynx
Name : lynx Relocations: (not relocateable) Version : 2.8.5 Vendor: Red Hat, Inc. Release : 11 Build Date: Sat 25 Jan 2003 12:10:43
AM EST Install Date: Sat 25 Oct 2003 04:12:16 PM EDT Build Host: porky.devel.redhat.com
Group : Applications/Internet Source RPM: lynx-2.8.5-11.src.rpm Size : 4021040 License: GPL Signature : DSA/SHA1, Mon 24 Feb 2003 01:34:45 AM EST, Key ID
219180cddb42a60e
Packager : Red Hat, Inc.
URL : http://lynx.isc.org/ Summary : A text-based Web browser. Description :
Lynx is a text-based Web browser. Lynx does not display any images, but it does support frames, tables, and most other HTML tags. One advantage Lynx has over graphical browsers is speed; Lynx starts and exits quickly and swiftly displays webpages. [root@pascal natuan]#
rpm –qi lynx
Depends: Khi cài đặt 1 package, thường
các package có ràng buộc với nhau. Ví dụ muốn cài package B thì phải có package A được cài trước.
Để cài đặt bỏ qua các ràng buộc: rpm –Uvh --nodeps package_name rpm –Uvh --force package_name rpm –Uvh --force --nodeps
package_name
Kiểm tra trước khi cài đặt
rpm –Uvh --test package_name
Ràng buộc
Package nào chứa file
Các tham số hữu ích
/etc/httpd/conf/httpd.conf ? [root@pascal natuan]# rpm -qf
/etc/httpd/conf/httpd.conf
httpd-2.0.40-21 [root@pascal natuan]#
Xem các thay đổi của package
rpm –q --changelog package_name
Cài đặt 1 package không cần cài
document của package đó rpm –Uvh --excludedocs
package_name
Các tham số hữu ích
redhat-config-packages
Công cụ RPM