How To Set Up A Local Yum Repository On Fedora 9

Linux July 29th, 2008

This tutorial shows how to create a Fedora 9 yum repository for your local network. Having a local Fedora mirror is good if you have to install multiple systems in your local network because then all needed packages can be downloaded over the fast LAN connection, thus saving your internet bandwidth.

I do not issue any guarantee that this will work for you!

1. Preliminary Note

In this tutorial I use the hostname server1.example.com with the IP address 192.168.100.10 and port 9090. These settings might differ for you, so you have to replace them where appropriate.

I want to make the yum repository accessible through http; Apache’s default document root on Fedora is /var/www/html, so I’ll create the repository in /var/www/html/yum. If you’re using a different vhost, you might have to adjust the paths.

2. Installing Apache

Let’s install Apache:

yum install httpd

Afterwards, we create the system startup links for Apache (so that Apache starts automatically when the system boots):

chkconfig --levels 235 httpd on

Then we start Apache:

/etc/init.d/httpd start

3. Building The Repository

First we install the tool createrepo:

yum install createrepo

I want to place the Fedora 9 rpm packages for i386 in /var/www/html/yum/base/9/i386 and the update packages in /var/www/html/yum/updates/9/i386, so I create these directories now (adjust the paths if you want to create a repository for Fedora 8/7/… and/or x86_64):

mkdir -p /var/www/html/yum/base/9/i386
mkdir -p /var/www/html/yum/updates/9/i386

Now let’s fill the /var/www/html/yum/base/9/i386 directory. The easiest way is to insert your Fedora 9 DVD (which you can download from here: http://mirrors.fedoraproject.org/mirrorlists/publiclist/Fedora/9), mount it, and copy the rpm packages to /var/www/html/yum/base/9/i386:

mount /dev/cdrom /mnt
cd /mnt/Packages
cp -v * /var/www/html/yum/base/9/i386
cd /
umount /mnt

The DVD contains just a basic set of packages. If you’d like to have all available Fedora 9 packages in the /var/www/html/yum/base/9/i386 directory, you can download the packages (using rsync) from the Everything folder on a Fedora 9 mirror. Go to http://mirrors.fedoraproject.org/mirrorlists/publiclist/Fedora/9, find a mirror that offers rsync, and download the packages as follows (this can take a long time so be patient):

rsync -avrt rsync://ftp-stud.hs-esslingen.de/fedora/linux/releases/9/Everything/i386/os/Packages/ /var/www/html/yum/base/9/i386

(Please make sure you use all slashes as shown above – it must be rsync://ftp-stud.hs-esslingen.de/fedora/linux/releases/9/Everything/i386/os/Packages/, not rsync://ftp-stud.hs-esslingen.de/fedora/linux/releases/9/Everything/i386/os/Packages!)

Afterwards, run the createrepo command:

createrepo /var/www/html/yum/base/9/i386

This will create a repodata directory in the /var/www/html/yum/base/9/i386 directory. Its contents should be as follows:

ls -l /var/www/html/yum/base/9/i386/repodata/

[root@server1 /]# ls -l /var/www/html/yum/base/9/i386/repodata/
total 9268
-rw-r--r-- 1 root root 2227275 2007-12-18 21:11 filelists.xml.gz
-rw-r--r-- 1 root root 6487453 2007-12-18 21:11 other.xml.gz
-rw-r--r-- 1 root root 747714 2007-12-18 21:11 primary.xml.gz
-rw-r--r-- 1 root root 951 2007-12-18 21:11 repomd.xml
[root@server1 /]#

Now let’s fill the updates directory /var/www/html/yum/updates/9/i386. Go to http://mirrors.fedoraproject.org/mirrorlists/publiclist/Fedora/9 again, find a mirror that offers rsync, and download the packages as follows:

rsync -avrt rsync://mirror.internode.on.net/fedora-enchilada/linux/updates/9/i386/ --exclude=debug/ /var/www/html/yum/updates/9/i386

Again, make sure that you use the slashes (/) as shown above!

To make our local mirror download the latest updates automatically from now on, we can create a cron job. For example, to download the latest updates every second day at 04:23h, we create the following cron job:

crontab -e
23 4 */2 * * /usr/bin/rsync -avrt rsync://mirror.internode.on.net/fedora-enchilada/linux/updates/9/i386/ --exclude=debug/ /var/www/html/yum/updates/9/i386

Our local yum mirror is now ready to be used.

4. Client Configuration

To make our Fedora 9 systems use the new local yum repository, we modify /etc/yum.conf on each Fedora 9 system (you can even do this on the mirror itself if it is a Fedora 9 system). Create new file /etc/yum.repos.d/local.repo with these lines:

[base-local]
name=Fedora $releasever - $basearch
failovermethod=priority
baseurl=http://mirror.iwayvietnam.com:9090/yum/base/$releasever/$basearch
enabled=1
gpgcheck=0

[updates-newley-local]
name=Fedora $releasever - $basearch - Updates Newkey
failovermethod=priority
baseurl=http://mirror.iwayvietnam.com:9090/yum/updates/$releasever/$basearch.newkey/
enabled=1
gpgcheck=0

And finally, disable the existing fedora-updates-newkey by this command:

mv /etc/yum.repos.d/fedora-updates-newkey.repo /etc/yum.repos.d/fedora-updates-newkey.repo.bak

Now whenever you use yum and your local repository can serve the requested packages, the packages are downloaded and installed from the local yum repository.

5. Links

Zimbra Desktop – giải pháp Yahoo Mail, Gmail hoạt động offline

Weekly Tips, Zimbra July 29th, 2008

Kết quả của cuộc sáp nhập 350 triệu USD giữa Yahoo và Zimbra là phần mềm e-mail cho phép người dùng đọc nội dung trong hòm thư Yahoo Mail, AOL, Gmail… cả khi máy tính bị ngắt kết nối Internet.

Khi máy tính chưa nối mạng, người sử dụng Yahoo Zimbra Desktop vẫn có thể kéo thả thông điệp vào các thư mục (folder), tạo chữ ký… hay soạn e-mail để lưu vào Outbox và nó sẽ được tự động gửi đi khi hệ thống online trở lại.

“Chúng tôi muốn xóa bỏ khoảng cách giữa ứng dụng web sử dụng tổ hợp công nghệ AJAX và ứng dụng desktop truyền thống”, kỹ sư Mike Morse của Zimbra viết trên blog.

Phần mềm tạo cảm giác như mọi người đang dùng Microsoft Outlook hay Mozilla Thunderbird. Zimbra Mail, Yahoo Mail, Gmail, AOL, Outlook và bất cứ hòm thư cá nhân nào hỗ trợ POP hoặc IMAP đều có thể được cài đặt vào Yahoo Zimbra Desktop để đọc e-mail offline.

Tuy nhiên, Zimbra Desktop tương đối nặng, như dành cho Windows là 48 MB, Mac OS X là 42 MB còn Linux là 52 MB. Tải Yahoo Zimbra Desktop miễn phí tại đây.

PDF Download

Weekly Tips July 28th, 2008

Use PDF Download to do whatever you like with PDF files on the Web. Regain control of them and eliminate browser problems, view PDFs directly in Firefox as HTML, and use the all-new Web-to-PDF toolbar to save and share Web pages as high-quality PDF files.

More information: https://addons.mozilla.org/en-US/firefox/addon/636

Đi nghỉ ít nhất 3 ngày mới thỏa mãn

Work and Life July 25th, 2008

Lần tới khi bạn lên kế hoạch đi nghỉ mát, hãy đảm bảo chuyến đi kéo dài hơn 3 ngày, nếu không bạn sẽ khó có đủ thời gian để kịp hưởng thụ và và thư giãn.

Các chuyên gia đã chỉ ra chính xác thời điểm chúng ta bắt đầu cảm thấy được thư giãn – đó là 9 giờ 25 phút của ngày thứ 3.

Những căng thẳng từ việc đặt chỗ, chuẩn bị và đi lại khiến ngày đầu tiên trở nên mệt mỏi, ngày thứ 2 là để hồi phục dần, sắp xếp đồ đạc và ổn định chỗ ở. Đến ngày thứ 3 mới là lúc để thư giãn.

Cuộc nghiên cứu trên 3.000 nhà tổ chức du lịch cho thấy chúng ta mất nhiều thời gian để lên kế hoạch và nghiên cứu chuyến đi hơn là để thưởng thức nó.

Một người trung bình mất 18 ngày để chọn lựa điểm đến. Sau đó họ mất thêm 9 tiếng để chọn khách sạn, 8 giờ mua sắm, giặt là và đóng gói đồ đạc, và 2 giờ để vệ sinh cơ thể.

Dave McKenna, Giám đốc marketing của hãng Keycamp, Anh, nói: “Kết quả cho thấy mọi người cần phải học cách để thư giãn. Họ thường mất quá nhiều thời gian vào việc nghiên cứu và lên kế hoạch cho chuyến đi, mà dường như quên mất là mình đang cần được nghỉ ngơi. Chúng ta cần phải tận hưởng thời gian quý giá mỗi khi được đi nghỉ”.

Không may là 16% cho biết khi đến được nơi mình muốn, họ không cảm thấy thỏa đáng với những gì mình bỏ ra. Hơn 15% không có đủ thời gian để thực hiện các hoạt động mà họ đã cất công lên kế hoạch. Tồi hơn nữa là 25% không thực sự thấy thoải mái khi nghĩ đến lúc phải về nhà và đối mặt với những vấn đề tồn đọng.

M.T. (theo Daily Mail)

Whack and SparkWeb have graduated. Help me congratulate them!

Announcements, OpenOffice July 18th, 2008

Whack 1.0 has been released. Whack is our Open Source XMPP (Jabber) component library for XMPP components. External components are processes that run outside of the Openfire’s process but can connect to the server to register new XMPP service. Whack is an implementation of XEP-0114: Jabber Component Protocol.

Unlike the other igniterealtime products, Whack followed a different evolution path. We started coding Whack around November 2004 and after a few months it was operational. Openfire and Whack share the same component’s API so around 2005 we were able to run Fastpath as an internal component (i.e. running in the Openfire’s process) or just move it as an external component using Whack. It was impressive seeing the same code running as internal and external. Since then Whack continued to evolve but always at a very slow pace. Whack was always stable in each step but it was just not ready for prime time. We wanted to keep adding more things to it to reach a 1.0 release. Since our collaboration software Clearspace uses Whack to integrate with Openfire we needed to push the boundaries of Whack once again and I’m happy to say that we now reached the 1.0 release. And that is why we decided to make a public release in 2008 after 4 years of continuous but slow growth.

A few months ago we also released a new product called SparkWeb. SparkWeb is our Open Source web-based IM client. SparkWeb is based on XIFF just like Spark is based on Smack. Today we updated the products page to list SparkWeb as an official product. Welcome SparkWeb! The family has grown a little bit now.

You can get Whack from here. Questions could be posted to the Whack forum.

SparkWeb can be downloaded from here. If you want to build from the source code you can read the Getting and Building SparkWeb document.