I just updated my 32-bit Ubuntu 12.04 to 64-bit version by taking the following steps:
- Made a tarball of my home (not really important)
- Saved
dpkg --get-selections
- Made a tarball of
/etc/apt
- Format and install latest 64-bit Ubuntu 12.04
- Overwrite home with the old home (again, not important)
- Overwrite
/etc/apt
and to reinstall the old applications, I tried following from here, so I did:
$ sudo apt-get install dselect
$ sudo dpkg --set-selections < ~/Package.list
$ sudo apt-get dselect-upgrade
But, that was asking me to remove a lot of 64-bit packages and install the 32-bit versions of them. I didn't quite figure out how to reset the selection, so I just went ahead and uninstalled dselect
.
Then I decided to go with a more manual method. Having the old dpkg --get-selections
output (call the file packages
), I did the following:
# take packages marked as deinstall
$ awk '/deinstall/{ print $1 }' < packages > deinstall
# and remove them
$ while read p; do sudo apt-get remove "$p" -y; done < deinstall
The removed packages were nothing weird. In fact, they were:
appmenu-gtk
appmenu-gtk3
asymptote
indicator-appmenu
libfltk-cairo1.3
libfltk-gl1.3
libgc1c2
libgsl0ldbl
liboverlay-scrollbar-0.2-0
liboverlay-scrollbar3-0.2-0
libsigsegv2
libubuntuoneui-3.0-1
Then I did the same to install old packages (here I realized invoking apt-get install
per package is too slow, so I did them all together):
# take packages marked as install
$ awk '/\tinstall/{ print $1 }' < packagespackages > install
# and install them
$ xargs sudo apt-get install -y < install
However, before doing that, I removed the packages that started with X, to make sure it doesn't do anything with X.
Doing this, it still told me some X related packages would be removed, but at the same time it said some other X related packages would be installed, so I let it do it.
Finally, what happened is the following:
On restart, X didn't run. Trying FailsafeX said that
/usr/bin/X
does not exist. Following its suggestions, I did:$ cd /usr/bin; ln -s Xorg X
On restart, X ran ok and everything is ok.
When I do something with
apt-get
, it tells me that:The following packages were automatically installed and are no longer required: x11-apps libwayland-ltss-server0 xserver-xorg-input-vmmouse x11-session-utils appmenu-qt xserver-xorg-input-evdev x11-xfs-utils libxrandr-ltss2 xserver-xorg-input-wacom xinit xserver-xorg-input-mouse libxcb-xfixes0 libwayland-ltss-client0 xserver-xorg-input-synaptics libllvm3.3
So here's my question. should I remove those packages? How can I make sure I have alternative packages so everything would work ok on restart? If I shouldn't remove these packages, how can I make apt understand that the system depends on them?
As muru correctly suggested,
ubuntu-desktop
had somehow got uninstalled. It looks like somehow I had managed to replace X with wayland (maybe).Installing
ubuntu-desktop
complained about broken packagesxserver-xorg
andxorg
. Installing them,ubuntu-desktop
was installed alright (and/usr/bin/X
wad replaced). Apt still said some wayland packages are no longer needed, which I justautoremove
d.You could do the following steps next time the issue appears (Which are a bit excessive) but are used for cases where packages become annoying:
With that the packages should all be correct. There are worst cases where you would need to call upon the powers of
dkpg
and it's--force-remove-reinstreq
or--force-overwrite
parameters in order to "fix" the package.