I like to clean install a lot so I tend to burn my packages onto CDR.
This spares me the trouble of having to download them over and over. If
there's a simpler way to do this, I'd love to be informed.
Anyway, here's the way I currently do it:
1) Make a new folder somewhere in your Home folder.
2) Create this script file there called "apt-copy.sh":
Code:
#!/bin/sh
# Make a local copy of files from the apt cache
# except for files you list in "exclude.txt".
for FILE_NAME in `ls /var/cache/apt/archives/*.deb`
do {
BASE_NAME=`basename $FILE_NAME`
if ! grep -s $BASE_NAME exclude.txt >/dev/null 2>&1
then {
cp -v -u -p $FILE_NAME .
echo $BASE_NAME >>exclude.txt
}
fi
}
done
# change %3a back to :
rename -v 's/%3a/:/' *%3a*
3) Make this script an executable (chmod +x apt-copy.sh).
4) Any time you do a major update, you can make a local copy of your files by running this script (./apt-copy.sh).
5) Remember to hang on to the "apt-copy.sh" and "exclude.txt" files if you move the files out of this folder.
Later on, when you want to restore all these packages, you simply do this:
1) sudo apt-get install dpkg-dev
2) Create a folder in your Home folder called "archive", then make a
"binary" folder and "source" folder within the archive folder.
3) Put the binary packages you want to restore into the "binary" folder
and the source packages you want to restore into the "source" folder.
4) Create this script file in the "archive" folder and call it "scan.sh":
Code:
#!/bin/sh
dpkg-scansources source /dev/null | gzip -9c > source/Sources.gz
dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
5) Make it executable (chmod +x scan.sh).
6) Once you have all the packages you want to use, run this script (./scan.sh).
7) To use the packages, add the following to your "/etc/apt/sources.list" at top of the file (sudo gedit /etc/apt/sources.list):
Code:
deb file:/home/htinn/archive binary/
deb-src file:/home/htinn/archive source/
Replace "htinn" with whatever user name you're using.
8) sudo apt-get update
9) Install your packages (using Synaptic or apt-get).
分享到:
相关推荐
- 例如:"The court will make every effort to restore the child to his mother."(法院将尽力把孩子送回母亲身边) 理解并熟练运用"restore"的这些用法,对于提高英语水平和在实际交流中准确表达是非常有帮助的...
4. **恢复模型**:使用`saver.restore(session, save_path)`加载模型,这里的`save_path`就是你之前保存模型的路径。 5. **继续使用模型**:现在,你可以继续训练,或者直接使用模型进行预测。 在TensorFlow 1.2.0...
iptables-restore命令用来还原iptables-save命令所备份的iptables配置。 语法格式:iptables-restore [参数] 常用参数: -c 指定在还原iptables表时候,还原当前的数据包计数器和字节计数器的值 -t 指定要还原...
This book concentrates on basic tasks such as how to set up and configure Moodle and how to perform day-to-day administration activities, and progresses on to more advanced topics that show you how to...
### SQL Server备份与恢复策略详解 #### 引言 在当今数据驱动的商业环境中,确保数据的安全性和可靠性至关重要。Microsoft SQL Server作为一种广泛使用的数据库管理系统,提供了多种强大的备份和恢复机制来保护...
标题中的"Save and Restore"指的是在程序开发中的一项重要功能,即保存用户的状态或数据并在后续使用时恢复这些状态或数据。这在许多应用程序中都至关重要,比如游戏存档、软件配置备份、文本编辑器的未保存更改等。...
实现文件隐藏-修改为.sys文件.c rootkit 驱动文件 修改为.sys文件
`apt`(Advanced Package Tool)是一个强大的命令行工具,它整合了`apt-get`和`apt-cache`的功能,使得软件的安装、查询、更新和卸载变得极为便捷。本文将详细介绍`aptback`,一个旨在简化和增强`apt`功能的工具。 ...
**恢复(Restore):** 是指将备份的数据集还原到计算机的过程,以便能够重新使用这些数据。恢复通常发生在备份之后,当原始数据因为某种原因不可用时(如硬件故障、病毒攻击、人为错误等)。 #### 二、备份过程中...
在今天的主题为"MySQL Backup Best Practices and Case Study: .IE Continuous Restore Process"的分享中,来自Percona的资深支持工程师Marcelo Altmann和Domain Registry的技术服务经理Mick Begley将共同探讨MySQL...
### Clonezilla for Windows 8 and 8.1 Backup and Restore #### 什么是Clonezilla Clonezilla是一款免费且开源的备份与恢复工具,由NCHC.ORG.TW开发。其核心功能包括创建与恢复系统镜像,适用于多种操作系统,如...
In this tutorial, we'll cover some of the basics of Unicode-encoded text and Unicode files, and how to view and manipulate it in UltraEdit. Search and delete lines found UEStudio and UltraEdit provide...
1、可以完好无损的备份你手机里的短信到SD卡,并且随时可以还原。 2、短信还原时,有重复检验功能,保证还原时已有的短信不会重复出现。 3、支持Android 2.2 更新日志: v5.800 - Dropbox support, needs Add-On ...
《VERITAS NetBackup™ 5.1 Backup, Archive, and Restore Getting Started Guide for UNIX and Windows》是一本专注于VERITAS NetBackup 5.1版本的官方文档。该文档旨在帮助用户了解如何在UNIX和Windows操作系统上...
and my new Bible tells you where to find it all I'll show you how to set up e-mail, join your favorite online groups, set parental controls—even make your own CDs and DVDs And you'll love the ...
其次,HotRestore构建了一个由通信引起的恢复依赖图(communication-induced restore dependency graph),并安排恢复线(restore line),以缓解TCP重传超时问题。最后,提出了一种恢复协议,用以最小化重传超时的...
Learn how to set up users, automate system tasks, back up and restore files, and prepare for the latest security issues and threats; also learn how to use and customize the desktop menus, icons, ...