LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-05-2010, 04:16 PM   #1
babagau
LQ Newbie
 
Registered: Jun 2010
Location: Volos, Greece
Distribution: Puredyne
Posts: 15

Rep: Reputation: 0
Cool install deb package using dpkg from live cd


I want to rescue my system. After a faulty installation of linux-firmware_1.38_all.deb (subprocess /usr/bin/dpkg returned an error code (1))
the system does not boot, even in recovery mode. Using a live cd, I downloaded the linux-firmware version I had previously, and try to install it with dpkg but I can't direct it to the directories I need:

dpkg -i linux-firmware_1.26_all.deb
Segmentation fault

dpkg -i --instdir=/mnt/sdb1 linux-firmware_1.26_all.deb
dpkg: unrecognized option '--instdir=/mnt/sdb1

I cannot get the correct parameters even by reading the man page. What am I missing? thanks guys
 
Old 12-05-2010, 06:49 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
You need to install the package from within a chroot.
 
1 members found this post helpful.
Old 12-06-2010, 07:41 AM   #3
babagau
LQ Newbie
 
Registered: Jun 2010
Location: Volos, Greece
Distribution: Puredyne
Posts: 15

Original Poster
Rep: Reputation: 0
thank you very much!
 
Old 12-06-2010, 07:46 AM   #4
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
If you are unsure how to do this, here is the script that I use
Code:
#!/bin/bash
sudo mount /dev/sdaX /mnt/
#sudo mount /dev/sdaY /mnt/boot
sudo mount --bind /proc /mnt/proc
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /sys /mnt/sys
sudo mount --bind /etc/resolv.conf /mnt/etc/resolv.conf
sudo chroot /mnt/ /bin/bash
# execute your commands here
sudo umount /mnt/etc/resolv.conf
sudo umount /mnt/sys
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
#sudo umount /mnt/boot
sudo umount /mnt/
You just have to change the sdaX to whatever partition your / exists on and uncomment the two commented lines and change to what partition your boot resides on (only if you have them on a separate partition.) You can either copy/paste the lines one at a time in the terminal, or just make the script executable and run it.
 
1 members found this post helpful.
Old 12-09-2010, 08:09 AM   #5
babagau
LQ Newbie
 
Registered: Jun 2010
Location: Volos, Greece
Distribution: Puredyne
Posts: 15

Original Poster
Rep: Reputation: 0
I also made attempts by adding init=/bin/bash at the end of the kernel line at grub start-up. So I booted in runlevel1, but after viewing the dpkg log, there were far too many packages half installed and half configured so I reinstalled the system. From what I understand by looking at your script and reading man mount, you mount the directories of the live cd at the /mnt. Why is that?
 
Old 12-09-2010, 05:13 PM   #6
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by babagau View Post
you mount the directories of the live cd at the /mnt. Why is that?
It really does not matter what you mount it at. I did forget to tell you to
Code:
mkdir /mnt
before running the script since the directory that you are mounting has to exist. You could call it anything you want.
 
Old 12-10-2010, 06:51 AM   #7
babagau
LQ Newbie
 
Registered: Jun 2010
Location: Volos, Greece
Distribution: Puredyne
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by andrewthomas View Post
It really does not matter what you mount it at.
Sorry, I think I was ambiguous, I meant why mount some of the directories of the live cd as a subtree to the sdaX mounted partition. What do we need these directories mounted there?

thanks,
Baba
 
  


Reply

Tags
dpkg, segmentation fault, unrecognized



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian package management - how are debconf and dpkg-deb related? austinium Debian 5 03-08-2010 05:25 AM
dpkg package install kushalkoolwal Debian 5 06-12-2009 03:28 PM
Using Java to install a package with dpkg in Debian basis1980 Linux - Newbie 4 12-06-2007 02:45 AM
Confused on how to remove a deb package with dpkg dr_zayus69 Debian 5 06-04-2006 02:02 PM
How to install deb package tstrickland Linux - Newbie 10 07-21-2005 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration