dev-resources.site
for different kinds of informations.
Backup manually installed libraries and packages in Ubuntu
Backup Manually Installed Libraries and Packages in Ubuntu
As a software developer, you know how important it is to have a reliable development environment. Ubuntu, being a popular choice among developers, offers a wide range of libraries and packages that can be manually installed to enhance your development experience. However, what happens when you need to reinstall Ubuntu or set up a new development machine? You don't want to go through the hassle of manually installing all those libraries and packages again. That's where backing up your manually installed libraries and packages comes in handy.
Method 1: Using dpkg to Backup and Restore
One way to backup your manually installed libraries and packages is by using the dpkg command-line tool. Here's how:
- Open a terminal by pressing
Ctrl + Alt + T
. -
Run the following command to list all your manually installed packages:
$ dpkg --get-selections | grep -v deinstall > packages.txt
This will create a file named packages.txt
in your current directory containing a list of all your manually installed packages.
- Copy the
packages.txt
file to your backup location.
To restore your packages on a new machine or after reinstalling Ubuntu, follow these steps:
- Copy the
packages.txt
file from your backup location to the new machine. - Open a terminal and navigate to the directory where you copied the
packages.txt
file. -
Run the following command to install the packages listed in the file:
$ sudo dpkg --set-selections < packages.txt
This will install all the packages listed in the packages.txt
file.
Method 2: Using Aptik to Backup and Restore
If you prefer a graphical tool to backup and restore your manually installed libraries and packages, you can use Aptik. Aptik is a powerful backup and restore tool specifically designed for Ubuntu. Here's how to use it:
-
Install Aptik by running the following command in a terminal:
$ sudo apt-add-repository -y ppa:teejee2008/ppa
$ sudo apt-get update
$ sudo apt-get install aptik Launch Aptik from the applications menu.
Select the libraries and packages you want to backup.
Choose a backup location and click on the "Backup" button.
To restore your packages using Aptik, simply launch the application, choose the backup file, and click on the "Restore" button.
With these methods, you can easily backup and restore your manually installed libraries and packages in Ubuntu, saving you time and effort. So go ahead, backup your development environment and never worry about reinstalling everything from scratch again!
References:
Featured ones: