Difference between revisions of "DeveloperWiki:usrlib"

From ArchWiki
Jump to: navigation, search
m (Use ls -ld to show only /lib directory itself, avoiding unecessary output)
(25 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
[[Category:DeveloperWiki]]
 
All files in the /lib directory have been moved to /usr/lib and now /lib is a symlink to usr/lib.
 
All files in the /lib directory have been moved to /usr/lib and now /lib is a symlink to usr/lib.
  
Line 8: Line 9:
  
  
Firstly...  '''DO NOT USE --force!'''  This will seriously break your system.  If you are coming to this guide too late and you have already used --force...  there are ways to fix your system.  [https://bbs.archlinux.org/viewtopic.php?pid=1126667#p1126667 These] [https://bbs.archlinux.org/viewtopic.php?pid=1127251#p1127251 two] do not even require a rescue disk.
+
{{Warning|1='''DO NOT USE --force!'''  This will seriously break your system.  If you are coming to this guide too late and you have already used --force...  there are ways to fix your system.  [https://bbs.archlinux.org/viewtopic.php?pid=1126667#p1126667 These] [https://bbs.archlinux.org/viewtopic.php?pid=1127251#p1127251 two] do not even require a rescue disk.}}
 +
 
 +
 
 +
 
 +
{{Note|for installs that have not been updated to glibc-2.16, it will save you lots of time and prevent major breakage to do:
 +
<nowiki>pacman -U http://pkgbuild.com/~allan/glibc-2.16.0-1-<arch>.pkg.tar.xz</nowiki>
 +
where <arch> is replaced by i686 or x86_64 as required. Add a single "-d" if needed. The instructions below assume that this has been done.}}
  
  
Line 16: Line 23:
 
  pacman -Su
 
  pacman -Su
  
 +
To be safe, also regenerate your initramfs after finishing:
  
There are two possible issues that might occur during this update.
+
mkinitcpio -p linux
  
 +
 +
 +
There are two possible issues that might occur during this update.
  
 
==Issue 1: glibc dependency errors==
 
==Issue 1: glibc dependency errors==
  
If running "pacman -Syu --ignore glibc" gives:
+
If running "pacman -Syu --ignore glibc,curl" gives:
  
 
  warning: ignoring package glibc-2.16.0-2
 
  warning: ignoring package glibc-2.16.0-2
Line 34: Line 45:
 
  Do you want to skip the above packages for this upgrade [y/N]
 
  Do you want to skip the above packages for this upgrade [y/N]
  
Say "y" to skipping the packages, then install them using:
+
Say "y" to skipping the packages, then install them all using (e.g.):
  
 
  pacman -Sd binutils gcc gcc-libs
 
  pacman -Sd binutils gcc gcc-libs
 +
 +
{{Warning|1=If pacman is part of this list, install the glibc-2.16.0-1 package from the above note first, to prevent breakage.}}
  
 
Note the use of a single "-d" only ignores the versioning of dependencies and not the actual dependency itself. Then finish the update using:
 
Note the use of a single "-d" only ignores the versioning of dependencies and not the actual dependency itself. Then finish the update using:
  
 
  pacman -Su
 
  pacman -Su
 
  
 
==Issue 2: The final "pacman -Su" still has conflicts in /lib==
 
==Issue 2: The final "pacman -Su" still has conflicts in /lib==
  
This means that you have files or folders still in /lib or pacman thinks a package apart from glibc still own /lib.  You can see which package own files in /lib by using:
+
===Packages that own files in /lib===
 +
If after this the "pacman -Su" still has conflicts with /lib, this is likely because a package on your system '''other than glibc''' owns files in /lib.  Such packages can be detected using:
  
  find /lib -exec pacman -Qo -- '{}' \+
+
  $ grep '^lib/' /var/lib/pacman/local/*/files
  
If any package apart from glibc is listed as owning a file, that package needs to be updated to install its files in /usr/lib.  Any files unowned by a package should be moved to /usr/lib and any directories within /lib need deleted (after they are empty...).
+
These packages need rebuilding so as not to include the /lib directory. They can also simply be uninstalled and reinstalled again after upgrading glibc.  The the final "pacman -Su" will successfully install glibc if there are no untracked files (see the next section).
 +
 
 +
===Unpackaged files===
 +
 
 +
This means that you have files or folders still in /lib or pacman thinks a package apart from glibc still own /lib.  You can see which package own files in /lib by using:
  
If after this the "pacman -Su" still has conflicts with /lib, this is because a package on your system other than glibc thinks it owns the /lib folder.  Such packages can be detected using:
+
$ find /lib -exec pacman -Qo -- {} +
  
grep -R --include files "^lib/" /var/lib/pacman/local/
+
If any package apart from glibc is listed as owning a file, that package needs to be updated to install its files in /usr/lib.  Any files unowned by a package should either be deleted or moved to /usr/lib and any directories within /lib need deleted (after they are empty...).
  
These packages need rebuilding so as not to include the /lib directory. Then the final "pacman -Su" will successfully install glibc.
+
One common source of files in /lib is left overs from running depmod after upgrading the kernel, but prior to reboot. The kernel modules included with the {{pkg|linux}} package in the repositories are now stored in {{ic|/usr/lib/modules}}.
  
 +
==Success==
  
 
You can confirm the update is complete by looking in your root directory to see that lib is a symlink to usr/lib.
 
You can confirm the update is complete by looking in your root directory to see that lib is a symlink to usr/lib.
  
> ls -ld /lib
+
{{hc|$ ls -ld /lib|lrwxrwxrwx  1 root root    7 Jul 11 21:10 lib -> usr/lib}}
lrwxrwxrwx  1 root root    7 Jul 11 21:10 lib -> usr/lib
+

Revision as of 22:23, 30 October 2012

All files in the /lib directory have been moved to /usr/lib and now /lib is a symlink to usr/lib.

During this update, pacman will identify a conflict in the /lib directory with the message:

error: failed to commit transaction (conflicting files)
glibc: /lib exists in filesystem
Errors occurred, no packages were upgraded.


Warning: DO NOT USE --force! This will seriously break your system. If you are coming to this guide too late and you have already used --force... there are ways to fix your system. These two do not even require a rescue disk.


Note: for installs that have not been updated to glibc-2.16, it will save you lots of time and prevent major breakage to do:
pacman -U http://pkgbuild.com/~allan/glibc-2.16.0-1-<arch>.pkg.tar.xz
where <arch> is replaced by i686 or x86_64 as required. Add a single "-d" if needed. The instructions below assume that this has been done.


In the simplest case, the update can be performed by doing:

pacman -Syu --ignore glibc
pacman -Su

To be safe, also regenerate your initramfs after finishing:

mkinitcpio -p linux


There are two possible issues that might occur during this update.

Issue 1: glibc dependency errors

If running "pacman -Syu --ignore glibc,curl" gives:

warning: ignoring package glibc-2.16.0-2
warning: cannot resolve "glibc>=2.16", a dependency of "gcc-libs"

...

:: The following packages cannot be upgraded due to unresolvable dependencies:
     binutils  gcc  gcc-libs

Do you want to skip the above packages for this upgrade [y/N]

Say "y" to skipping the packages, then install them all using (e.g.):

pacman -Sd binutils gcc gcc-libs
Warning: If pacman is part of this list, install the glibc-2.16.0-1 package from the above note first, to prevent breakage.

Note the use of a single "-d" only ignores the versioning of dependencies and not the actual dependency itself. Then finish the update using:

pacman -Su

Issue 2: The final "pacman -Su" still has conflicts in /lib

Packages that own files in /lib

If after this the "pacman -Su" still has conflicts with /lib, this is likely because a package on your system other than glibc owns files in /lib. Such packages can be detected using:

$ grep '^lib/' /var/lib/pacman/local/*/files

These packages need rebuilding so as not to include the /lib directory. They can also simply be uninstalled and reinstalled again after upgrading glibc. The the final "pacman -Su" will successfully install glibc if there are no untracked files (see the next section).

Unpackaged files

This means that you have files or folders still in /lib or pacman thinks a package apart from glibc still own /lib. You can see which package own files in /lib by using:

$ find /lib -exec pacman -Qo -- {} +

If any package apart from glibc is listed as owning a file, that package needs to be updated to install its files in /usr/lib. Any files unowned by a package should either be deleted or moved to /usr/lib and any directories within /lib need deleted (after they are empty...).

One common source of files in /lib is left overs from running depmod after upgrading the kernel, but prior to reboot. The kernel modules included with the linux package in the repositories are now stored in /usr/lib/modules.

Success

You can confirm the update is complete by looking in your root directory to see that lib is a symlink to usr/lib.

$ ls -ld /lib
lrwxrwxrwx   1 root root     7 Jul 11 21:10 lib -> usr/lib