Score:0

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

br flag

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!

user535733 avatar
cn flag
Looks like you have updated your sources and are trying to dist-upgrade from some random old version. We generally don't provide support for that method of upgrading since your starting point could be *anything* (broken, compromised, corrupted, not Ubuntu, etc.), and apt simply isn't designed to magically mend broken systems or safely jump over releases. You're welcome to try it (looks like you did), but we won't help resolve the unresolvable -- your advice from us will be to start over from a known point, which usually means reinstalling.
Score:1
cn flag

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).

br flag
But I can't wipe out the filesystem, there are files, configuration, services, etc. that I would like to keep. I've updated the title to reflect that. Thanks!
cocomac avatar
cn flag
Then take a backup [to an external drive], and then reinstall. Take a backup of any important config files, and data you want to keep to an external drive, and then reinstall. But fixing it isn't easy
Zeiss Ikon avatar
cn flag
For a major system problem, reinstalling is the fastest, easiest way to "fix" the system. FWIW, I keep all my important files (/home and additional stuff) in separate partitions, and then instruct the installer to reuse /home and reformat only the system partition. *Still* want a backup, but I haven't needed to restore.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.