Advertisement
para_bellum

Migrate Jessie-x86 to x86_64

Jul 4th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.07 KB | None | 0 0
  1. --------------------------------------------------------------------------------------------------------------
  2. ---                                                 NOPE NOPE NOPE
  3. --------------------------------------------------------------------------------------------------------------
  4. # Add the x86_64 kernel
  5. sudo apt-get install linux-image-amd64
  6. # Add the architecture to dpkg
  7. sudo sudo dpkg --add-architecture amd64
  8. # Reboot on the x86_64 kernel
  9. reboot
  10. # Checkpoint the currently installed packets
  11. dpkg --get-selections "*:i386"|grep -v deinstall >dpkg-get-selections.cp.00.i386
  12. dpkg --get-selections "*:amd64"|grep -v deinstall >dpkg-get-selections.cp.00.amd64
  13. dpkg --get-selections "*:all"|grep -v deinstall >dpkg-get-selections.cp.00.all
  14. # Install debootstrap
  15. sudo apt-get install debootstrap
  16. # Prepare the x86 debootstrap tree
  17. mkdir -p bootstrap-i386
  18. debootstrap --arch=i386 --download-only --include=openssh-client,openssh-server jessie bootstrap-i386/
  19. # Prepare the x86_64 debootstrap tree
  20. mkdir -p bootstrap-amd64
  21. debootstrap --arch=amd64 --download-only --include=openssh-client,openssh-server jessie bootstrap-amd64/
  22. # Agregate and mark for install all the base packages from the x86_64 debootstrap tree
  23. ls -1 bootstrap-amd64/var/cache/apt/archives/|egrep "\.deb$"|cut -d "_" -f1|awk '{print $1 " install"}' >dpkg-get-selections.base
  24.  
  25. --------------------------------------------------------------------------------------------------------------
  26. --                                            OK
  27. --------------------------------------------------------------------------------------------------------------
  28. sudo aptitude search '?narrow(?not(?archive("^[^n][^o].*$")),?version(CURRENT))?architecture(i386)'
  29. sudo apt-get install linux-image-amd64 dctrl-tools
  30. sudo dpkg --add-architecture amd64
  31. sudo apt-get update
  32. reboot
  33. cd /var/cache/apt/archives
  34. sudo apt-get clean
  35. sudo aptitude search --disable-columns -F%p '~ri386~i!~o' | xargs -n1 sudo apt-get -o APT::Architecture=amd64 download # This will take a while.
  36. grep-status --field=Status "install ok installed" | grep-dctrl --field=Multi-Arch same --show-field=Package --no-field-names | sed 's/$/:amd64/' | xargs -n1 sudo apt-get -y install # This will take even longer and fail.
  37.  
  38. # This is a custom script to remove i386 packages that are already installed as amd64.
  39. # You should run it multiple times because packages are processed alphabetically and will meet dependency problems.
  40. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41. #!/bin/bash
  42.  
  43. i=1
  44.  
  45. echo "Get AMD64 packages"
  46. sudo aptitude search '~ramd64~i' | awk '{print $2}' > packages.amd64
  47. echo "Get i386 packages"
  48. sudo aptitude search '~ri386~i' | awk '{print $2}'  | sed -e 's/:i386//' > packages.i386
  49. echo "Compute common lines"
  50. comm -1 -2 --nocheck-order packages.i386 packages.amd64 > packages.comm
  51. tot=`cat packages.comm | wc -l`
  52. echo "${tot} common packages to remove."
  53.  
  54. for deb in `cat packages.comm`; do
  55.     echo "######################################"
  56.     echo "Remove ${deb}:i386 (${i}/${tot})"
  57.     echo "######################################"
  58.     sudo dpkg -r ${deb}:i386
  59.     i=$((i+1))
  60. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  61.  
  62. # Fuck'd up package beyond recuperation
  63. sudo mv /var/lib/dpkg/info/python-pil:i386.* /tmp/
  64. sudo apt-get -f install
  65.  
  66. # Look for broken packages
  67. aptitude search ~b
  68. # Remove the i386 kernel
  69. sudo aptitude remove '~ri386~nlinux-~i'
  70. # This command shows the installed i386 packages. Make sure they all have an amd64 counterparty.
  71. sudo aptitude search '~ri386~i'
  72.  
  73.  
  74.  
  75.  
  76. --------------------------------------------------------------------------------------------------------------
  77. --------------------------------------------------------------------------------------------------------------
  78. phonon-backend-vlc (recommended), phonon4qt5-backend-gstreamer, phonon-backend-gstreamer
  79.  
  80.  
  81.  
  82. # Reference
  83. # http://www.ewan.cc/?q=node/90 # NOPE
  84. # http://anarc.at/services/upgrades/cross-architecture/
  85. # http://www.nanonanonano.net/linux/debian/crossgrading
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement