Announcement

Collapse
No announcement yet.

'Could not get lock' problems? (SOLVED)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    'Could not get lock' problems? (SOLVED)

    Hi,
    I have been trying to install sun-java by using Konsole (1). My internet connection went down before it finished however and I am now getting the error message below at (2).
    I did read around the forum and tried two suggestions that I found (3) and (4).
    I tried again at (5) but get the same result back. As far as I know I do not have other package programs open.
    Any suggestions please?
    Thanks

    1) ian@PC-Ian:~$ sudo apt-get install sun-java6-jre

    2) 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?

    3) ian@PC-Ian:~$ sudo dpkg --configure -a
    result) dpkg: status database area is locked by another process

    4) ian@PC-Ian:~$ sudo killall apt-get apt aptitude adept synaptic
    result) apt: no process killed
    aptitude: no process killed
    adept: no process killed
    synaptic: no process killed

    5) ian@PC-Ian:~$ sudo apt-get install sun-java6-jre
    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?
    ian@PC-Ian:~$

    #2
    Re: 'Could not get lock' problems?

    Close all running packages, and open a Konsole window.

    Code:
    sudo rm /var/lib/dpkg/lock
    Code:
    sudo dpkg --configure -a
    If there are no errors, then

    Code:
    sudo apt-get update
    Code:
    sudo apt-get install sun-java6-jre

    Comment


      #3
      Re: 'Could not get lock' problems?

      Dibl,
      I got the following from your suggestions.
      Thanks for your time.

      ian@PC-Ian:~$ sudo rm /var/lib/dpkg/lock
      [sudo] password for ian:
      ian@PC-Ian:~$ sudo dpkg --configure -a
      Setting up java-common (0.30ubuntu4) ...

      Processing triggers for man-db ...
      ian@PC-Ian:~$ sudo apt-get update
      Hit http://br.archive.ubuntu.com jaunty Release.gpg
      Ign http://br.archive.ubuntu.com jaunty/main Translation-en_US

      Get:2 http://br.archive.ubuntu.com jaunty-updates Release [49.6kB]
      ..................etc...............
      Get:20 http://security.ubuntu.com jaunty-security/multiverse Sources [14B]

      Fetched 395kB in 19s (20.0kB/s)
      Reading package lists... Done

      ian@PC-Ian:~$ sudo apt-get install sun-java6-jre
      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:
      sun-java6-jre: Depends: sun-java6-bin (= 6-13-1) but it is not going to be installed or
      ia32-sun-java6-bin (= 6-13-1) but it is not installable
      Recommends: gsfonts-x11 but it is not going to be installed
      E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
      ian@PC-Ian:~$ apt-get -f install
      E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
      E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
      ian@PC-Ian:~$ sudo apt-get install sun-java6-jre
      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:
      sun-java6-jre: Depends: sun-java6-bin (= 6-13-1) but it is not going to be installed or
      ia32-sun-java6-bin (= 6-13-1) but it is not installable
      Recommends: gsfonts-x11 but it is not going to be installed
      E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
      ian@PC-Ian:~$

      Comment


        #4
        Re: 'Could not get lock' problems?

        Try

        Code:
        sudo apt-get install -f sun-java6-jre

        Comment


          #5
          Re: 'Could not get lock' problems?

          Ahhhhhhhhhhhhhhh (slapping head) -- the sun-java6-jre package requires you to accept their EULA, in the middle of the installation process. So watch for a pop-up window, in which you need to hit the Tab key to highlight "OK" or "YES" or whatever, and then press Enter, and then it will continue and finish the installation. Sorry, I was half asleep and didn't think of it.

          Comment


            #6
            Re: 'Could not get lock' problems?

            So THAT's what I did wrong. The Internet connection didn't go down after all. I got this screen that required an <ok> but couldn't get it to accept. I tried clicking on the <ok> and 'enter' etc but couldn't get it to move on and so reckoned the system must have hung and closed the terminal.
            Nevertheless, I cannot get close to even that screen now as I get;

            ian@PC-Ian:~$ sudo apt-get install -f sun-java6-jre
            [sudo] password for ian:
            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:
            sun-java6-jre: Depends: sun-java6-bin (= 6-13-1) but it is not going to be installed or
            ia32-sun-java6-bin (= 6-13-1) but it is not installable
            Recommends: gsfonts-x11 but it is not going to be installed
            E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

            ian@PC-Ian:~$ apt-get -f install
            E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
            E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
            ian@PC-Ian:~$

            Comment


              #7
              Re: 'Could not get lock' problems?

              I still have not managed to solve this one.
              I did a search for 'java' in the Package Manager Add/Remove in System. It told me I have one broken package installed and to 'apply a broken filter to remove it'. Could anyone please tell me how to do this.
              Is it possible to do it in a Konsole?
              Thanks

              Comment


                #8
                Re: 'Could not get lock' problems?

                Code:
                sudo apt-get install -f
                then, if necessary

                Code:
                sudo apt-get install sun-java6-jre
                and watch for the prompt to hit your TAB key and then press Enter.

                Comment


                  #9
                  Re: 'Could not get lock' problems?

                  + whenever you see this
                  E: Could not open lock file /var/lib/dpkg/lock - open
                  you need to close all running packages, open a terminal and type:

                  Code:
                  sudo rm /var/lib/dpkg/lock
                  It is a lock file so that no two programmes can mess with the packages at the same time.
                  Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

                  Comment


                    #10
                    Re: 'Could not get lock' problems?

                    OK,
                    I resolved this without really trying to.
                    I looked for 'java' on the package manager 'add/remove'. I clicked on the version it listed and must have removed the problem version and installed a good one.
                    Everything seems to be working now.
                    Thanks for your time everyone.

                    Comment

                    Working...
                    X