0% found this document useful (0 votes)
134 views1 page

Offline Backup

The script checks for required tools like dpkg-repack and fakeroot, creates a backup of installed packages, and packages it into a tarball on the desktop for offline installation. It outputs status messages during the process.

Uploaded by

Ko Ko Ye
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
134 views1 page

Offline Backup

The script checks for required tools like dpkg-repack and fakeroot, creates a backup of installed packages, and packages it into a tarball on the desktop for offline installation. It outputs status messages during the process.

Uploaded by

Ko Ko Ye
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#!

/bin/bash
day=$(date)
hostname=$(hostname -s)
SUDO=`which sudo` || `which kdesudo` || `which gksudo` || exit 316
if [ -e /usr/bin/dpkg-repack ]; then
echo
echo "DPKG-REPACK is Ready"
echo
sleep 2
else #download it
echo
echo "install dpkg-repack"
echo
sleep 2
"$SUDO" apt-get install -y --force-yes dpkg-repack
fi
if [ -e "/usr/bin/fakeroot" ]; then
echo
echo "FakeRoot is Ready"
echo
sleep 2
else #download it
echo
echo "install is fakeroot"
echo
sleep 2
"$SUDO" apt-get install -y --force-yes fakeroot
fi
mkdir ~/offline-backup; cd ~/offline-backup
echo "$hostname from make as $day" > read.txt
fakeroot -u dpkg-repack `dpkg --get-selections | grep install | cut -f1`
dpkg-scanpackages ./ /dev/null | gzip > Packages.gz
cd ~/
tar -cvf ~/Desktop/offline-update.tar offline-backup
"$SUDO" rm -Rf ~/offline-backup
echo
echo "Finish"
echo
echo "See @ Desktop"
echo
sleep 3
exit

You might also like