LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3479|回复: 10

拆掉 Gentoo 发动机的麻烦。

[复制链接]
发表于 2003-11-8 01:05:34 | 显示全部楼层 |阅读模式
今天,想升级 python,但昏了头,执行了这条语句:
emerge unmerge python
一切顺利,不过再也无法 emerge 乐。想想真好笑,就像医生无法给自己做心脏手术一样,Gentoo 中你也不能 unmerge python。但我确实在我的 Gentoo 中这么做了,而且,emerge 很愉快地完成了这个工作。当然,我可以重装 Gentoo,或者,Gen to lfs 算了。这样多少让人不甘心。好吧,再查查 man 。emerge 中有这样一个选项:

  1. --buildpkg (-b)
  2.    Tells  emerge  to build binary packages for all ebuilds processed in addition
  3.    to actually merging the packages.  Useful for maintainers or if you  adminis-
  4.    trate  multiple  Gentoo  Linux systems (build once, emerge tbz2s everywhere).
  5.    The package will be created in the ${PKGDIR}/All directory.   An  alternative
  6.    for  already-merged packages is to use quickpkg which creates a tbz2 from the
  7.    live filesystem.
复制代码

就是它!用这个选项,你可以生成一个编译好的 tbz2 包,它的目录结构与安装后的结构一致。只要 tar 出来就可以。但我的 Gentoo 中 emerge 已经无法使用,不可能生成这个包。所以,得请其他医生来完成这个手术。幸好,我的笔记本也装着 Gentoo,完全胜任此事。不过,有一点要注意:我的笔记本与台式机的 CPU 不同,/etc/make.conf 的 CFLAGS 自然不同。要将笔记本的 CFLAGS 改为台式机的 CFLAGS。然后执行:
emerge -b python
完成后,在 /usr/portage/ALL/ 目录下,有 python-2.2.3-r1.tbz2 这个文件。传到台式机上,执行

  1. cd /
  2. tar jxvf python-2.2.3-r1.tbz2
复制代码

现在,emerge 可以用乐。要保证台式机 python 的原汁原味,在台式机上执行
emerge python
即可。怎么样?简单吧。

一些闲话
Linux 中,遇到系统损坏或者崩溃,重新安装系统是最后的方法,很少能够用到。绝大多数可以用各种各样的工具和方法修复,因为他所有的东西都是开放的。只要肯花一点时间,搞清楚原理,总可以找到解决问题的办法。自从我的台式机和笔记本装上 Gentoo ,已经一年多,还未曾重新装过系统。其间,台式机因为超频,损坏了一个系统库文件,最后用 Gentoo 的 LiveCD 起动后修复了文件系统,一直稳定运行至今。我是一个智力平平的IT人,但用自由软件却让我有一种变聪明的感觉。这也是我喜欢自由软件的原因吧。今天,再一次体会到使用自由软件那种自由的快乐。
发表于 2003-11-8 04:47:53 | 显示全部楼层
喜欢。。。。

对于python你可以自己下载安装啊。。。。
发表于 2003-11-8 08:33:44 | 显示全部楼层
If you want to update python, you can just type emerge python.
发表于 2003-11-8 17:52:11 | 显示全部楼层
索性我们把参数都弄明白。。。。

Options:
       --buildpkg (-b short option)
              tell emerge to build binary packages for all ebuilds processed
              (in addition to actually merging the packages.  Useful for
              maintainers or if you administrate multiple Gentoo Linux
              systems (build once, emerge tbz2s everywhere).

       --buildpkgonly (-B short option)
              Creates a binary package, but does not merge it to the
              system. This has the restriction that unsatisfied dependencies
              must not exist for the desired package as they cannot be used if
              they do not exist on the system.

       --changelog (-l short option)
              When pretending, also display the ChangeLog entries for packages
              that will be upgraded.

       --columns
              Display the pretend output in a tabular form. Versions are
              aligned vertically.

       --debug (-d short option)
              Tell emerge to run the ebuild command in --debug mode. In this
              mode, the bash build environment will run with the -x option,
              causing it to output verbose debug information print to stdout.
              --debug is great for finding bash syntax errors as providing
              very verbose information about the dependency and build process.

       --deep (-D short option)
              When used in conjunction with --update, this flag forces emerge
              to consider the entire dependency tree of packages, instead of
              checking only the immediate dependencies of the packages.  As an
              example, this catches updates in libraries that are not directly
              listed in the dependencies of a package.

       --emptytree (-e short option)
              Virtually tweaks the tree of installed packages to only contain
              glibc, this is great to use together with --pretend. This makes
              it possible for developers to get a complete overview of the
              complete dependency tree of a certain package.

       --fetchonly (-f short option)
              Instead of doing any package building, just perform fetches for
              all packages (main package as well as all dependencies.) When
              used in combination with --pretend all the SRC_URIs will be
              displayed multiple mirrors per line, one line per file.

       --getbinpkg (-g short option)
              Using the server and location defined in PORTAGE_BINHOST, portage
              will download the information from each binary file there and it
              will use that information to help build the dependency list. This
              option implies '-k'. (Use -gK for binary-only merging.)

       --getbinpkgonly (-G short option)
              This option is identical to -g, as above, except it will not use
              ANY information from the local machine. All binaries will be
              downloaded from the remote server without consulting packages
              existing in the packages directory.

       --noconfmem
              Portage keeps track of files that have been placed into
              CONFIG_PROTECT directories, and normally it will not merge the
              same file more than once, as that would become annoying. This
              can lead to problems when the user wants the file in the case
              of accidental deletion. With this option, files will always be
              merged to the live fs instead of silently dropped.

       --nodeps (-O short option)
              Merge specified packages, but don't merge any dependencies.
              Note that the build may fail if deps aren't satisfied.

       --noreplace (-n short option)
              Skip the packages specified on the command-line that have
              already been installed.  Without this option, any packages,
              ebuilds, or deps you specify on the command-line *will* cause
              Portage to remerge the package, even if it is already installed.
              Note that Portage won't remerge dependencies by default.

       --nospinner
              Disables the spinner regardless of terminal type.

       --oneshot
              Emerge as normal, but don't add packages to the world profile for
              later updating. This prevents consideration of this package
              unless this package is depended upon by another package.

       --onlydeps (-o short option)
              Only merge (or pretend to merge) the dependencies of the
              specified packages, not the packages themselves.

       --pretend (-p short option)
              instead of actually performing the merge, simply display what
              ebuilds and tbz2s *would* have been installed if --pretend
              weren't used.  Using --pretend is strongly recommended before
              installing an unfamiliar package.  In the printout, N = new,
              U = updating, R = replacing, B = blocked by an already installed
              package, D = possible downgrading. --verbose causes affecting
              use flags to be printed out accompanied by a '+' for enabled
              and a '-' for disabled flags.

       --quiet (-q short option)
              Effects vary, but the general outcome is a reduced or condensed
              output from portage's displays.

       --resume
              Resumes the last merge operation. Can be treated just like a
              regular merge as --pretend and other options work along side.
              'emerge --resume' only returns an error on failure. Nothing to
              do exits with a message and a success condition.

       --searchdesc (-S short option)
              Matches the search string against the description field as well
              the package's name. Take caution as the descriptions are also
              matched as regular expressions.
                emerge -S html
                emerge -S applet
                emerge -S 'perl.*module'

       --skipfirst
              This option is only valid in a resume situation. It removes the
              first package in the resume list so that a merge may continue in
              the presence of an uncorrectable or inconsequential error. This
              should only be used in cases where skipping the package will not
              result in failed dependencies.

       --update (-u short option)
              Updates packages to the best version available, which may not
              always be the highest version number due to masking for testing
              and development.

       --upgradeonly (-U short option)
              Updates packages, but excludes updates that would result in a
              lower version of the package being installed. SLOTs are
              considered at a basic level.

       --usepkg (-k short option)
              Tell emerge to use binary packages (from $PKGDIR) if they are
              available, thus possibly avoiding some time-consuming compiles.
              This option is useful for CD installs; you can export
              PKGDIR=/mnt/cdrom/packages and then use this option to have
              emerge "pull" binary packages from the CD in order to satisfy
              dependencies.

       --usepkgonly (-K short option)
              Like --usepkg above, except this only allows the use of binary
              packages, and it will abort the emerge if the package is not
              available at the time of dependency calculation.

       --verbose (-v short option)
              Effects vary, but the general outcome is an increased or expanded
              display of content in portage's displays.

       --version (-V short option)
              Displays the currently installed version of portage along with
              other information useful for quick reference on a system. See
              emerge info for more advanced information.
发表于 2003-11-8 18:24:25 | 显示全部楼层
mm你怎么天天换头啊? 以前那个白衣服女孩挺好看的.
 楼主| 发表于 2003-11-8 18:30:35 | 显示全部楼层
当然可以自己下载 python,手动安装。但用 emerge 安装的好处是,你不用再考虑打补丁和安装目录打问题。我很懒的,你知道。
当然,产生这个麻烦的原因是我当时昏了头。
发表于 2003-11-8 21:03:54 | 显示全部楼层
兄弟的方法很不错;)
 楼主| 发表于 2003-11-8 22:19:58 | 显示全部楼层
hehe, 歪打正着,这应该是 emerge -b 的附加功能罢。
推广一下,这个方法可以在本机无法 emerge 时采用。
发表于 2003-11-9 02:40:07 | 显示全部楼层
最初由 Debentoo Gao 发表
兄弟的方法很不错;)

兄弟的人头很酷
发表于 2003-11-9 03:34:49 | 显示全部楼层

3ks ;)

最初由 moonhalf 发表
兄弟的人头很酷
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表