Find the answer to your Linux question:
Results 1 to 7 of 7
Hello, I've been messing around with Ubuntu for about a day, and the last few hours I've really been restricted with a weird issue, after googling around, I found a ...
  1. #1
    Just Joined!
    Join Date
    Oct 2011
    Posts
    5

    Help With apt-get Error and Cyborg RAT 5 Mouse (Something about Nano?)

    Hello, I've been messing around with Ubuntu for about a day, and the last few hours I've really been restricted with a weird issue, after googling around, I found a few fixes, such as a few on another forum (Can't link because of lack of posts) and I tried them and they A) Didn't work for me or B) Couldn't complete them because of a different issue.

    The error I've been getting whenever I try to use apt-get such as
    Code:
    sudo apt-get install gimp
    is:
    Code:
    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?
    It asks me if I am root, so I was thinking that it might require me to go into root, although I thought that was what
    Code:
    sudo
    was for. So does anyone know a way to fix this that is likely to work and newbie friendly (Or just fairly detailed)?

    I was also having another issue, one with my mouse, it's a Cyborg RAT 5. I found a blog post (Findable by Googling "Saitek Rat in Linux") that had a fix, and I had an issue with that. So what I did was
    Code:
    sudo nano /etc/X11/Xmodmap
    then I typed
    Code:
    pointer = 1 2 3 4 5 6 7 8 9 10 11 12 0 0 0
    into the box thing (Nano?) and after that, I had no clue, the blog assumed the reader had the knowledge of what to do after that. I Googled it and found something about CTRL+O, tried that. (Is that supposed to save it?) and then it said to "You can then restart X or your computer and it should work without a problem." so I rebooted and I still have the issue of only being able to click once then I can move it around, click in Firefox, but any clicking outside of Firefox does nothing. Could someone clarify this nano thing for me?

    Edit: I am using Ubuntu 11.04
    Last edited by Vorsaykal; 10-07-2011 at 01:08 AM.

  2. #2
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274
    About E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)

    Most common cause for this error is probably that you have another program running that uses apt (taking over the lock file). As in having Synaptics running on X, or aptitude in another console. Close those programs and try the apt-get command again.

    Nothing to say about nano or the Cyborg RAT 5 Mouse, except you don't have to use nano, use the text editor you like.

    Regards
    Luis

    PS: And well yes, sudo is run this as another user or as root when you don't specify other user, but only if you have permission to (for graphic programs use gksu, as in "gksu gedit", check man gksu).
    One may say, I think, that sudo is about allowing administrators to define what users/groups can and cannot run/do (also as who and on which computers). That may be set on the /etc/sudoers file (man sudoers and man visudo).

    As an example, you'll have something like this on your /etc/sudoers file
    %admin ALL=(ALL) ALL
    and that's why you (as all members of group admin) can use sudo to act as root.

    $ apt-cache show sudo
    $ dpkg -L |grep sudo
    Last edited by ptkobe; 10-08-2011 at 02:46 AM.

  3. #3
    Linux User sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    358
    For the first problem, you either have another package manager running, such as Synaptic, or the lock file wasn't properly deleted, probably the former.

    For the second, to save a file in nano, press Ctrl-X to exit, then follow the prompts to save the file. Or use gedit.

  4. #4
    Just Joined!
    Join Date
    Oct 2011
    Posts
    5
    I've rebooted multiple times and closed every program I could, I also checked processes for stuff that looked related to apt, but it still gives me this error, I read somewhere that it happens when you interrupt a program that is in the middle of installing something.

    And as for the nano thing, that's for the info, I'll try that soon.

  5. #5
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274
    Try delete the file, then.

    $ sudo rm /var/lib/dpkg/lock

    PS: Regarding text edit, you may use
    $ gksu gedit <filename>

  6. #6
    Trusted Penguin jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    4,073
    Do you happen to have your computer set to automatically check for updates?
    If so, then even after a reboot, Synaptic could be running a sleeping process in the background.
    Last time I had that issue was back in Fedora 10. Since then, I've had all auto-updates disabled.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.

  7. #7
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274
    Maybe #555499 - Residual lock file after running aptitude - Debian Bug report logs may help

    the problem is similar and it was "apt-get update as invoked by /etc/cron.daily/apt" (your case may be other)

    I think the idea is that you may use
    $ sudo fuser /var/lib/dpkg/lock
    to find what PID(s) are using the file
    Then
    $ ps uax | grep <PID>
    will list the process name.

    Regards
    Luis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...