Showing posts with label updating gentoo. Show all posts
Showing posts with label updating gentoo. Show all posts

Tuesday, September 18, 2007

Removing orphaned dependencies in Gentoo

(link to Gentoo documentation on Portage)
emerge --update --newuse --deep --ask world
revdep-rebuild -X -av

emerge --depclean

Thursday, January 25, 2007

Gentoo configuration issues (2)




Updating configuration files in gentoo
=======
* Regenerating GNU info directory index...
* Processed 160 info files.
* IMPORTANT: 34 config files in /etc need updating.
* Type emerge --help config to learn how to update config files.
=======
In this case run the command: #etc-update


To add a service to the start up runlevel (so it will start every time the machine is reinitiated)

Adding to the run level:
# rc-update add gpm default
# rc-update add sshd default

To find a string:
Goto the applications folder, then:
grep -inr searchterm *
Ex: grep -inr localhost.localdomain *
This should show you all the files that contain that string.


3) Gentoo Method

Gentoo also uses a script to enable or disable services during boot-up. The name of the script is rc-update . Gentoo has three default runlevels. Them being: boot, default and nonetwork. Suppose I want to add the apache webserver to start in the default runlevel, then I run the command:
# rc-update add apache2 default
... and to remove the webserver, it is as simple as :
# rc-update del apache2
To see all the running applications at your runlevel and their status, similar to what is achieved by chkconfig --list, you use the rc-status command.
# rc-status --all

Gentoo configuration issues










To update the entire system
#emerge --update --deep --newuse --ask world

To manage blocked packages
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked
To un emerge the blocked packages:
#emerge --unmerge pckgname

Upgrade guide
http://www.gentoo.org/doc/en/new-upgrade-to-gentoo-1.4.xml

1. Before you begin

Be prepared

As with any major upgrade to the core of your Gentoo system, there is always the possibility that unforeseen problems will ensue. It is always prudent to back up all important data before beginning this process. If possible, try to allocate a large block of time for this upgrade, so that you will not feel rushed. All the software on your machine will need to be recompiled.

Other options

This is not the only way to upgrade your system. You can install a new 1.4 system onto a separate partition and reuse some of your system configuration instead. This method also has the advantage that you can always go back to your old system in the meantime as a fallback. You may also decide to simply not upgrade your system. If you decide you want to upgrade in place, read on.

General notes

Whenever the code listings suggest running the emerge command, it is always a good idea to make a test run of the command using the -p or --pretend option to make sure that the command will do what you expect it to do.

2. Upgrading in place

Get Portage as current as possible

Some of the syntax of current ebuilds is unreadable by older versions of Portage. If you don't have at least Portage 2.0.44, try upgrading Portage.

Code Listing 2.1: Updating Portage

# emerge --sync
# emerge -u portage

Note: If your Portage version is very old, you may get an error message containing the phrase "unscriptable object". Read and follow the instructions in /usr/portage/sys-apps/portage/files/README.RESCUE. Your Portage install should then be current.

Preparing GCC for cohabitation

You will be installing a newer version of GCC during this upgrade. Versions of GCC older than 2.95.3-r8 are not designed to have multiple versions of GCC installed. You must therefore upgrade GCC to at least version 2.95.3-r8. This will also have the beneficial side-effect of installing the gcc-config package on your system, which can be used to switch back and forth between various installed versions of GCC.

Code Listing 2.2: Updating GCC

# emerge -u gcc 

You can now check to see if gcc-config is working properly:

Code Listing 2.3: Verifying GCC profile

# gcc-config --get-current-profile 

This should return i686-pc-linux-gnu-2.95.3 on most x86 systems. Older systems may return i586-pc-linux-gnu-2.95.3.

Installing GCC 3

Now you can install a newer version of GCC without damaging your current compiler. Look in /usr/portage/sys-devel/gcc for a version of the GCC ebuild that is at least 3.2.1-r6. Choose the highest version that is marked stable for your architecture. To see if an ebuild is considered stable for your architecture, look for the KEYWORDS line in the ebuild file. If it has your architecture listed without a ~ in front of it, it is considered stable. Assuming 3.2.2 is the most current stable version, we first need to remove the glibc dependency from gcc.

Edit /usr/portage/sys-devel/gcc/gcc-3.2.2.ebuild and search for the line containing DEPEND. Remove the glibc dependency and save the ebuild.

Code Listing 2.4: Editing gcc-3.2.2.ebuild

# vim /usr/portage/sys-devel/gcc/gcc-3.2.2.ebuild 

Now install the latest GCC version on your system:

Code Listing 2.5: Install the latest GCC

# USE="-java" emerge /usr/portage/sys-devel/gcc/gcc-3.2.2.ebuild 

Changing profiles

Now you need to change two sets of profiles: your gcc-config profile and your Portage profile.

Code Listing 2.6: Change the Portage profile

# cd /etc
# rm make.profile
(Replace "x86" with your architecture)
# ln -s ../usr/portage/profiles/default-x86-1.4 make.profile

Code Listing 2.7: Change the GCC profile

(Note the one for the version you just emerged, use it below)
# gcc-config --list-profiles
(Replace with the version you noted above)
# gcc-config i686-pc-linux-gnu-3.2.2

Recompile toolchain

Now you need to recompile your core toolchain with your new compiler. If you are continuing in the same shell, you need to run source /etc/profile as gcc-config instructed you to. Then emerge glibc and binutils using your new compiler:

Code Listing 2.8: Rebuilding the toolchain

# emerge glibc binutils 

Warning: It is quite likely that you will upgrade glibc from a 2.2 or older version to 2.3. Do not downgrade glibc afterwards. Any software you have compiled against glibc 2.3 will stop working, and this can make your system unusable.

Recompiling everything with your new compiler

Now you may recompile everything on your system with your new compiler:

Code Listing 2.9: Rebuilding the entire system

# emerge -e world 

Note: If this command fails at any point due to errors, you can use emerge --resume to continue the process where you left off. This requires Portage 2.0.47 or later.

Sunday, September 17, 2006

Aguila server (updating gentoo)

aguila acardh # emerge --update --ask world

!!! Your current profile is deprecated and not supported anymore.
!!! Please upgrade to the following profile if possible:
default-linux/x86/2006.1/desktop

To upgrade do the following steps:
# There are several possible profiles that you can use to replace this one.

# default-linux/x86/2006.1
# default-linux/x86/2006.1/desktop
# default-linux/x86/2006.1/server
# default-linux/x86/no-nptl
# default-linux/x86/no-nptl/2.4

# By default, we use the desktop profile.

# emerge -n '>=sys-apps/portage-2.0.51'
# cd /etc
# rm make.profile
# ln -s ../usr/portage/profiles/default-linux/x86/2006.1/desktop make.profile

# This profile is deprecated and will be removed on or after November 1, 2006
====================
Automated
(View available profiles)
# eselect profile list

(Select the number of your desired profile from the list)
# eselect profile set
========