备份与清理
* 备份快速设置已下载的部分软件包,以便重装系统再次使用,免去重新下载的时间
tar cizvf backup.tar.gz /var/cache/apt/archives --exclude=/var/cache/apt/archives/partial/* --exclude=/var/cache/apt/archives/lock
重装系统,设置好源列表后,导入已备份的软件包即可,操作方法:sudo apt-get update && sudo tar xzvf backup.tar.gz -C /
* 清理
sudo apt-get clean
rm -rf ~/.thumbnails/fail/gnome-thumbnail-factory/*
用上面的方法备份后,没有备份源文件,现在忘记了之前使用的源,怎么还原阿?
[问题]备份还原
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
- 帖子: 134
- 注册时间: 2008-02-12 19:09
- 联系:
root@hj-laptop:~# sudo apt-get update && sudo tar xzvf backup.tar.gz -C /
Err http://cn.archive.ubuntu.com hardy Release.gpg
Could not resolve 'cn.archive.ubuntu.com'
Err http://cn.archive.ubuntu.com hardy-updates Release.gpg
Could not resolve 'cn.archive.ubuntu.com'
Err http://security.ubuntu.com hardy-security Release.gpg
Could not resolve 'security.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dis ... elease.gpg Could not resolve 'cn.archive.ubuntu.com'
W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dis ... elease.gpg Could not resolve 'cn.archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists ... elease.gpg Could not resolve 'security.ubuntu.com'
W: Some index files failed to download, they have been ignored, or old ones used instead.
W: You may want to run apt-get update to correct these problems
tar: backup.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
root@hj-laptop:~# sudo apt-get update && sudo tar xzvf backup.tar.gz -C /
Hit http://mirror.rootguide.org hardy Release.gpg
Hit http://mirror.rootguide.org hardy-updates Release.gpg
Hit http://mirror.rootguide.org hardy-security Release.gpg
Hit http://mirror.rootguide.org hardy Release
Hit http://mirror.rootguide.org hardy-updates Release
Hit http://mirror.rootguide.org hardy-security Release
Hit http://mirror.rootguide.org hardy/main Packages
Hit http://mirror.rootguide.org hardy/restricted Packages
Hit http://mirror.rootguide.org hardy/main Sources
Hit http://mirror.rootguide.org hardy/restricted Sources
Hit http://mirror.rootguide.org hardy/universe Packages
Hit http://mirror.rootguide.org hardy/universe Sources
Hit http://mirror.rootguide.org hardy/multiverse Packages
Hit http://mirror.rootguide.org hardy/multiverse Sources
Hit http://mirror.rootguide.org hardy-updates/main Packages
Hit http://mirror.rootguide.org hardy-updates/restricted Packages
Hit http://mirror.rootguide.org hardy-updates/main Sources
Hit http://mirror.rootguide.org hardy-updates/restricted Sources
Hit http://mirror.rootguide.org hardy-updates/universe Packages
Hit http://mirror.rootguide.org hardy-updates/universe Sources
Hit http://mirror.rootguide.org hardy-updates/multiverse Packages
Hit http://mirror.rootguide.org hardy-updates/multiverse Sources
Hit http://mirror.rootguide.org hardy-security/main Packages
Hit http://mirror.rootguide.org hardy-security/restricted Packages
Hit http://mirror.rootguide.org hardy-security/main Sources
Hit http://mirror.rootguide.org hardy-security/restricted Sources
Hit http://mirror.rootguide.org hardy-security/universe Packages
Hit http://mirror.rootguide.org hardy-security/universe Sources
Hit http://mirror.rootguide.org hardy-security/multiverse Packages
Hit http://mirror.rootguide.org hardy-security/multiverse Sources
Reading package lists... Done
tar: backup.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
root@hj-laptop:~#
刚才弄了下,出现上面的了,什么意思?
Err http://cn.archive.ubuntu.com hardy Release.gpg
Could not resolve 'cn.archive.ubuntu.com'
Err http://cn.archive.ubuntu.com hardy-updates Release.gpg
Could not resolve 'cn.archive.ubuntu.com'
Err http://security.ubuntu.com hardy-security Release.gpg
Could not resolve 'security.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dis ... elease.gpg Could not resolve 'cn.archive.ubuntu.com'
W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dis ... elease.gpg Could not resolve 'cn.archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists ... elease.gpg Could not resolve 'security.ubuntu.com'
W: Some index files failed to download, they have been ignored, or old ones used instead.
W: You may want to run apt-get update to correct these problems
tar: backup.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
root@hj-laptop:~# sudo apt-get update && sudo tar xzvf backup.tar.gz -C /
Hit http://mirror.rootguide.org hardy Release.gpg
Hit http://mirror.rootguide.org hardy-updates Release.gpg
Hit http://mirror.rootguide.org hardy-security Release.gpg
Hit http://mirror.rootguide.org hardy Release
Hit http://mirror.rootguide.org hardy-updates Release
Hit http://mirror.rootguide.org hardy-security Release
Hit http://mirror.rootguide.org hardy/main Packages
Hit http://mirror.rootguide.org hardy/restricted Packages
Hit http://mirror.rootguide.org hardy/main Sources
Hit http://mirror.rootguide.org hardy/restricted Sources
Hit http://mirror.rootguide.org hardy/universe Packages
Hit http://mirror.rootguide.org hardy/universe Sources
Hit http://mirror.rootguide.org hardy/multiverse Packages
Hit http://mirror.rootguide.org hardy/multiverse Sources
Hit http://mirror.rootguide.org hardy-updates/main Packages
Hit http://mirror.rootguide.org hardy-updates/restricted Packages
Hit http://mirror.rootguide.org hardy-updates/main Sources
Hit http://mirror.rootguide.org hardy-updates/restricted Sources
Hit http://mirror.rootguide.org hardy-updates/universe Packages
Hit http://mirror.rootguide.org hardy-updates/universe Sources
Hit http://mirror.rootguide.org hardy-updates/multiverse Packages
Hit http://mirror.rootguide.org hardy-updates/multiverse Sources
Hit http://mirror.rootguide.org hardy-security/main Packages
Hit http://mirror.rootguide.org hardy-security/restricted Packages
Hit http://mirror.rootguide.org hardy-security/main Sources
Hit http://mirror.rootguide.org hardy-security/restricted Sources
Hit http://mirror.rootguide.org hardy-security/universe Packages
Hit http://mirror.rootguide.org hardy-security/universe Sources
Hit http://mirror.rootguide.org hardy-security/multiverse Packages
Hit http://mirror.rootguide.org hardy-security/multiverse Sources
Reading package lists... Done
tar: backup.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors
root@hj-laptop:~#
刚才弄了下,出现上面的了,什么意思?