Các bài viết trên Wiki đều do cộng đồng đóng góp và mang mục đích tham khảo, gợi ý.
Nếu muốn viết bài xin bạn đọc hướng dẫn sử dụng Wiki

Chuyển đổi từ bản phân phối Linux khác

Từ Ubuntu-VN

Trang này thảo luận những điểm khác biệt giữa Ubuntu và các bản phân phối khác.

Ubuntu xây dựng dựa trên Debian, nên có nhiều tác vụ giống nhau giữa Ubuntu và Debian.

Mục lục

[sửa] Cài đặt phần mềm

Giống như các bản phân phối dựa trên Debian, phần mềm được cài vào Ubuntu với công cụ APT, tương tự như yum đối với các bản phân phối dựa trên Redhat. Nếu thích sử dụng giao diện dòng lệnh, thì bạn cần cài `apt-get`. Bên cạnh đó, giao diện đồ họa nằm ở System > Administration > Synaptic Package Manager.

Xem thêm thông tin ở Installing Software về cài đặt các gói.

[sửa] Làm việc với Administrative Tasks

Trong Ubuntu, người ta khuyến khích chạy chương trình với quyền `sudo` thay vì login với tài khoản root. Những lơi ích là:

* Bạn không thể hủy hoại hệ thống nếu không liên tục sử dụng `sudo`.
* Không cần nhớ passsword của root vì sudo chỉ cần password của tài khoản đang dùng.
* Khi nhập password, sudo sẽ ghi nhớ lại (có giới hạn) để bạn không phải nhập lại password mỗi lần sử dụng lại nó.

Đầu tiên, chỉ có tài khoản bạn tạo trong quá trình cài đặt mới có quyền truy cập sudo. Để cho phép các user khác có quyền này, bạn phải thêm các tài khoản đó vào nhóm admin.

[sửa] Sử dụng Sudo

Để sử dụng quyền root, chỉ cần mở terminal và gõ:

sudo <command>

Thay `<command>` bằng câu lệnh bạn muốn. Sudo sẽ hỏi password tài khoản thường; nhập vào và nhấn enter để chạy câu lệnh.

Giao diện đồ họa tương đương với `sudo` là `gksudo` & `kdesudo`. Khi một trong số những chương trình này chạy, một hộp thoại sẽ hiện lên yêu cầu bạn nhập password tài khoản thường. Nhập password của tài khoản bạn và nhấn Continue hoặc nhấn phím enter từ bàn phím.

Để chạy với quyền root, bạn nhập câu lệnh sau:

sudo -i

Lệnh này sẽ hỏi password tài khoản thường. Bạn nhập password rồi nhấn enter sẽ thấy dấu nhắc root.

[sửa] Tinh chỉnh dòng lệnh (aliases and inputrc)

Phần này được viết cho người dùng Mandrake/Mandriva, nhưng nói chung vẫn có thể áp dụng.

[sửa] Tiện ích Shell aliases

Mandriva định nghĩa aliases sau trong `/etc/profile.d/alias.sh`, làm cho shell sử dụng nhanh hơn. Có thể chạy ở `~/.bashrc`:

||`alias ls='ls -F --color=auto'` ||# make ls coloured, and append characters to denote filetype ( eg trailing / on directory names)|| ||`alias l='ls'` ||# short for ls|| ||`alias l.='ls -d .*'` ||# show only hidden files|| ||`alias la='ls -a'` ||# list all files|| ||`alias ll='ls -l'` ||# long format listing|| ||`alias lsd='ls -d */'` ||# list only directories|| ||`alias lx='ls -X'` ||# list, order by extension|| ||`alias p='cd -'` ||# previous directory|| ||`alias s='cd ..'` ||# short for cd ..|| ||`alias cd..='cd ..'` ||# allow omission of space in cd ..|| ||`alias rd='rmdir'` ||# Remove a directory|| ||`alias md='mkdir'` ||# Make a directory||

Những dòng tiếp theo sẽ tạo `cp`, `rm`, & mv một cách mặc địnhnên bạn không sợ ghi đè lên file nữa. Hầu hết người dùng nghĩ rằng điều này thật tiện lợi, nhưng một số khác nghĩ như vậy thật bất cẩn khi ai đó có thể as one might come to rely upon the implicit `-i`, on some other system which doesn't have it.

||`alias mv='mv -i'`|| ||`alias rm='rm -i'`|| ||`alias cp='cp -i'`||

Note that these aliases do not work when running a command as root using sudo. One workaround for this is to add `alias sudo="sudo "` to your `.bashrc` (note the extra space in the quotes). This will allow the first word after 'sudo' to be substituted if an alias exists.<<FootNote(Source: https://lists.ubuntu.com/archives/ubuntu-users/2005-June/039274.html)>>

[sửa] Tab Completion Enhancements

Mandriva defines the following in `/etc/inputrc`, which prints the list of options and then repeats the prompt where you were:

{{{ set show-all-if-ambiguous on }}}

Putting this in `/etc/inputrc` or `~/.inputrc` will add this function to Ubuntu.

[sửa] Âm nhạc, phim ảnh, chạy DVD và Java

Getting file formats restricted by patents or copyright such as movies and music to play on your Ubuntu system is simple (although not as simple as it could be). See RestrictedFormats. Java is simple too.

[sửa] Services, Chkconfig and Initscripts

Users of Red Hat and Mandriva will be used to configuring which services run by using `chkconfig` command. `chkconfig` is not available in Ubuntu, but you can install `sysv-rc-conf` instead.

To start and stop services, it's necessary to invoke the `init.d` script directly: `/etc/init.d/ssh start` rather than `service sshd start`. If you want to have the 'service' syntax back, add this to root's .bashrc:

{{{ function service (){ /etc/init.d/$@ ;} }}}

Since Intrepid, you can also install the following package: sysvinit-utils, which provides the `service` command.


Ubuntu runs in runlevel 3 by default, whereas !RedHat and Mandriva use runlevel 5 for graphics, and 3 for console. Ubuntu also has an extra rcX.d directory, `/etc/rcS.d`, which runs at boot-up. Packages like `udev` are started from `rcS.d`. There are some helpful README files in the `/etc/rcX.d` directories.

[sửa] Environment Variables (Biến môi trường)

See Environment Variables for a full guide to the use of environment variables in Ubuntu.

[sửa] Tài Liệu (trợ giúp)

There are a few good resources you can turn to if you need further help with Ubuntu, these include:

* http://help.ubuntu.com - The main source of Ubuntu documentation
* [http://www.ubuntuforums.org|Forums], [lists] and IRC (irc.freenode.net - #ubuntu)
* http://www.ubuntu-vn.org/ Cộng đồng Việt Nam


Xem bản Tiếng Anh tại: https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux
Công cụ cá nhân