Making a pre-install script?

Is it possible to run a command & get how your whole system is setup in a .txt file. I want to reinstall with KDE, but have this setup on KDE. Users/Apps & the settings/storage/timezone. like how in NixOS we can install on another sys just like it is from another system. Accept KDE not Mate.

I believe such a script might be possible, but I have never used that method. Instead, if your /home is already on a separate partition, you could reinstall Manjaro KDE (making sure not to format the /home partition) and most settings should be retained. Your additional packages would still need to be installed manually.

However, if you want to install over a completely different OS, I don’t recommend doing this. There would be too many configuration differences and inconsistencies involved, which could possibly result in an unworkable system.

Do the work; install from scratch;
and through the process, you will keep learning.

That is all. Cheers.

1 Like


  • Transfuse from @ cscs
1 Like

Years ago, I used a small tar script I wrote to backup, compress and restore the entire user profile. Suffice to say, since my user profiles are now typically in multiple GB ranges, I use it no longer.

That’s why my user profile mostly resides on my 5TB disk, with only small config files on my nvme disk…

I guess mine would be, if I had all my VirtualBox stuff etc. in /home. I have a separate /DATA partition for that and for working directories for stuff like GIMP, KDEnlive, Audacity etc. as well as all my media.

Trying to keep /home as tidy as possible … honest :wink:
(still over 20G though, but there are a few .ISOs I didn’t get round to moving to where they should be yet).

As for a script, I’d like to do something similar but really should have noted or logged ALL of the stuff I’ve added since install (over 5 years ago!) to include for installation. Configs etc. in /home are easy enough to transfer over to a new system.

So what is the best way tp backup home to put it on my new sys? /homeis is 17 Gig.

Copy it, somehow. I’m sure you have a thumb drive, external HDD or something you could use.

CloneZilla is a good solution. However, it’s best run from a bootable Live Installer of some kind. Running it otherwise when cloning the same partition is probably not advisable. :wink: Naturally, this assumes that your /home is in fact on a separate partition.

CloneZilla is available by default on the PartedMagic DVD/USB images. You could also use a Manjaro Live Installer and install CloneZilla on-the-fly.

The following command will install all required packages for CloneZilla to function from a Live Installer:

sudo pacman -S clonezilla

I hope this helps. Cheers.

I have 2 1 TB drives, can I just copy/paste it? I didn’t do a /home partition at install.

Only you can know whether you can get away with it.

However, it should generally be safe to do something like this:

(The following assumes an ext4 partition.)

  • Create mount point for the backup disk:

    sudo mkdir  /mnt/backups
  • Mount the partition at the mount point:

    sudo mount -t ext4 <partitionToMount> /mnt/backups

    Where <partitionToMount> is the partition you wish to mount, for example, /dev/sda1.

  • Create an easily recognizable directory for the backup and copy everything from you $HOME to said directory:

    sudo mkdir /mnt/backups/lateshomebackups
    sudo chown $USER:$USER /mnt/backups/lateshomebackups
    cp -r ~/* /mnt/backups/lateshomebackups/
  • Leave it to finish, and then unmount

    sudo umount /dev/backups

Then you can go ahead. Note, however, that this is only theoretically because I don’t know if you have anything else, anywhere else that should be backed up. And I take no responsibility should something go wrong somewhere.

So I can’t just do it in MATE?

I believe this question has been asked several times - have you searched for similiar topics?

Others have made such scripts

I have experimented a lot with i


You can do it however you wish. But I don’t have MATE or have ever worked on MATE, so I can’t help you there. So I gave you CLI commands, and pretty thorough instructions in my opinion.