Monday, 20 January 2014

Introducing Aptik

Aptik is a new tool to simplify re-installation of packages after doing a clean installation of an Ubuntu-based distribution. It can be used while re-installing or upgrading to the next Ubuntu/Linux Mint release.

Upgrading to the next release of an Ubuntu-based distribution can be a painful task.

While most Ubuntu-based distributions provide an option to upgrade your existing installation, it can cause a number of problems.

  1. It sometimes results in broken packages.
  2. If proprietary graphic drivers are in use, the system may boot into a black screen after the upgrade.
  3. The look and feel of the new release is lost since the previous desktop settings are used.

In order to avoid problems most people prefer to do a clean installation. They download the ISO image, format the system partition, and then install the new release.

You get a good feeling when you boot into your shiny new system. Then you realise that you need to re-install all your softwares again and your excitement goes down. Aptik is a new tool that will make your life easier. While it won't eliminate all the work that needs to be done after a fresh installation, it will reduce it greatly.

Take Backups on the Old System

1) Install Aptik

Install Aptik with the following commands:

sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install aptik

2) Create a Backup Folder

Plug-in your pen drive and create a new folder on it named 'backups'.
Start Aptik from the applications menu.
Select the new folder as the backup directory.

3) Backup Software Sources

Click the Backup button for Software Sources. A list of third-party PPAs will be displayed along with names of packages that are installed from the PPA.

PPAs with a green icon are active and have some packages installed.
PPAs with a yellow icon are active but unused (no packages installed).

Select the PPAs to backup and click the Backup button.
A file named 'ppa.list' will be created in the backup directory.

4) Backup Software Selections

Click the Backup button for Software Selections. A list of installed top-level packages will be displayed.

These packages are top-level packages. Dependency packages will not be listed.

All packages that are a part of the Linux distribution are un-selected by default. For example, Firefox is a package that is installed by default on most Linux distributions. Since it came with the distribution, it will be un-selected by default. It can be selected if required.

All extra packages that were installed by the user are selected by default. For example, if you had installed the package for Chrome web browser (using the Software Center or by running apt-get install command) the package will be selected by default. It can be un-selected if required.

Select the packages to backup and click the Backup button.
A file named 'packages.list' will be created in the backup directory.

5) Backup Downloaded Packages

Click the Backup button for Downloaded Packages.

The packages in your system cache (/var/cache/apt/archives) will be copied to the backup folder.

This step is useful only if the system is being re-installed. When the system is upgraded this step can be skipped since the packages for the new Ubuntu release will be newer than the packages in the system cache.

Restoring the downloaded packages on the new system will save time and internet bandwidth when the packages are re-installed. Since the packages will be available in the system cache, the download will be skipped and installation will complete more quickly.

6) Backup Themes and Icons

Click the Backup button for Themes and Icons. A list of installed themes will be displayed.

These themes are from the directories /usr/share/themes and /usr/share/icons.
Select the themes to backup and click the Backup button.
Selected themes will be zipped and saved in the backup folder.

Restore Backups after Installing the New System

After installing the new Linux distribution the backups can be restored.

1) Install Aptik

Install Aptik with the following commands:

sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install aptik

2) Select the Backup Folder

Plug-in your pen drive.
Start Aptik from the applications menu.
Select the backup folder on the pen-drive as the backup directory.

3) Restore Software Sources

Click the Restore button for Software Sources. PPAs from the backup file 'ppa.list' will be displayed.

PPAs with a green icon are already active.
PPAs with a gray icon are not active and can be added.

Select the PPAs to restore and click the Restore button.
Selected PPAs will be added to the system.

4) Restore Software Selections

Click the Restore button for Software Selections. Packages from the backup file 'packages.list' will be displayed.

Packages with a green icon are already installed.
Packages with a gray icon are not installed and can be selected for installation.
Packages with a red icon are not available in software repositories and cannot be installed.

Select the packages to restore and click the Restore button.
Selected packages will be installed on the system.

5) Restore Downloaded Packages

Click the Restore button for Downloaded Packages.

The packages in your backup directory will be copied to system cache (/var/cache/apt/archives).

This step is useful only if the system is being re-installed. When the system is upgraded this step can be skipped since the packages for the new Ubuntu release will be newer than the packages in the system cache.

Restoring the downloaded packages will save time and internet bandwidth when the packages are installed. Since the packages will be available in the system cache, the download will be skipped and installation will complete more quickly.

6) Restore Themes and Icons

Click the Restore button for Themes and Icons. A list of themes available in the backup directory will be displayed.

Themes with a green icon are already installed.
Themes with a gray icon are not installed and can be selected for installation.

Select the themes to restore and click the Restore button.
Selected themes will be extracted to system directories /usr/share/themes and /usr/share/icons.

More Options

Fix Ownership of Home folder

The home folder can be manually copied to another location and then restored after doing a fresh install. However, it can sometimes cause problems if the user's login name or UID is different from the previous one. Click the Take Ownership button to change ownership of files in your home directory to your current login ID. This is same as running the following command

sudo chown username -R /home/username

Command-line Options

Run aptik --help to see the full list of options.


Disclaimer

This program is free for personal and commercial use and comes with absolutely no warranty. The author will not be liable for any damages arising from the use of this program.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

Support This Project

This software is free for personal and commercial use and is licensed under the GNU General Public License. If you need help for any issues or wish to support its development, please purchase a support subscription using the PayPal link below.

Options

21 comments:

  1. Hi! Nice job with aptik, it saves be a lot of trouble. I used to have a script that did the backup-restore part, but aptik is an all-in-one utility to backup everything.
    Now, could you please tell me how can I translate this app? I couldn't find anything on Launchpad. Since it will surely be used by many, some of them don't know English well enough, I thought I could translate it into my native language, Romanian. Thanks a lot!

    ReplyDelete
    Replies
    1. Hi, I have set-up the translations in launchpad. The POT file can be downloaded from the following link
      https://translations.launchpad.net/apt-toolkit/trunk/+export
      Let me know if you need any help.

      Delete
  2. Very well, thanks for this tool :D!

    Grettings!

    ReplyDelete
  3. Hi. Great idea and very much needed. I am running freshly installed Ubuntu 13.10 64 bit with current updates. I installed it via command line- all seemed normal. Problem is I cannot find the Aptik application!? Search in Desktop and Ubuntu Software centre comes up blank. Terminal reinstall comes up with a message that the application is up to date? Any ideas?

    ReplyDelete
    Replies
    1. Hi. you can start the application by typing aptik-gtk at the terminal. There's a small bug because of which the shortcut doesn't appear in the application menu. It will be fixed in the next update.

      Delete
  4. Sounds like this would be a very useful tool! However, adding the ppa to my Mint 13 Mate box causes the following errors when I run
    sudo apt-get update

    Err http://ppa.launchpad.net maya/main Sources
    404 Not Found
    Err http://ppa.launchpad.net maya/main amd64 Packages
    404 Not Found
    Err http://ppa.launchpad.net maya/main i386 Packages
    404 Not Found


    W: Failed to fetch http://ppa.launchpad.net/teejee2008/ppa/ubuntu/dists/maya/main/source/Sources 404 Not Found

    W: Failed to fetch http://ppa.launchpad.net/teejee2008/ppa/ubuntu/dists/maya/main/binary-amd64/Packages 404 Not Found

    W: Failed to fetch http://ppa.launchpad.net/teejee2008/ppa/ubuntu/dists/maya/main/binary-i386/Packages 404 Not Found

    ReplyDelete
    Replies
    1. The problem I am encountering with the PPA not being "translated" for Mint is happening on only one of my numerous machines. So it would seem that the mechanism is broken for that machine. The PPA works great for all the other Mint 13 machines. The application works well, I thank you for this handy piece of software.

      Carl

      Delete
  5. Does this work from 12.4 > 13.10?

    ReplyDelete
  6. Hello,

    It's a really useful tool, saves a lot of time. !.000.000 thanks!! :D

    ReplyDelete
  7. Hi, Looks like a very nice utility. But when I try to install it, I get the error: unable to locate package aptik
    Am I missing something? I run Ubuntu Studio (XFCE) 13.10.

    Adding the PPA seemed to go OK:

    You are about to add the following PPA to your system:

    More info: https://launchpad.net/~teejee2008/+archive/ppa
    Press [ENTER] to continue or ctrl-c to cancel adding it

    gpg: keyring `/tmp/tmpxr48i5/secring.gpg' created
    gpg: keyring `/tmp/tmpxr48i5/pubring.gpg' created
    gpg: requesting key 2D0F61F0 from hkp server keyserver.ubuntu.com
    gpg: /tmp/tmpxr48i5/trustdb.gpg: trustdb created
    gpg: key 2D0F61F0: public key "Launchpad PPA for Tony George" imported
    gpg: Total number processed: 1
    gpg: imported: 1 (RSA: 1)
    OK

    Maybe it can help others : )

    ReplyDelete
  8. AAAhhh I noticed no 13.04 in the launchpad repo?

    ReplyDelete
    Replies
    1. Ubuntu 13.04 has reached End-of-Life. Its no longer supported by Launchpad.

      Delete
  9. Some PPAs are designated by distribution Version (ie Precise for WINE). Will Apptik update that info to the new version (ie Trusty) on restore or does that have to be done manually?

    ReplyDelete
    Replies
    1. Restoring the PPA is same as adding it manually by running 'add-apt-repository'. It will add the source for the correct distribution version.

      Delete
  10. Great idea and another tool that (in theory) does exactly what I want!

    However... some glitches.

    ubuntu 12.04

    Software selection... it listed tons of packages supposedly "installed by user".... many of which were not... or at least not explicitly. Mahjong, solitaire, more. Many other non-game packages that I did not explicitly install. So there's that.

    Also, after spending about 20 minutes scrolling through the list and selecting/unselecting packages I did in fact install and want to backup... I couldn't help but notice that I'm going to have to do it all over again the next time I want to backup. How about a way to save the "previous settings so I don't have to do it all over again? Thank you

    P.S. I sincerely dislike this forced profile selection in order to post here. OpenID URL? How the heck should I know what's supposed to go there? I was prepared so I copied this post prior to trying to login, because when I cancelled out and came back here.... I lost everything I typed. Not good.

    ReplyDelete
    Replies
    1. And yes, for the record I do have an OpenID... through yahoo. But still no idea what URL I'm supposed to use. Other (limited places) I've had the displeasure of being forced to login, it just worked automagically as best as I recall.

      Delete
    2. Could you mail me a screen-shot of the list that is displayed when you click on the Backup button for packages? Normally only those packages will be selected which were manually installed by user. The default packages (that came with distribution) will be un-selected. I tested this on Ubuntu 12.04 and it seemed to be working fine.

      Check if the following file is present on your system: /var/log/installer/initial-status.gz
      If this file is missing then this might be the problem.

      I'll add an option for saving previous settings.

      If you are logged into your GMail account then you should be able to post here directly without having to use OpenID login. Earlier, when anonymous comments were enabled on this blog, I used to receive comments on various issues which were impossible to troubleshoot because I had no way to contact the user who posted the comment. Hence, in order to keep the discussion constructive, I disabled anonymous comments a while ago. I've enabled anonymous comments once again. I'll see how it goes for a few months and then decide.

      Delete
  11. This comment has been removed by the author.

    ReplyDelete
  12. Hi Tony
    Does aptik work behind proxy? I have ElementaryOS (Ubuntu 12.04 derivative) and cannot restore the backedup ppas because I guess it doesn't like connections behind proxy...
    Thanks

    ReplyDelete

If you are reporting an issue and commenting as an anonymous user, please leave your email address so that I can get in touch with you.