I want to shift from ubuntu-desktop 10.10 to ubuntu netbook edition 10.10 on my netbook. Currently, the moment I ssh into ubuntu from my ad-hoc network, ubuntu freezes. It always requires a cold shutdown. So hoping that netbook edition may not have this issue. I have custom installed many applications on the desktop edition. So I want save the app list into a script and run the script on the new installation, so that all apps will be downloaded and installed. I need suggestions as to the best way to achieve this.
4 Answers
Run this monster on your existing install, replace 12.04
your Ubuntu version and i386
with the architecture (i386 or amd64):
release_num='12.04'
arch='i386'
comm -23 \
<(sort <(aptitude search '~i!~E' --disable-columns | grep -v "i A " | cut -d " " -f 3)) \
<(sort <(wget -q -O- http://releases.ubuntu.com/maverick/ubuntu-${release_num}-desktop-${arch}.manifest | grep -E -o '^[^ ]+')) \
| sed 's/$/ install/g' > packages
It will generate a file called packages
. Copy this to somewhere in your new install and then run:
sudo apt-get update
sudo bash -c "cat packages | xargs apt-get -y install"
Note: This compares the packages used on the LiveCD with the current ones. At the moment there are a few packages (gparted, btrfs-tools, etc) that are on the CD that aren't installed. If you installed gparted manually, you'll need to reinstall it on the new machine manually too. Thankfully this only applies to a few packages, all of which are simple to install if/when you realise you need it.
Also if you use any PPAs or other repositories, make sure you set them up on the new machine before you run this.
-
Just use the .manifest-desktop instead. Eg. gparted and btrfs-tools aren't part of the default installation (they are just on the CD). If you've manually installed those packages, they wouldn't show up in 'packages'.– htorqueNov 4, 2010 at 10:21
-
You might wanna pipe the two parts through sort, as 'comm' complained that both files weren't sorted. IIUC this should have the same 'problem' with packages from the default installation, that were manually marked as 'manually installed' (I guess that would be the 3rd column of 'comm'?).– htorqueNov 4, 2010 at 10:48
-
Where does
.manifest-desktop
live? I'm about to edit to add sorting. They looked sorted so I didn't think I had to do it but seemingly not. Good catch. In fairness to me, I typed this post from bed on my phone using a nasty little 15mm*100mm keyboard. ;)– Oli ♦Nov 4, 2010 at 10:58 -
That's the downside - it doesn't seem to be available online like that .manifest file. :-/ On the CD it's in the 'casper' folder.– htorqueNov 4, 2010 at 11:06
-
I've had a hunt around and can't find a recent version. I think using an old version is just as damaging and downloading the ISO just to extract it is a waste of energy. I think that just has to be a caveat of this process. You might have to manually install a few packages that you had before but this will do most of them.– Oli ♦Nov 4, 2010 at 11:19
I think others have answered the technical piece of your question, I'd like to answer the implied question - "will moving to Unity fix this ssh problem", and the answer is I'm afraid I doubt it. Remote shell sessions are generally not exercising Unity or the desktop. If you can ssh fine into your desktop from a wired network, but not from an ad-hoc network, the freezing is probably related to your wireless drivers and not the desktop shell.
-
I second this - since the netbook edition and the desktop edition use almost all of the same drivers/packages, it's unlikely that reinstalling will solve anything. Better to diagnose network issues instead. Nov 4, 2010 at 19:33
-
Mark, Yes, it looks like it is a driver problem. But in rare cases it has happened while on wired network too. I should try turn off both the card and try. Nov 6, 2010 at 1:43
There's a file called 'filesystem.manifest-desktop' in the folder 'casper' on the CD (or extract it from the ISO file). It contains all the packages that get installed, minus the ones downloaded during the installation (updates, langpacks?).
So something like this should give you the list of added and removed packages:
dpkg --get-selections | awk '{print $1}' > now.txt
awk '{print $1}' filesystem.manifest-desktop > then.txt
diff -u then.txt now.txt | grep '^+' | sed 's/^+//' | grep -v '^+' > add.txt
diff -u then.txt now.txt | grep '^-' | sed 's/^-//' | grep -v '^-' > rem.txt
You can then install via:
cat added.log | xargs sudo apt-get install
(You need to make sure that all those packages are available, else that command will fail.)
- filesystem.manifest-desktop from ubuntu-10.10-desktop-i386.iso
- filesystem.manifest-desktop from ubuntu-10.10-desktop-amd64.iso
-
1Will this make current automatically installed packagesbe manually installed on the new system?– Oli ♦Nov 4, 2010 at 1:27
-
It looks like my 'add.txt' contains the same packages as your 'packages', so I guess no. However, what this fails to do, is to set packages from the installation to 'manually installed', if you did so on the current system.– htorqueNov 4, 2010 at 10:50
-
2I have stolen your reinstallation method but you should note that xargs can break things into multiple commands if there are lots of arguments. Given how much time there could be between downloading the first batch and second, sudo would probably expire. That's why I wrapped mine in a
sudo bash -c "..."
.– Oli ♦Nov 4, 2010 at 13:38 -
Heh, actually I thought your install mode was better because dselect would explicitly show packages that cannot be installed (unknown PPAs, 3rd party .debs), so you could unmark them. With apt it's all or nothing.– htorqueNov 4, 2010 at 14:27
dpkg --get-selections
: remember that there's a different set of packages installed by the system. You'd need to filter based on which applications were installed after the base system.