LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   fixing apt-get errors (https://www.linuxquestions.org/questions/debian-26/fixing-apt-get-errors-837165/)

i_heart_pandas 10-09-2010 11:41 PM

fixing apt-get errors
 
been living with apt-get not working for a while now, don't know how it broke but i'm running a 2.6.26.8 kernel for vmware and maybe thats it?

Code:

bulldozer:/home/g3rc4n# uname -r
2.6.26.8
bulldozer:/home/g3rc4n# apt-get update
Hit http://ftp.uk.debian.org lenny Release.gpg
Ign http://ftp.uk.debian.org lenny/main Translation-en_GB
Hit http://ftp.uk.debian.org lenny Release                               
Ign http://ftp.uk.debian.org lenny/main Packages/DiffIndex                                                                     
Ign http://ftp.uk.debian.org lenny/main Sources/DiffIndex                                                 
Hit http://ftp.uk.debian.org lenny/main Packages                         
Hit http://security.debian.org lenny/updates Release.gpg                 
Ign http://security.debian.org lenny/updates/main Translation-en_GB                             
Hit http://ftp.uk.debian.org lenny/main Sources                                                 
Hit http://security.debian.org lenny/updates Release                     
Ign http://security.debian.org lenny/updates/main Packages/DiffIndex     
Ign http://security.debian.org lenny/updates/main Sources/DiffIndex
Hit http://security.debian.org lenny/updates/main Packages
Hit http://volatile.debian.org lenny/volatile Release.gpg
Ign http://volatile.debian.org lenny/volatile/main Translation-en_GB
Hit http://security.debian.org lenny/updates/main Sources
Hit http://volatile.debian.org lenny/volatile Release
Ign http://volatile.debian.org lenny/volatile/main Packages/DiffIndex
Ign http://volatile.debian.org lenny/volatile/main Sources/DiffIndex
Hit http://volatile.debian.org lenny/volatile/main Packages
Hit http://volatile.debian.org lenny/volatile/main Sources
Reading package lists... Done
bulldozer:/home/g3rc4n# apt-get upgrade --yes
Reading package lists... Done
Building dependency tree     
Reading state information... Done
The following packages have been kept back:
  bind9 bind9-host bind9utils dnsutils
The following packages will be upgraded:
  acpid apt apt-utils avahi-daemon bzip2 cpio cups-bsd cups-client cups-common debian-archive-keyring dhcp3-client dhcp3-common dpkg-dev dselect fuse-utils
  ghostscript gnome-network-admin gnome-system-tools gs-common gtk2-engines-pixbuf iputils-ping kdelibs-data kdelibs4c2a libapr1 libaprutil1 libavahi-client-dev
  libavahi-client3 libavahi-common-data libavahi-common-dev libavahi-common3 libavahi-compat-libdnssd1 libavahi-core5 libavahi-glib-dev libavahi-glib1
  libavahi-gobject0 libavahi-qt3-1 libavahi-ui0 libavcodec51 libavformat52 libavutil49 libbz2-1.0 libcups2 libcupsimage2 libcupsys2 libcurl3-gnutls libfam0
  libfreetype6 libfreetype6-dev libfuse2 libgs8 libgtk2.0-0 libgtk2.0-0-dbg libgtk2.0-bin libgtk2.0-common libgtk2.0-dev libjasper1 libkpathsea4 libldap-2.4-2
  libmozjs1d libpango1.0-0 libpango1.0-common libpango1.0-dev libpcsclite1 libpng12-0 libpng12-dev libpoppler-glib3 libpoppler3 libpostproc51 libpq5 libpurple0
  libqt4-dbus libqt4-designer libqt4-network libqt4-qt3support libqt4-script libqt4-sql libqt4-sql-mysql libqt4-xml libqtcore4 libqtgui4 libsmbclient libssl0.9.8
  libsvn-perl libsvn1 libswscale0 libtheora0 libtiff4 libwbclient0 libwww-perl libxerces2-java libxerces2-java-gcj libxext-dev libxext6 lintian
  linux-headers-2.6.26-2-all-amd64 linux-headers-2.6.26-2-amd64 linux-headers-2.6.26-2-common linux-headers-2.6.26-2-common-openvz
  linux-headers-2.6.26-2-common-vserver linux-headers-2.6.26-2-common-xen linux-headers-2.6.26-2-openvz-amd64 linux-headers-2.6.26-2-vserver-amd64
  linux-headers-2.6.26-2-xen-amd64 linux-libc-dev mysql-client mysql-client-5.0 mysql-server mysql-server-5.0 nano nfs-common nfs-kernel-server openoffice.org
  openoffice.org-base openoffice.org-base-core openoffice.org-calc openoffice.org-common openoffice.org-core openoffice.org-draw openoffice.org-evolution
  openoffice.org-filter-mobiledev openoffice.org-gcj openoffice.org-gnome openoffice.org-gtk openoffice.org-help-en-gb openoffice.org-help-en-us
  openoffice.org-impress openoffice.org-java-common openoffice.org-l10n-en-gb openoffice.org-math openoffice.org-officebean openoffice.org-report-builder-bin
  openoffice.org-style-andromeda openoffice.org-style-tango openoffice.org-writer openssl pidgin pidgin-data poppler-utils python-support python2.4 python2.4-minimal
  python2.5 python2.5-dev python2.5-minimal qt4-qtconfig samba samba-common smbclient subversion sudo system-tools-backends tar texlive-base-bin texlive-base-bin-doc
  texlive-extra-utils totem-common totem-gstreamer totem-mozilla totem-plugins ttf-opensymbol tzdata usbutils w3m wget winbind wireshark wireshark-common xscreensaver
  xscreensaver-data xserver-xorg-video-intel xulrunner-1.9 xulrunner-1.9-gnome-support
172 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
2 not fully installed or removed.
Need to get 0B/343MB of archives.
After this operation, 24.0MB of additional disk space will be used.
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 175577 files and directories currently installed.)
Preparing to replace acpid 1.0.8-1lenny1 (using .../acpid_1.0.8-1lenny2_amd64.deb) ...
invoke-rc.d: not a symlink: /etc/rc2.d/S12acpid
dpkg: warning - old pre-removal script returned error exit status 102
dpkg - trying script from the new package instead ...
invoke-rc.d: not a symlink: /etc/rc2.d/S12acpid
dpkg: error processing /var/cache/apt/archives/acpid_1.0.8-1lenny2_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 102
update-rc.d: warning: /etc/rc1.d/K88acpid is not a symbolic link
update-rc.d: warning: /etc/rc2.d/S12acpid is not a symbolic link
update-rc.d: warning: /etc/rc3.d/S12acpid is not a symbolic link
update-rc.d: warning: /etc/rc4.d/S12acpid is not a symbolic link
update-rc.d: warning: /etc/rc5.d/S12acpid is not a symbolic link
invoke-rc.d: not a symlink: /etc/rc2.d/S12acpid
dpkg: error while cleaning up:
 subprocess post-installation script returned error exit status 102
Preparing to replace tar 1.20-1 (using .../tar_1.20-1+lenny1_amd64.deb) ...
Unpacking replacement tar ...
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/acpid_1.0.8-1lenny2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
bulldozer:/home/g3rc4n# apt-get -f install --yes
Reading package lists... Done
Building dependency tree     
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgutenprint2 openprinting-ppds libqt4-qt3support libsensors3 poppler-utils libsnmp15 cupsddk libqt4-script libqt4-designer libqt4-network libqt4-dbus
  python-imaging libslp1 python2.4 python-ipy libsnmp-base ijsgutenprint libijs-0.35 libqtcore4 python-foomatic ssl-cert qt4-qtconfig cupsddk-drivers libqt4-sql
  foomatic-db-gutenprint openssl-blacklist python2.4-minimal libqt4-xml libqtgui4 libavahi-compat-libdnssd1 libqt4-sql-mysql hplip-data
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  acpid
The following packages will be upgraded:
  acpid
1 upgraded, 0 newly installed, 0 to remove and 174 not upgraded.
3 not fully installed or removed.
Need to get 0B/38.0kB of archives.
After this operation, 0B of additional disk space will be used.
Setting up tar (1.20-1+lenny1) ...
(Reading database ... 175577 files and directories currently installed.)
Preparing to replace acpid 1.0.8-1lenny1 (using .../acpid_1.0.8-1lenny2_amd64.deb) ...
invoke-rc.d: not a symlink: /etc/rc2.d/S12acpid
dpkg: warning - old pre-removal script returned error exit status 102
dpkg - trying script from the new package instead ...
invoke-rc.d: not a symlink: /etc/rc2.d/S12acpid
dpkg: error processing /var/cache/apt/archives/acpid_1.0.8-1lenny2_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 102
update-rc.d: warning: /etc/rc1.d/K88acpid is not a symbolic link
update-rc.d: warning: /etc/rc2.d/S12acpid is not a symbolic link
update-rc.d: warning: /etc/rc3.d/S12acpid is not a symbolic link
update-rc.d: warning: /etc/rc4.d/S12acpid is not a symbolic link
update-rc.d: warning: /etc/rc5.d/S12acpid is not a symbolic link
invoke-rc.d: not a symlink: /etc/rc2.d/S12acpid
dpkg: error while cleaning up:
 subprocess post-installation script returned error exit status 102
Errors were encountered while processing:
 /var/cache/apt/archives/acpid_1.0.8-1lenny2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
bulldozer:/home/g3rc4n# dpkg --configure -a
Setting up linux-image-2.6.26-2-amd64 (2.6.26-25lenny1) ...
Running depmod.
Running mkinitramfs-kpkg.
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
Not updating initrd symbolic links since we are being updated/reinstalled
(2.6.26-19lenny2 was configured last, according to dpkg)
Failed to symbolic-link boot/vmlinuz-2.6.26-2-amd64 to vmlinuz.
dpkg: error processing linux-image-2.6.26-2-amd64 (--configure):
 subprocess post-installation script returned error exit status 17
dpkg: error processing acpid (--configure):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting configuration.
Errors were encountered while processing:
 linux-image-2.6.26-2-amd64
 acpid

hate to be useless but have no idea where to start?

Kenny_Strawn 10-10-2010 12:03 AM

Code:

apt-get -f install
This will automatically tell apt-get to correct dependencies and continue to configure your packages. Note that apt-get -f install has NO PACKAGE APPENDED TO IT!!! This is essential; if you try to apt-get -f install a package you will further complicate things.

jdkaye 10-10-2010 09:11 AM

You might find that your life is much easier if you switch from apt-get to aptitude.
ciao,
jdk

craigevil 10-10-2010 09:47 AM

Quote:

Originally Posted by jdkaye (Post 4122867)
You might find that your life is much easier if you switch from apt-get to aptitude.
ciao,
jdk

It is so far from the truth it isn't even funny.

apt-get works just fine. I have used apt-get and apt-get alone for over six years without problems. If the all might Debian gods do not want people using apt-get then it should be removed from the repos.

First I would edit /etc/apt/apt.conf (You may need to create it) and add:
// auto-remove breaks on meta packages
APT::Get::AutomaticRemove "0";
APT::Get::HideAutoRemove "1";

// Recommends are as of now still abused in many packages
APT::Install-Recommends "0";
APT::Install-Suggests "0";
Debug::pkgAutoRemove "0";

Then do:
apt-get clean
apt-get update
apt-get dist-upgrade

widget 10-10-2010 12:53 PM

Along with "apt-get -f install" I find that
[code]
sudo apt-get --configure -a
[code]
will clear many of this type of error for you too. I usually try it first. It is also handy without the "-a" and with a package name in that space.

Just to add to the dpkg handy commands;
Code:

dpkg-reconfigure <package or -a>
is also very handy if things are not just right as can happen in unstable versions very easily and stable ones if I am tweeking them beyond my comfort zone of knowledge (the only way to learn something new).

AlucardZero 10-10-2010 08:07 PM

aptitude works just fine. I have used aptitude and aptitude alone for over three years without problems. If the almighty Debian gods want people to use aptitude then they should recommend its use over apt-get -- oh, they have been, for years?

I switched to aptitude on the day that apt-get tried to remove libc6. It solved my dependency problem, and I haven't looked back.

In any case.. try it.

Dutch Master 10-10-2010 09:44 PM

The key is kinda overlooked by all this bickering on apt-get vs aptitude. Let's get back to the OP chaps...

The reason the original command failed was a number of links that weren't sym-links but (presumably) the files themselves. The acpid package is to blame, obviously, so removing that should remedy the problem... Unfortunately, acpid may have dependencies that prevent the upgrade altogether... The "apt-get -f install" command will do just fine in this case.

Personally, I'm using aptitude, mostly interactive. The keyboard-based menu is much easier then memorizing commandline options ;) Especially for novices! My :twocents:

craigevil 10-10-2010 11:14 PM

apt-get purge acpid
apt-get clean
dpkg --configure --pending
apt-get update
apt-get -f install
apt-get upgrade
apt-get dist-upgrade
apt-get install acpid

Feel free to use aptitude in place of apt-get.

Also please post your sources.list

i_heart_pandas 10-11-2010 06:53 AM

tried everything still getting all sort of type 1 errors

Code:

bulldozer:/home/g3rc4n# cat /etc/apt/sources.list
#
# deb cdrom:[Debian GNU/Linux 5.0.0 _Lenny_ - Official amd64 NETINST Binary-1 20090214-15:57]/ lenny main

#deb cdrom:[Debian GNU/Linux 5.0.0 _Lenny_ - Official amd64 NETINST Binary-1 20090214-15:57]/ lenny main

deb http://ftp.uk.debian.org/debian/ lenny main
deb-src http://ftp.uk.debian.org/debian/ lenny main

deb http://security.debian.org/ lenny/updates main
deb-src http://security.debian.org/ lenny/updates main

deb http://volatile.debian.org/debian-volatile lenny/volatile main
deb-src http://volatile.debian.org/debian-volatile lenny/volatile main

created that /etc/apt/apt.conf file
Code:

bulldozer:/home/g3rc4n# cat /etc/apt/apt.conf
APT::Get::AutomaticRemove "0";
APT::Get::HideAutoRemove "1";
APT::Install-Recommends "0";
APT::Install-Suggests "0";
Debug::pkgAutoRemove "0";


craigevil 10-11-2010 07:26 AM

Never used vmware, I just use virtualbox.

rm /var/cache/apt/archives/acpid_1.0.8-1lenny2_amd64.deb

Do you use raid? If not you can safely remove mdadm.

aptitude remove mdadm acpid

aptitude clean
aptitude update
aptitude dist-upgrade

Debian Reference - Debian package management
Quote:

APT upgrade troubleshooting

Package dependency problems may occur when upgrading in unstable or testing as described in Upgrading, Section 5.3. Most of the time this is because a package that will be upgraded Depends on a package that is not yet available. These problems are fixed by using

# aptitude dist-upgrade

If this does not work, then repeat one of the following until the problem resolves itself:

# aptitude -f upgrade # continue upgrade even after error
... or
# aptitude -f dist-upgrade # continue dist-upgrade even after error

Some really broken upgrade scripts may cause persistent trouble. It is usually better to resolve this type of situation by inspecting the /var/lib/dpkg/info/packagename.{post,pre}{inst,rm} scripts of the offending package and then running:

# dpkg --configure -a # configures all partially installed packages

If a script complains about a missing configuration file, look in /etc/ for the corresponding configuration file. If one exists with an extension of .dpkg-new (or something similar), mv it to remove the suffix.

i_heart_pandas 10-12-2010 06:12 AM

yes i do use raid, i'll try removing acpid later though


All times are GMT -5. The time now is 05:06 AM.