0

My main system (Xubuntu 20.04.) is in deep trouble. I see no hardware problems, but only very basic things are working. Web is down. My RAID is down. Several other things are flakey. I don't know if it's configuration or the actual programs.

I've made a clone of the main disk, so I can be a bit adventurous, but there are some basic tasks that I would like to do, but don't know how. The first is re-installing all the software I can. Not just the default stuff, but every package I ever installed. SO:

  1. I've read about how to do "something else" to do a refresh of the initial set of programs So I can already do that.

  2. There are various kinds of configuration files. I've been running Ubuntu for a couple of decades so there's no chance I remember them all; is there a way to find their locations? Can I ensure they are safe, or restorable?

  3. How do I reinstall the packages I have installed manually. I've got lists of all packages from three sources: (1) dpkg --get-selections, (2) apt-mark and (3) apt list, but don't see how to use them directly to cause packages to be refreshed.

In response to the first answer, I tried this script

apt update
dpkg --set-selections </PACKAGE-LISTS/b5-getsel
apt-get dselect-upgrade

but it made no changes to the installed packages, in spite of the file having >3000 lines, specifically including vim(1), which I sorely miss.

How can I debug this?

  • You can re-install Ubuntu Desktop (inc. flavors) and it'll auto-reinstall the manually installed packages. If those packages are desktop apps, those configs/setups will survive this install; as those config files are stored in $HOME (ie. /home/$USER) and untouched unless you format!. Only server apps (which can store configs within system directories) OR any desktop configs that you've made system wide (thus were placed in system directories, for a multi-user machine) get lost; but that's rare for desktop systems. – guiverc Jan 31 '23 at 23:11
  • Your main question appears to be about apps; however App configs are app/package specific so maybe in many places. There are many standards to choose from, so the app developer gets to choose, though the packager can also alter it... GNOME apps tend to follow one standard, KDE another, Xfce..... ie. the apps involved (you gave no specifics) influence where those are found; though MOST apps from teams (eg. Xfce) tend to follow the same rules, there is no guarantee even of that. – guiverc Jan 31 '23 at 23:13
  • Just FYI: (& sorry if this is off-topic), but have you tried Ubuntu Forums? as if it was me writing this question, I'd have used a forum rather than a Q&A site which requires questions to be specific on a problem that needs to be solved. Forums allow suggestions to be given easily & more completely (and not deleted as my last comments aren't about your question itself & suggestions for improvement/clarification). The box I'm using now is a recent build (new second hand box, as my old box PSU died) so I'm grabbing my old configs from backups etc – guiverc Jan 31 '23 at 23:25
  • 1
    This looks very much like the question that you asked yesterday. There's no easy way to accomplish what you seek. And, since you are likely to have follow-up questions and issues, I am uncertain if AskUbuntu's format is suited to your issue(s). – user535733 Feb 01 '23 at 00:59
  • Thanks for the advice. I'm taking most of this over to forums, which I was not aware of (or have forgotten about -- I was last doing this stuff over a decade ago). – ForDummies Feb 12 '23 at 16:23

1 Answers1

0

this makes a list of your installed packages and export it. This is for your old system.

dpkg --get-selections > my.selections 

The next imports the package.list this is for the new system. So you need the created file on your new install.

sudo dpkg --set-selections < my.selections

Now you can run

 sudo apt-get dselect-upgrade

Make sure you have the same package sources active like before.And refresh it before with

sudo apt update
nobody
  • 5,437
  • FAILURE: I just got far enough along in the recovery to try this, and it failed to make any changes at all. My selection file has 3299 lines, and dpkg reported nothing new was added. I checked, for instance, that vim was in the selections list, and is still not installed in this system. How can I debug this? – ForDummies Feb 12 '23 at 16:41
  • I added the script I used to the body of the question – ForDummies Feb 12 '23 at 16:42