danellis06460
Posts: 3
Joined: Thu Jul 19, 2012 6:12 pm

raspi-config breaking apt-get ?

Thu Jul 19, 2012 6:20 pm

Hi,

I have been running the official raspbian image for a couple of days now with no issues but I seem to have broken apt-get. I tried to do an update raspi-config from r raspi-config. Apt-get ran but failed with "illegal instruction". Now if I try to run apt-get nothing happens, it just returns to the command line. If I dont involke it with sudo I get the illegal instruction error. I have deleted out /var/lib/dpkg/lock. It been about nearly 20 years since I used unix (SCO unix) so I am more than a bit rusty. I have rebooted multiple times. I just got the image to my liking I don't want to have to reimage!

Any suggestions ?

jeremy_fritz
Posts: 70
Joined: Tue Jul 17, 2012 7:04 pm

Re: raspi-config breaking apt-get ?

Fri Jul 20, 2012 11:54 am

Sorry, I can't help you. I just finished to install it.

Can you keep us posted if you managed to resolve your pb? Thanks!

plugwash
Forum Moderator
Forum Moderator
Posts: 3614
Joined: Wed Dec 28, 2011 11:45 pm

Re: raspi-config breaking apt-get ?

Fri Jul 20, 2012 12:01 pm

What is the contents of your /etc/apt/sources.list ?

danellis06460
Posts: 3
Joined: Thu Jul 19, 2012 6:12 pm

Re: raspi-config breaking apt-get ?

Fri Jul 20, 2012 4:07 pm

My sources are:


deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free r$
deb http://ftp.us.debian.org/debian wheezy main contrib non-free

I added the debian.org sources for the wireless drivers I needed. Apt-get was working after adding those until I did the raspi-config.

danellis06460
Posts: 3
Joined: Thu Jul 19, 2012 6:12 pm

Re: raspi-config breaking apt-get ?

Fri Jul 20, 2012 4:22 pm

arrh, cut and paste error

the first line is:
deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi

I removed the second line and it still just returns to the command line without doing anything.

I wondered if I had a rogue apt-get command on the system but a find -iname only shows it in usr/bin and bash-completions

plugwash
Forum Moderator
Forum Moderator
Posts: 3614
Joined: Wed Dec 28, 2011 11:45 pm

Re: raspi-config breaking apt-get ?

Fri Jul 20, 2012 6:00 pm

You likely ended up installing a version of apt from official debian armhf which is not compatible with the Pi.

try doing (as root)

wget http://archive.raspbian.org/raspbian/po ... _armhf.deb
wget http://archive.raspbian.org/raspbian/po ... _armhf.deb
dpkg -i apt_0.9.3+brpi1_armhf.deb libapt-pkg4.12_0.9.3+rpi1_armhf.deb

zimbo_ouen
Posts: 10
Joined: Wed Jul 25, 2012 8:30 am

Re: raspi-config breaking apt-get ?

Wed Jul 25, 2012 11:50 am

Thanks so much! This solved an issue I had!

Legend!

del
Posts: 5
Joined: Sun Sep 16, 2012 11:05 am

Re: raspi-config breaking apt-get ?

Sun Sep 16, 2012 11:10 am

Looks like I may have also done this but unfortunately the above fix isn't working for me. The first file "http://archive.raspbian.org/raspbian/po ... _armhf.deb" doesn't exist. I have tried using the file "apt_0.9.3+rpi1_armhf.deb" which does exist but I get the following output.

Code: Select all

root@raspberrypi:/home/pi# dpkg -i apt_0.9.3+rpi1_armhf.deb
(Reading database ... 56897 files and directories currently installed.)
Preparing to replace apt 0.9.3+rpi1 (using apt_0.9.3+rpi1_armhf.deb) ...
Unpacking replacement apt ...
Setting up apt (0.9.3+rpi1) ...
Illegal instruction
Illegal instruction
dpkg: error processing apt (--install):
 subprocess installed post-installation script returned error exit status 132
Processing triggers for man-db ...
Errors were encountered while processing:
 apt
Any help appreciated :)

del
Posts: 5
Joined: Sun Sep 16, 2012 11:05 am

Re: raspi-config breaking apt-get ?

Sun Sep 16, 2012 11:32 am

I know my last post needs to be moderated and all which is fine but I just wanted to post some more stuff that I tried :)

Code: Select all

root@raspberrypi:/home/pi# apt-get -f upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  libapt-pkg-dev libept-dev
The following packages will be upgraded:
  libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0 raspberrypi-bootloader
5 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 68.8 MB of archives.
After this operation, 6,360 kB disk space will be freed.
Do you want to continue [Y/n]? y
Get:1 http://archive.raspberrypi.org/debian/ wheezy/main libraspberrypi-dev armhf 1.20120831-1 [561 kB]
Get:2 http://archive.raspberrypi.org/debian/ wheezy/main libraspberrypi-doc armhf 1.20120831-1 [31.4 MB]
Get:3 http://archive.raspberrypi.org/debian/ wheezy/main libraspberrypi-bin armhf 1.20120831-1 [119 kB]
Get:4 http://archive.raspberrypi.org/debian/ wheezy/main libraspberrypi0 armhf 1.20120831-1 [333 kB]
Get:5 http://archive.raspberrypi.org/debian/ wheezy/main raspberrypi-bootloader armhf 1.20120831-1 [36.4 MB]
Fetched 68.8 MB in 2min 1s (566 kB/s)
debconf: apt-extracttemplates failed: No such file or directory
Setting up apt (0.9.3+rpi1) ...
Illegal instruction
Illegal instruction
dpkg: error processing apt (--configure):
 subprocess installed post-installation script returned error exit status 132
Errors were encountered while processing:
 apt
E: Sub-process /usr/bin/dpkg returned an error code (1)

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: raspi-config breaking apt-get ?

Sun Sep 16, 2012 2:25 pm

Looks like you installed something essential to dpkg and have now broken dpkg as well.
You have 2 options.
figure out what part of the install is failing, e.g. tar ?
get the deb file from the raspbian repos, and install that.
Or
start from scratch.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

del
Posts: 5
Joined: Sun Sep 16, 2012 11:05 am

Re: raspi-config breaking apt-get ?

Sun Sep 16, 2012 2:47 pm

Bugger D:

Just one more thing. dpkg did install libapt-pkg4.12_0.9.3+rpi1_armhf.deb but failed on apt_0.9.3+rpi1_armhf.deb so it is installing some deb packages.

Not sure if that makes any difference...

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: raspi-config breaking apt-get ?

Sun Sep 16, 2012 2:57 pm

Well at least it's not tar that is borked.
You have a chance...though if it were me, and if you haven't done too much work to it, I'd just reinstall.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

s_s_
Posts: 2
Joined: Wed Aug 08, 2012 6:17 pm

Re: raspi-config breaking apt-get ?

Sun Oct 14, 2012 8:36 am

i have done something similar.
i added the debian repo the the sources list, apt-get updated' and apt-get upgraded...
after doing so i rebooted and now i get all over illegal instruction.
i can't login anymore to the system.
i have set up an x86 virtual machine where my boot drive is now attached to and mounted in hope, that i can fix it somehow with a chrooted environment - though i don't yet know how.
Does anybody know how to? please reply !!!

plugwash
Forum Moderator
Forum Moderator
Posts: 3614
Joined: Wed Dec 28, 2011 11:45 pm

Re: raspi-config breaking apt-get ?

Sun Oct 14, 2012 1:46 pm

The following procedure should work but no gaurantees

I am assuming that the root filesystem for the pi is mounted on /mnt , I am also assuming that you have removed the debian source from sources.list.

apt-get install qemu-user-static and binfmt-support
cp /usr/bin/qemu-arm-static /mnt/usr/bin/qemu-arm-static
mount -t proc proc /mnt/proc
mount -t devpts devpts /mnt/dev/pts
chroot /mnt
echo 'Package: *' > /etc/apt/preferences
echo 'Pin: release v=7.0*,a=testing,c=main,o=Raspbian,l=Raspbian' >> /etc/apt/preferences
echo 'Pin-Priority: 1001' >> /etc/apt/preferences
apt-get update
apt-get dist-upgrade

s_s_
Posts: 2
Joined: Wed Aug 08, 2012 6:17 pm

Re: raspi-config breaking apt-get ?

Sun Oct 14, 2012 3:31 pm

thank you for your good guide, i will keep it in mind.
Though i did try to get it working since 7 hours now and i was successful with loading the system from another sd card (bare raspbian), then mount the external boot hdd drive at /mnt/usbdrive and then apt-get download `cat packagelist.txt` where packagelist.txt contained info from the log file of apt.
After that i did a dpkg --root=/mnt/usbdrive -i ./*.deb
Then i fsck'd the filesystem (twice, might have been paranoid ;) ) and rebooted with success.

Return to “Raspberry Pi OS”