Some years ago I noted a few lines in my wiki to "transfer" an installation of an operating system that uses APT from one system to another ("system" doesn't denote a "machine" but simply an installation of some operating system). Yesterday, I used this to transfer the installation from Xubuntu 12.04 x86 to Xubuntu 12.04 x64. Interestingly, it happend that there were a lot of "i386" packages installed. You can see this if you grep "386" from "dpkg --list". Results could be like this:
ii 6tunnel:i386 0.11rc2-5 TCP proxy for non-IPv6 applications
To replace these packages with their (in my case) amd64 counterparts, it is first necessary to remove those i386-packages:
apt-get remove `dpkg --list | grep "386" | cut -d' ' -f3 | tr '\n' ' '`
Explanation: List all packages that contain 386 in their name and take only that name, replace all line feeds with spaces and send the results to apt-get.
Next, let's write all packages that should be reinstalled to a file:
dpkg --list | grep "386" | cut -d' ' -f3 | sed 's/:i386/ /g' | grep -v ^lib | tr '\n' ' ' > new_packages
(possibly, that could be optimized to grep all lines not beginning with lib and containing 386 in one statement rather than two statements)
We can then review the file (maybe there are packages we don't need any more). After that, we issue
apt-get install `cat new_packages`
and apt-get installs the requested packages.
Keine Kommentare:
Kommentar veröffentlichen