How to wipe out and fix a broken apt-get system of an old/toy machine, without re-formatting the hard drive?

I'm trying to fix apt-get from an old toy machine so I can install packages again.

I get this after sudo apt-get install -f:

$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 avahi-daemon : Depends: upstart-job
                Depends: upstart (>= 0.6.7-4) but it is not installed
 cron : Depends: upstart-job
 dbus : Depends: upstart-job
        Depends: upstart (>= 0.6.3-6) but it is not installed
 hostname : PreDepends: upstart-job
 ifupdown : Depends: upstart-job
 initscripts : Depends: upstart but it is not installed
 module-init-tools : Depends: upstart-job
 mysql-server-5.1 : Depends: upstart-job
                    Depends: upstart (>= 0.6.7-3) but it is not installed
 netbase : Depends: upstart-job
 openssh-server : Depends: upstart-job
 plymouth : Depends: upstart-job
            Depends: mountall (>= 2.0) but it is not installed
            Recommends: plymouth-theme-ubuntu-text but it is not installed or
                        plymouth-theme
 procps : Depends: upstart-job
 rsyslog : Depends: upstart-job
 screen : Depends: upstart-job
 udev : Depends: upstart-job
 ufw : Depends: upstart-job
 ureadahead : Depends: libnih1 (>= 1.0.0) but it is not installed
              Depends: upstart (>= 0.6.0) but it is not installed
 util-linux : Depends: upstart-job
 vsftpd : Depends: upstart-job
 x11-common : Depends: upstart-job
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

But when I try to install upstart-job I get:

$ sudo apt-get install upstart-job
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'upstart' instead of 'upstart-job'
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 plymouth : Depends: mountall (>= 2.0) but it is not going to be installed
            Recommends: plymouth-theme-ubuntu-text but it is not going to be installed or
                        plymouth-theme
 upstart : Depends: libnih-dbus1 (>= 1.0.0) but it is not going to be installed
           Depends: libnih1 (>= 1.0.0) but it is not going to be installed
           Depends: mountall but it is not going to be installed
 ureadahead : Depends: libnih1 (>= 1.0.0) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Update works:

$ sudo apt-get update
Hit:1 http://mirrors.linode.com/ubuntu impish InRelease
Get:2 http://mirrors.linode.com/ubuntu impish-updates InRelease [110 kB]
Get:3 http://mirrors.linode.com/ubuntu impish-backports InRelease [101 kB]
Get:4 http://security.ubuntu.com/ubuntu impish-security InRelease [110 kB]
Fetched 321 kB in 1s (498 kB/s)
Reading package lists... Done

Since this is a toy machine, I'm open to aggressive approaches/ideas.

Thanks!


The simplest way to fix this is to use another machine (or this one, if it'll do it) to write an Ubuntu Live thumb drive, reboot from that, and select "Install Ubuntu."

The installer doesn't care if you have a blank hard disk, a broken Ubuntu, broken or working Windows, broken or working anything else, as long as the hardware is functional and there's enough storage space (plus the rest of the system requirements), you'll wind up with a working system almost every time ("almost" only because there are a few systems out there with unsupported hardware of one sort or another).

If you have data you need to keep, back that data up before you start, of course. This is greatly simplified if you put your /home on a separate partition; even if (as is prudent) you use a new login name after reinstalling, all your old stuff that goes in /home will be in the folder under your old login name (or safe on your backup).