Archive for the ‘linux/unix’ Category

 
Feb
23
Posted (xurenlu) in linux/unix on 02月-23-2008

Mono是这样一个Project:

Mono provides the necessary software to develop and run .NET client and server applications on Linux, Solaris, Mac OS X, Windows, and Unix. Sponsored by Novell (http://www.novell.com), the Mono open source project has an active and enthusiastic contributing community and is positioned to become the leading choice for development of Linux applications.

翻译过来是:

Mono为在linux/Solaris,Mac OS X,和Windows下开发和运行.NET客户端和服务程序提供了必要的软件支持。这个Mono 开源项目由Novell发起,拥有一批积极并且热心的开发者社区,希望能成为Linux 程序开发的首选。

第一步:安装Mono.我的pc是Fedora ,因此是yum install Mono, 如果在debian/ubuntu系列,应该用apt-get .
如果您没有类似在线包安装工具,那么您需要到http://www.go-mono.com/mono-downloads/download.html去下载并手动安装。
第二步:开始写了…

  1. #cd Program/Mono/
  2. #vim hello.cs

hello.cs的内容如下:

  1. class Hello{
  2.         static void Main(){
  3.                 System.Console.Write("Hello World\n");
  4.         }
  5. }

第三步:编译:

  1. mcs hello.cs

第四步:试运行:

  1. #mono hello.exe
  2. Hello world
  3. #

这个hello.exe您看到了,是以exe为后缀的。没错儿!它可以直接运行在Windows下!


Tag:
相关文章


     
    Feb
    23
    Posted (xurenlu) in linux/unix on 02月-23-2008

    64位机器就是不方便,包的测试总是不够全面。前几天发现一个依赖性问题,昨天更新又发现问题了

    1. Missing Dependency: libx264.so.56 is needed by package mencode

    这个提示有时是

    1. Missing Dependency: libx264.so.56 is needed by package ffmpeg-libs

    反正更新多媒体播放类软件时总是出现。
    Google到了解决办法:
    先updatedb一下,然后locate libx264,找到:
    /usr/lib64/libx264.so.58
    好了,现在运行yum remove /usr/lib64/libx264.so.58,这个命令在我的机器上的实质结果是把x264删了。
    ,再运行安装命令(我之间是yum install amarok),就能成功了。这次,又顺道把libx264.so.*给我装上了。


    Tag:
    相关文章


       
      Feb
      22
      Posted (xurenlu) in linux/unix, 杂谈 on 02月-22-2008

      今天想把fedora8升级到fedora9,结果先把fedora-release*的包升级以后,发现系统fedora源已经全部变成fedora9的了,但是因几个基本包有问题,我用yum安装什么包都装不了了。
      只好回退,结果遇上这样一个问题:

      1. Cannot retrieve repository metadata (repomd.xml) for repository:/var/cache/yum/fedora/mirrorlist.txt

      到处查,都搞不懂为什么。最后只好自己查查yum的源代码,再加上我天才般的瞎猜,终于整出来了:
      记下过程:
      手工建立/var/cache/yum/fedora/和/var/cache/yum/updates两个目录。
      编辑/var/cache/yum/fedora/mirrorlist.txt为

      1. # repo = fedora-8 arch = x86_64 country = CN country = RU country = JP country = HK country = KR country = TW country = TH country = IN
      2. http://fedora.candishosting.com.cn/pub/fedora/linux/releases/8/Everything/x86_64/os
      3. http://opensource.nchc.org.tw/fedora/linux/releases/8/Everything/x86_64/os
      4. http://ftp.twaren.net/Linux/Fedora/linux/releases/8/Everything/x86_64/os
      5. http://linux.ntcu.net/ftp/dists/fedora/releases/8/Everything/x86_64/os
      6. http://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora/linux/releases/8/Everything/x86_64/os
      7. http://ftp.hostrino.com/pub/fedora/linux/releases/8/Everything/x86_64/os
      8. ftp://ftp.rhd.ru/pub/fedora/linux/releases/8/Everything/x86_64/os
      9. http://ftp.cse.yzu.edu.tw/pub/Linux/Fedora/releases/8/Everything/x86_64/os
      10. http://ftp.chg.ru/pub/Linux/fedora/linux/releases/8/Everything/x86_64/os
      11. http://ftp.jaist.ac.jp/pub/Linux/Fedora/releases/8/Everything/x86_64/os
      12. http://ftp.ncnu.edu.tw/Linux/Fedora/linux/releases/8/Everything/x86_64/os
      13. http://allotter.yandex.net/fedora/linux/releases/8/Everything/x86_64/os
      14. http://ftp.kddilabs.jp/Linux/packages/fedora/releases/8/Everything/x86_64/os
      15. http://ftp.kaist.ac.kr/pub/fedora/linux/releases/8/Everything/x86_64/os
      16. ftp://ftp.sfc.wide.ad.jp/pub/Linux/Fedora/releases/8/Everything/x86_64/os
      17. http://ftp.riken.jp/Linux/fedora/releases/8/Everything/x86_64/os
      18. http://spreader.yandex.net/fedora/linux/releases/8/Everything/x86_64/os

      编辑/var/cache/yum/updates/mirrorlist.txt为:

      1. # repo = updates-released-f8 arch = x86_64 country = RU country = JP country = HK country = CY country = SG country = TW country = TH country = IN
      2. http://spreader.yandex.net/fedora/linux/updates/8/x86_64
      3. http://ftp.kddilabs.jp/Linux/packages/fedora/updates/8/x86_64
      4. http://allotter.yandex.net/fedora/linux/updates/8/x86_64
      5. http://ftp.hostrino.com/pub/fedora/linux/updates/8/x86_64
      6. http://ftp.riken.jp/Linux/fedora/updates/8/x86_64
      7. ftp://ftp.oss.eznetsols.org/linux/fedora/updates/8/x86_64
      8. ftp://ftp.sfc.wide.ad.jp/pub/Linux/Fedora/updates/8/x86_64
      9. http://opensource.nchc.org.tw/fedora/linux/updates/8/x86_64
      10. http://ftp.jaist.ac.jp/pub/Linux/Fedora/updates/8/x86_64
      11. http://mirrors.cytanet.com.cy/linux/fedora/linux/updates/8/x86_64

      大功告成。
      再运行yum install mplayer,一切正常。
      原因(个人瞎猜版):
      /var/cache/yum/下是yum的缓存目录。当我运行yum clean all时,把这两个目录下的一些文件清空了。但是可能yum存在一个bug,
      /var/cache/yum/fedora/repomd.xml能重新下载生成,/var/cache/yum/fedora/mirrotlist.txt却不能正常生成。因此需要我们手工构造这个文件。
      那我是怎么构造这个文件的内容的呢?
      注意看/etc/yum.repos.d/fedora.repod文件,中有

      1. mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch

      $releasever应该是8(我用的是fedora 8),$basearch是架构的意思,我的是x86_64,替换上,访问之,得到:

      1. # repo = fedora-8 arch = x86_64 country = CN country = RU country = JP country = HK country = KR country = TW country = TH country = IN
      2. http://fedora.candishosting.com.cn/pub/fedora/linux/releases/8/Everything/x86_64/os
      3. http://opensource.nchc.org.tw/fedora/linux/releases/8/Everything/x86_64/os
      4. http://ftp.twaren.net/Linux/Fedora/linux/releases/8/Everything/x86_64/os
      5. http://linux.ntcu.net/ftp/dists/fedora/releases/8/Everything/x86_64/os
      6. http://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora/linux/releases/8/Everything/x86_64/os
      7. http://ftp.hostrino.com/pub/fedora/linux/releases/8/Everything/x86_64/os
      8. ftp://ftp.rhd.ru/pub/fedora/linux/releases/8/Everything/x86_64/os
      9. http://ftp.cse.yzu.edu.tw/pub/Linux/Fedora/releases/8/Everything/x86_64/os
      10. http://ftp.chg.ru/pub/Linux/fedora/linux/releases/8/Everything/x86_64/os
      11. http://ftp.jaist.ac.jp/pub/Linux/Fedora/releases/8/Everything/x86_64/os
      12. http://ftp.ncnu.edu.tw/Linux/Fedora/linux/releases/8/Everything/x86_64/os
      13. http://allotter.yandex.net/fedora/linux/releases/8/Everything/x86_64/os
      14. http://ftp.kddilabs.jp/Linux/packages/fedora/releases/8/Everything/x86_64/os
      15. http://ftp.kaist.ac.kr/pub/fedora/linux/releases/8/Everything/x86_64/os
      16. ftp://ftp.sfc.wide.ad.jp/pub/Linux/Fedora/releases/8/Everything/x86_64/os
      17. http://ftp.riken.jp/Linux/fedora/releases/8/Everything/x86_64/os
      18. http://spreader.yandex.net/fedora/linux/releases/8/Everything/x86_64/os

      这就是/var/cache/yum/fedora/mirrorlist.txt的内容了。
      对应地,查看/etc/yum.repos.d/fedora-updates.repo,去访问对应的地址,取得内容写入到/var/cache/yum/updates/mirrorlist.txt.


      Tag:
      相关文章