why does this command not work?
C M Reinehr
cmr
Wed Jan 10 07:07:44 PST 2007
Myles,
On Wednesday 10 January 2007 05:15, Myles Green wrote:
> Hi,
>
> While looking through the Debian Admin site [1] I ran across this article
> [2] on "cloning" your system - basically returning your system to an 'as
> currently installed package-set" from a fresh install.
>
> Anyway, the article says to run the following command in order to get a
> list of packages that you can feed to aptitude once you are back up and
> running with your fresh (re)installation:
>
> sudo dpkg --get-selections | grep '[[:space:]]install$='| awk '{print $1}'
>
> > installedpackages
Before I get into your grep command let me just say that you don't need it.
All you have to do is: dpkg -- get-selections > some_file. The output looks
like this:
acpid install
acroread install
acroread-escript install
acroread-plugins install
.
.
.
Then, to restore your system you just reverse the process:
dpkg --set-selections < some_file. This won't actually install anything.
After doing this next run dselect or aptitude and the packages will already
be selected for installation. By the way, I don't think you even need sudu to
run dpkg --get-selections. At least on my system, you don't. A regular user
can run it. I haven't tried the --set-selections option as a regular user.
That, probably, won't work.
As to your grep command, I can't say that I really understand the syntax, but
at a guess it's trying to filter lines that contain a string of one or more
spaces preceding the word install. (The output of dpkg --get-selections can
contain lines ending with 'deinstall', purge, etc.) The probably, probably,
is that the lines are using tab characters, rather than spaces and, thus,
there are no lines matching the pattern.
> The only problem is, the output file ends up being completely empty.
> Perhaps it's just too darned late and I should get some sleep before
> looking at this again but more likely is the fact that there is a typo in
> there that I'm missing. Could some kind soul _please_ point out the
> error(s) in that command?
>
> [1] http://www.debianadmin.com/
>
> [2] http://www.debianadmin.com/clone-your-ubuntu-installation.html
>
> TIA!
> Myles
HTH!
cmr
--
Debian 'Etch' - Registered Linux User #241964
--------
"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC
More information about the Linux-users
mailing list