Unable to install anything - apt-get install systemd broken

If it doesn't relate to Debian, but you still want to share it, please do it here

Unable to install anything - apt-get install systemd broken

Postby jacky1980 » 2019-11-29 22:26

Hello,

I'm unable to fix my debian8 distro. I ran into this problem after trying to install wine. (sudo apt-get install wine)

Now after I try to install anything I get this error message:

Code: Select all
/var/cache/apt/archives $ sudo apt-get install vim
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 systemd : Depends: libsystemd0 (= 215-17+deb8u2) but 215-17+deb8u7 is to be installed
           Recommends: libpam-systemd but it is not going to be installed
 systemd-sysv : Depends: systemd (= 215-17+deb8u7) but 215-17+deb8u2 is to be installed
 vim : Depends: vim-common (= 2:7.4.488-7+deb8u3) but it is not going to be installed
       Depends: vim-runtime (= 2:7.4.488-7+deb8u3) but it is not going to be installed
       Depends: libgpm2 (>= 1.20.4) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


After searching on the internet I found this guide: http://www.iasptk.com/ubuntu-fix-broken ... -solution/ http://archive.md/18rbe

So, I tried fixing this problem using sudo apt-get -f install
Code: Select all
/var/cache/apt/archives $ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  systemd
Suggested packages:
  systemd-ui
Recommended packages:
  libpam-systemd
The following packages will be upgraded:
  systemd
1 upgraded, 0 newly installed, 0 to remove and 74 not upgraded.
Need to get 0 B/2574 kB of archives.
After this operation, 10.2 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 15446 files and directories currently installed.)
Preparing to unpack .../systemd_215-17+deb8u7_i386.deb ...
Unpacking systemd (215-17+deb8u7) over (215-17+deb8u2) ...
dpkg: error processing archive /var/cache/apt/archives/systemd_215-17+deb8u7_i386.deb (--unpack):
 error creating directory `./etc/systemd/user': Not a directory
The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.
 
Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.
Processing triggers for dbus (1.8.22-0+deb8u1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/systemd_215-17+deb8u7_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


I suspect there is something wrong with the systemd package since it tires to create a folder at the location error creating directory `./etc/systemd/user': Not a directory

I also tried sudo apt-get update --fix-missing (everything seems to be working here I just put this for completeness sake

Code: Select all
/var/cache/apt/archives $ sudo apt-get update --fix-missing
Hit http://ppa.launchpad.net vivid InRelease
Ign http://ftp.us.debian.org jessie InRelease
Hit http://ppa.launchpad.net trusty InRelease
Hit http://ftp.us.debian.org jessie Release.gpg   
Hit http://ftp.us.debian.org jessie Release       
Hit http://ppa.launchpad.net vivid/main i386 Packages                       
Hit http://ppa.launchpad.net vivid/main Translation-en                                   
Hit http://ppa.launchpad.net trusty/main i386 Packages                                             
Hit http://ppa.launchpad.net trusty/main Translation-en                     
Hit http://ftp.us.debian.org jessie/main i386 Packages
Hit http://ftp.us.debian.org jessie/main Translation-en
Reading package lists... Done   



Is there a way to fix the systemd problem? Could I use a live cd to restore the original settings before trying to install wine?
jacky1980
 
Posts: 8
Joined: 2019-11-29 21:47

Re: Unable to install anything - apt-get install systemd bro

Postby kedaha » 2019-11-29 23:02

Hi,
jacky1980 wrote:Is there a way to fix the systemd problem?

Maybe
jacky1980 wrote:Could I use a live cd to restore the original settings before trying to install wine?

No.
But it might be useful to see the contents of your sources.list file:
Code: Select all
$ cat /etc/apt/sources.list{,.d/*}
Mate DE & OSSv4.
FreedomBox in Debian
ispmail
Debian Stable

Words, as is well known, are the great foes of reality. Joseph Conrad.
Kedaha's Conjecture
User avatar
kedaha
 
Posts: 3034
Joined: 2008-05-24 12:26

Re: Unable to install anything - apt-get install systemd bro

Postby Dai_trying » 2019-11-30 07:05

jacky1980 wrote:I also tried sudo apt-get update --fix-missing (everything seems to be working here I just put this for completeness sake

Code: Select all
/var/cache/apt/archives $ sudo apt-get update --fix-missing
Hit http://ppa.launchpad.net vivid InRelease
Ign http://ftp.us.debian.org jessie InRelease
Hit http://ppa.launchpad.net trusty InRelease
Hit http://ftp.us.debian.org jessie Release.gpg   
Hit http://ftp.us.debian.org jessie Release       
Hit http://ppa.launchpad.net vivid/main i386 Packages                       
Hit http://ppa.launchpad.net vivid/main Translation-en                                   
Hit http://ppa.launchpad.net trusty/main i386 Packages                                             
Hit http://ppa.launchpad.net trusty/main Translation-en                     
Hit http://ftp.us.debian.org jessie/main i386 Packages
Hit http://ftp.us.debian.org jessie/main Translation-en
Reading package lists... Done   


Is there a way to fix the systemd problem? Could I use a live cd to restore the original settings before trying to install wine?


I think the above would indicate what the problem is, you appear to be using two Ubuntu Versions mixed with a Debian Version, Three OS's rolled into one! I'm sure the Don't break Debian crew will be along soon... I would consider this installation FUBAR and a fresh install is the only safe and sure way to give you a clean sysem, unless you really know what you are doing...
Dai_trying
 
Posts: 836
Joined: 2016-01-07 12:25

Re: Unable to install anything - apt-get install systemd bro

Postby cuckooflew » 2019-11-30 14:15

https://wiki.debian.org/DontBreakDebian
The general theme to the advice here is that consequences are not always immediate, and can make future upgrades impossible without a complete reinstall. If upgrading without a complete reinstall is important to you, be careful not to make the mistakes outlined below.

^^^^^^^^
jacky1980 wrote:
I also tried sudo apt-get update --fix-missing (everything seems to be working here I just put this for completeness sake

+++Quote from the wiki:
Don't make a FrankenDebian

Debian Stable should not be combined with other releases. If you're trying to install software that isn't available in the current Debian Stable release, it's not a good idea to add repositories for other Debian releases. The problems might not happen right away, but the next time you install updates.

The reason things can break is because the software packaged for one Debian release is built to be compatible with the rest of the software for that release. For example, installing packages from bullseye on a buster system could also install newer versions of core libraries including libc6. This results in a system that is not testing or stable but a broken mix of the two.

Repositories that can create a FrankenDebian if used with Debian Stable:

Debian testing release (currently bullseye)

Debian unstable release (also known as sid)

Ubuntu, Mint or other derivative repositories are not compatible with Debian!
Ubuntu PPAs

============ Note;/edit:
jacky1980 wrote:
I suspect there is something wrong with the systemd package since it tires to create a folder at the location error creating directory `./etc/systemd/user': Not a directory

No, that has nothing to do with it, you made the mess your self by mixing various distros, etc.
My grand father knows all about everything:
…one flew east, one flew west,
One flew over the cuckoo’s nest.

And hope to be home, with my grandfather soon.
cuckooflew
 
Posts: 86
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Unable to install anything - apt-get install systemd bro

Postby andre@home » 2019-11-30 14:30

I agree with that.

I wanna test this evening hopefully Wine for my genealogy tools and found this stable one at the source.
https://wiki.winehq.org/Debian
My tool also contains some 16 bit stuff... so I'm not sure whether it will work, but at least I think I've the right stable Wine.
andre@home
 
Posts: 355
Joined: 2011-10-02 08:00

Re: Unable to install anything - apt-get install systemd bro

Postby stevepusser » 2019-11-30 17:24

Well, that has little bearing on the OP's insane system, wouldn't you agree? Wine isn't the problem--it's the FrankenDebian they've stitched together.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Clipgrab 3.8.6, Hedgewars 1.0.0, PulseEffects 4.6.9, Telegram-desktop 1.8.15, Pale Moon 28.8.0, KeepassXC 2.5.1
User avatar
stevepusser
 
Posts: 11321
Joined: 2009-10-06 05:53

Re: Unable to install anything - apt-get install systemd bro

Postby jacky1980 » 2019-11-30 17:58

Hey here is the result from the "cat /etc/apt/sources.list{,.d/*}" call


cat /etc/apt/sources.list{,.d/*}
Code: Select all
deb http://ftp.us.debian.org/debian jessie main
deb http://ppa.launchpad.net/eltechs/jpeg8/ubuntu vivid main
deb http://ppa.launchpad.net/eltechs/wine3.0-dsound/ubuntu trusty main
jacky1980
 
Posts: 8
Joined: 2019-11-29 21:47

Re: Unable to install anything - apt-get install systemd bro

Postby kedaha » 2019-11-30 18:30

The PPAs are likely the culprit and may have broken the system but, assuming you also have aptitude installed, what does this command show?
Code: Select all
$ aptitude search '?narrow(?installed, ~Oppa)'
Mate DE & OSSv4.
FreedomBox in Debian
ispmail
Debian Stable

Words, as is well known, are the great foes of reality. Joseph Conrad.
Kedaha's Conjecture
User avatar
kedaha
 
Posts: 3034
Joined: 2008-05-24 12:26

Re: Unable to install anything - apt-get install systemd bro

Postby sunrat » 2019-11-30 20:21

Maybe it's because the latest systemd and related packages for Jessie are in the security repo and you do not have the security repo enabled. It appears it's trying to install a version from your local apt cache instead.
https://packages.debian.org/search?keywords=systemd

Add the security repo, do apt-get update and try again.

Of course this doesn't take away from the fact your foreign PPA sources can create unrecoverable problems, but it may not be the cause this time.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2920
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Unable to install anything - apt-get install systemd bro

Postby jacky1980 » 2019-11-30 21:39

I included

Code: Select all
deb http://deb.debian.org/debian/ jessie main contrib non-free
deb-src http://deb.debian.org/debian/ jessie main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free


into my sources.list file and it seemed fine. I only got one warning (W: There is no public key available for the following key IDs: AA8E81B4331F7F50) when running apt-get update

When I tried "sudo apt-get -f install"

I got the same error as before
Code: Select all
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libsystemd0 systemd systemd-sysv
Suggested packages:
  systemd-ui
Recommended packages:
  libpam-systemd
The following packages will be upgraded:
  libsystemd0 systemd systemd-sysv
3 upgraded, 0 newly installed, 0 to remove and 117 not upgraded.
Need to get 2712 kB of archives.
After this operation, 36.9 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/ jessie/updates/main libsystemd0 i386 215-17+deb8u13 [98.3 kB]
Get:2 http://security.debian.org/ jessie/updates/main systemd i386 215-17+deb8u13 [2576 kB]
Get:3 http://security.debian.org/ jessie/updates/main systemd-sysv i386 215-17+deb8u13 [37.5 kB]
Fetched 2712 kB in 3s (723 kB/s)     
(Reading database ... 15446 files and directories currently installed.)
Preparing to unpack .../libsystemd0_215-17+deb8u13_i386.deb ...
Unpacking libsystemd0:i386 (215-17+deb8u13) over (215-17+deb8u7) ...
Setting up libsystemd0:i386 (215-17+deb8u13) ...
Processing triggers for libc-bin (2.19-18+deb8u10) ...
(Reading database ... 15446 files and directories currently installed.)
Preparing to unpack .../systemd_215-17+deb8u13_i386.deb ...
Unpacking systemd (215-17+deb8u13) over (215-17+deb8u2) ...
dpkg: error processing archive /var/cache/apt/archives/systemd_215-17+deb8u13_i386.deb (--unpack):
 error creating directory `./etc/systemd/user': Not a directory
The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.
 
Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.
Processing triggers for dbus (1.8.22-0+deb8u1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/systemd_215-17+deb8u13_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


It still seems to have a problem creating this folder: error creating directory `./etc/systemd/user': Not a directory

Do you think I could fix the system by deleting entries from the var/lib/dpkg/status file? or reinstall systemd with an older package that I know is working
jacky1980
 
Posts: 8
Joined: 2019-11-29 21:47

Re: Unable to install anything - apt-get install systemd bro

Postby kedaha » 2019-11-30 22:17

jacky1980 wrote:Do you think I could fix the system by deleting entries from the /var/lib/dpkg/status file?

It is dangerous. As the Basic Precautions in the Manual, warns here:
Do not erase or alter files in "/var/lib/dpkg/".

Needless to say that a backup copy must be made before altering such a file.
Packages can be installed manually from /var/cache/apt/archives/ with dpkg -i
Mate DE & OSSv4.
FreedomBox in Debian
ispmail
Debian Stable

Words, as is well known, are the great foes of reality. Joseph Conrad.
Kedaha's Conjecture
User avatar
kedaha
 
Posts: 3034
Joined: 2008-05-24 12:26

Re: Unable to install anything - apt-get install systemd bro

Postby sunrat » 2019-11-30 23:16

jacky1980 wrote: I only got one warning (W: There is no public key available for the following key IDs: AA8E81B4331F7F50) when running apt-get update

There's usually a way to install keys.

It still seems to have a problem creating this folder: error creating directory `./etc/systemd/user': Not a directory

What directory are you running the terminal in? Try first
Code: Select all
cd /

It helps to include the prompt and actual commands run when posting code.
I don't have anything as old as Jessie but I think /etc/systemd/user is a default directory.
It seems you may have multiple problems here so you may have to work through them one at a time.
It also appears you haven't done an upgrade in a very long time.

And the question must be asked, why are you not using current stable Buster?
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2920
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Unable to install anything - apt-get install systemd bro

Postby jacky1980 » 2019-12-01 01:25

I tried running the command in the root dir

pi@raspberrypi:/ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
systemd : Depends: libsystemd0 (= 215-17+deb8u2) but 215-17+deb8u13 is installed
Recommends: libpam-systemd but it is not installed
systemd-sysv : Depends: systemd (= 215-17+deb8u7) but 215-17+deb8u2 is installed
E: Unmet dependencies. Try using -f.


Code: Select all
pi@raspberrypi:/ $ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  systemd systemd-sysv
Suggested packages:
  systemd-ui
Recommended packages:
  libpam-systemd
The following packages will be upgraded:
  systemd systemd-sysv
2 upgraded, 0 newly installed, 0 to remove and 117 not upgraded.
Need to get 0 B/2613 kB of archives.
After this operation, 36.9 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: warning: files list file for package 'teamspeak3-client' missing; assuming package has no files currently installed
(Reading database ... 15444 files and directories currently installed.)
Preparing to unpack .../systemd_215-17+deb8u13_i386.deb ...
Unpacking systemd (215-17+deb8u13) over (215-17+deb8u2) ...
dpkg: error processing archive /var/cache/apt/archives/systemd_215-17+deb8u13_i386.deb (--unpack):
 error creating directory `./etc/systemd/user': Not a directory
The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.
 
Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.
Processing triggers for dbus (1.8.22-0+deb8u1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/systemd_215-17+deb8u13_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


Same result. I think I will just have to do some backups and clean reinstall. I'm using jessie because it comes with the exagear default raspberry image. It's still supported till 2020 in the LTS version. (exagear has not been updated for a year since the comapany stopped their service).

I don't have anything as old as Jessie but I think /etc/systemd/user is a default directory.


/etc/systemd/user does not exist. I created the folder manually but it didn't change anything :/

It seems you may have multiple problems here so you may have to work through them one at a time.

You are probably right. I thought there might be some easy way to reset apt-get using a live cd or files from the internet, so I can install other packages again. I didn't add any repositories. afaik it came preinstalled with the ubuntu wine repositories. I was able to download packages before just fine. Maybe there was a mismatch between my old debian version and the ubuntu wine repository.
jacky1980
 
Posts: 8
Joined: 2019-11-29 21:47

Re: Unable to install anything - apt-get install systemd bro

Postby sunrat » 2019-12-01 03:49

Try
Code: Select all
apt-get dist-upgrade
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2920
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Unable to install anything - apt-get install systemd bro

Postby Head_on_a_Stick » 2019-12-01 09:24

kedaha wrote:
Code: Select all
$ aptitude search '?narrow(?installed, ~Oppa)'

Thank you so much, I've been trying to figure out that syntax for quite a while now. Brilliant.

@OP: there is also
Code: Select all
aptitude search '?narrow(?installed, !?origin(debian))'
Don't break DebianHow to report bugs

SharpBang GNU/Linux® — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10695
Joined: 2014-06-01 17:46
Location: /dev/chair

Next

Return to Offtopic

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable