Reinstall everything
This might be more of a technical exercise than really a necessity.
The problem: I had defective memory and that almost certainly has led to file corruptions. Also I (still) have random program crashes. I can't trust my system files (my personal files is another problem...). Could I issue some command to apt or aptitude that redownloads and installs all packages, including kernel? If so: how? And can I trust that to work (with possibly corrupted system)? Or can I get a list of all installed packages and then provide that to a clean new installation? I want some backports too... I just thought of this solution; I will start investigating. I had finally got the set-up how I liked it :( I'd prefer to reinstall as unobtrusive as possible... I'd like to hear from people who have experience or have looked into the matter. Thanks for reading. |
On the current system, do
Code:
dpkg --get-selections > selections.txt Code:
aptitude update && aptitude install dselect && dpkg --set-selections < selections.txt && dselect install |
you could get list of all packages you have and reinstall those
Code:
dpkg --list |
Dutch Master, it worked! Thanks.
|
This is real interesting and could be a big time saver for me.
I have one problem though. When running; Code:
dpkg --get-selections > selections.txt This is in a Wheezy install and am pretty sure for this to work it would be elsewhere. So, where does this need to be to work in the; Code:
aptitude update && aptitude install dselect && dpkg --set-selections < selections.txt && dselect install |
Ok, you've created the selections.txt file. Now make a copy of the file /etc/apt/sources.list to your home dir:
Code:
cp /etc/apt/sources.list ~/sources.list Code:
cp /home/<user-name>/sources.list /etc/apt/sources.list Mind that if you stick with standard Debian packages (no multi-media or other 3rd party repo's) copying the sources.list file isn't really necessary. And if you change versions, it might actually be a bad idea to do too! |
Quote:
I don't think I made myself clear though. The only list I got from that command was /home/walt/selections.list. Walt by the way is a generic user name for generic installs of Wheezy where I go to play with new ideas or commands. I am not there right now but mounted the / partition for it and there is no copy of this file anywhere there. My impression was that this file would be in the root partition somewhere or would need to be there to use it to reinstall. Seeing how there doesn't seem to be where should I put it or do I just leave it where is is in the /home/walt directory? I actually think this would be a great way to install a copy on another box of an OS that I worked on here for someone else. There are several people I have run into that are very willing, indeed enthusiastic, about using Linux ir they don't have to install or set it up in the first place. If they are at a remote ranch somewhere it is not easy to get to them very often. Most would be quite willing to do the install if this was all that was needed to bet it up and running. I have a UPS unit but most folks don't. Power outages are not frequent but do happen. Had big fires here this year and you couldn't trust the power to be on from one minute to the next. I was shocked by the fact, in 08, that when the power died and the box did not shut down correctly my Linux install would actually work. MS never did that for me. Folks around here kind of like that idea along with the cost of the system. I could Mail them a correct disk and email everything else. May have to supply some install disks for sources as many remote ranches are still on dial up. Heck, the USPS only delivers 2 or 3 days a week to a lot of folks. If they can afford it some do have satalite connection but most don't. This would work great. Also be nice for me as I experiment with other installs to find things I want to change and this would be great. After the base install I could go to where ever my production OS is, run boinc and do my other things while a chroot environment took care of the new install. Just really need to know where that file needs to go. Looked at the man page for dpkg and it didn't give me an answer although it was pretty clear on the command and also "--set-selections". May just need to give it a whack with the thing in the /home/<user name> directory. May be where it looks for that. The sources.list is not a problem with me. I have one that I use for all installs of Debian. Just change the version name. Has some handy commented out things in it like the commands for getting gpg keys. Some folks like to play games on their box. I like to play games with Linux, particularly Debian and its relatives. Right now I actually need a new install of testing on my main drive. Perfect time to try this after I get it to work somewhere else first. |
The file selections.txt is created in the directory where you are when giving the dpkg command to create it. I assumed you'd be in the /home/<user name> directory, but it can be anywhere in the tree. Mind that if you use the tilde (~) Linux assumes you want it in the users home dir. That user is root, so look for it in /root :) For dpgk it doesn't matter where the file is, as long as you specify the correct (full) path to it when you import the file in its "database" (it's not really a database, it's a flat file, but some people understand it better when using this analogy)
HTH! |
Quote:
Will be playing with this very soon as both my favorite testing and Sid installs are a bit shaky right now but my newer installs of them are in great shape. That is all tied up with my really poor video card and the end of fglrx support for such out of date cards. Haven't tried the legacy fglrx driver because the FOSS driver is doing better than fglrx was anyway. Wasn't that way 2 years ago when those two were first installed. I have been running testing with Xfce as my production OS with Sid as my backup. Right now I am running Sid as the production OS because it runs boinc better for me. The tasks page even redraws without having to keep the cursor moving with the mouse or holding down the down arrow key. Thanks again. This looks like Fun. |
One side note on the topic: the described way does not automatically install backports.
For distribution on a disc, look into making a repository. You should be able to only supply the packages you actually want to install on a disc. (Hopefully only as little as 2 DVD's, because otherwise, you'd have to set up named repositories Disk 1,2,3 etc.) I'm not very knowledgeable on that topic, but I wish you good luck ;) |
If you add the backports repo in your sources.list prior to making a copy, it gets added automatically. But it doesn't automatically install packages from that, for that you'd need apt-pinning. Is also copy-able as in Linux everything is a file (and thus copy-able :p), just copy the file from your old system to the backup medium and copy it back in place on the new one before upgrading. It's just another step in preparation, but beyond the scope of this question...
|
All times are GMT -5. The time now is 08:09 PM. |