LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-02-2013, 06:48 AM   #1
Piyush M
Member
 
Registered: Jan 2011
Location: Maharashtra,India
Distribution: debian 7.2
Posts: 125

Rep: Reputation: 6
install software via terminal


I am having debian 6 (64bit) on my laptop.
Its installed from cd-1 so it is having very few softwares installed within.

I am trying to install supertux and system monitor via terminal but it gives me output as follows

apt-get install supertux
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

I am using it as root. pls help me. Also tell me if anything I need to do in sources.list file.

And also in future if I wanted to install any software then how can I get related things to paste in sources.list file?

Thanks a lot !!!
 
Old 02-02-2013, 06:51 AM   #2
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Back to Debian, and only Debian.
Posts: 1,158
Blog Entries: 7

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
Do you have Synaptic Package Manager or anythign else open that interacts with the package system?

As a prompt type 'ps -A | grep apt' and if so kill any process that shows.

As a last resort if you are sure nothing else is using APT: 'sudo rm /var/lib/apt/lists/lock'
 
Old 02-02-2013, 07:30 AM   #3
Piyush M
Member
 
Registered: Jan 2011
Location: Maharashtra,India
Distribution: debian 7.2
Posts: 125

Original Poster
Rep: Reputation: 6
again and again terminal is giving message as,

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

I tried your trick by typing
ps -A | grep apt
but it is giving output as,
bash: ps-A: command not found

And yes I am having synaptic but I like installing via terminal..!

pls help !

Last edited by colucix; 02-02-2013 at 07:34 AM. Reason: Cleaned (erroneous duplicate)
 
Old 02-02-2013, 07:40 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by Piyush M View Post
bash: ps-A: command not found
This indicates the command was typed wrong: it should be
Code:
ps -A
with a space between the command (ps) and the option (-A) whereas the error message reveal it was written as a single item (ps-A). Another way to check which process keep a file or a directory busy is by means of the lsof command. Try
Code:
sudo lsof /var/lib/dpkg
enter your user's password when prompted and post the results here, if in doubt.

An aside note: please use CODE tags when posting text copied/pasted from the terminal. They improve readability and preserve spacing. To use CODE tags either put [CODE] and [/CODE] around the text OR switch to Advanced Mode, select the text and click the # button. Thanks.
 
Old 02-02-2013, 07:55 AM   #5
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Back to Debian, and only Debian.
Posts: 1,158
Blog Entries: 7

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
Quote:
Originally Posted by Piyush M View Post
And yes I am having synaptic but I like installing via terminal..!

You can have synaptic installed and install using the terminal, just Synaptic cannot be running at the time you try to install a program at the terminal.
 
Old 02-02-2013, 09:00 AM   #6
Piyush M
Member
 
Registered: Jan 2011
Location: Maharashtra,India
Distribution: debian 7.2
Posts: 125

Original Poster
Rep: Reputation: 6
After re entering ps -A I got the result,

2345 pts/0 00:00:10 synaptic

what to do next ?
 
Old 02-02-2013, 09:03 AM   #7
zrdc28
Member
 
Registered: Dec 2007
Location: Alabama USA
Distribution: Slackware current
Posts: 291

Rep: Reputation: 51
kill 2345
 
Old 02-02-2013, 09:26 AM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,584
Blog Entries: 1

Rep: Reputation: 509Reputation: 509Reputation: 509Reputation: 509Reputation: 509Reputation: 509
Basically you can't be using the dpkg files in another term while trying to use them elsewhere. As in running apt-get update while apt-get update is already running. Using lsof lets you know which application is currently using the file(s) in question. And fuser might help too. You run into similar issues with mount if you're cd'd into one of the directories of a mounted device and are trying to unmount it.

You can kill the application as a quick release of the file, or you can find what terminal is accessing it and play nice with that application.

kill -9 2345
(to send SIGTERM to the application, as above)

or
killall synaptic
(to do basically the same thing, but multiple times if there happens to be more than one instance)

Basically kill requires the use of the pid of the application. And killall lets you use the applications name. If you can get to the term and application actually touching it directly that would probably work best. There are times when you don't want an application to fail by telling it to SIGTERM now. Or the power company does that for you by having an interruption in service. Since ending an update while performing the update can hose a few things. Particularly if libc is involved. I've had /var/lib/dpkg/available get corrupted once from a power failure. And that was no fun back in the early days. Especially if you're on dialup (or was at that time). Fortunately there was available.old at that time which I used to replace available and solved my issue.
 
Old 02-02-2013, 10:38 AM   #9
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Back to Debian, and only Debian.
Posts: 1,158
Blog Entries: 7

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
BTW it might be nicer if you try to quit a program normally rather than just arbitrarily killing processes. Just lick the X on the titlebar. Never know what changes you may want to keep that will be lost by killing. Just my $0.02.
 
Old 02-03-2013, 06:32 PM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,294

Rep: Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358
Don't use '-9' unless you jhave to; it kills it stone dead without giving it a chance to cleanup eg clear the lock/pid file.
Just try the kill cmd without -9, or (better if you have a GUI) use the GUI.

http://linux.die.net/man/1/kill <-- read this
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Using terminal command sudo apt-get "program" install to install software rphowardjr Linux - Newbie 2 12-05-2012 12:36 PM
Terminal commands for installing software Ed Gray Linux - Software 2 07-25-2012 11:25 AM
PUTTY terminal software elico Linux - Newbie 2 03-15-2012 07:48 AM
Terminal software metallica1973 Linux - Networking 2 12-27-2006 11:22 AM
What terminal software do u use? ICO Linux - Software 27 02-09-2004 04:37 AM


All times are GMT -5. The time now is 09:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration