Working on yum for RPM-based distributions(Notes)

Setting Up a yum Repository

7.1. Getting the Packages


If you can’t work with DVD-sized files, you can still create a local repository. For example, if you’ve downloaded the four Fedora Core 4 binary CDs, all you need to do is mount the CDs one at a time, and copy their contents (including the .discinfo file from the first CD) to the directory of your choice. For example, you could run the following commands:

mount -o loop FC4-i386-disc1.iso /media/cdrecorder

cp -ar /media/cdrecorder/* \


If it’s the first CD, don’t forget to copy the .discinfo file to the noted directory. Change CDs:

mount -o loop FC4-i386-disc2.iso /media/cdrecorder

cp -ar /media/cdrecorder/* \


2. installing yum

rpm -Uvh /media/cdrecorder/Fedora/RPMS/yum*
rpm -Uvh /media/cdrecorder/Fedora/RPMS/createrepo*

2-1 header creation.

The createrepo command now creates metadata from the headers in XML format

Python sys.path…

python sys模块包含了与python解释器和它的环境有关的函数,这个你可以通过dir(sys)来查看他里面的方法和成员属性

里面有个 sys.path属性。他是一个list.默然情况下python导入文件或者模块的话,他会先在sys.path里找模块的路径。如果没有的话,


所以我们一般自己写程序的话。最好把自己的模块路径给加到当前模块扫描的路径里,eg: sys.path.append(‘你的模块的名称’),这样程序就不会


我感觉python sys.path和python 这2个东西开始学的时候比较容易出问题。所以要注意下。

如果对这个兴趣,可以看看相关的: [python path] [python os.system]