Announcement

Collapse
No announcement yet.

Can't delete certain files

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

    Can't delete certain files

    I've got one file that I can't delete. It's got a weird file date, and no commands (like "sudo rm", "sudo mv", or "sudo chmod") can change this file - all I get is "Operation not permitted". >

    Any ideas

    #2
    Re: Can't delete certain files

    Giving information about the path to the file as well as the permissions etc might help. a cut and paste of "ls -l" in the directory might be useful.

    Comment


      #3
      Re: Can't delete certain files

      There may be a good reason why the operation is not permitted. What exactly are you trying to delete?

      Originally posted by tnorris
      Giving information about the path to the file as well as the permissions etc might help. a cut and paste of "ls -l" in the directory might be useful.
      Indeed. Open a Konsole window (Alt+F2 -> konsole) and give us the output of the ls -l command.

      Code:
      ls -l /full/path/and/file/name
      Welcome newbies!
      Verify the ISO
      Kubuntu's documentation

      Comment


        #4
        Re: Can't delete certain files

        I think the condition was somehow caused by upgrading libc6 with adept. These two files cannot be deleted.
        Code:
        > ls -l /var/lib/dpkg/infoNOT
        total 52
        -rwxr-xr-x 1    336   37609 10497235 1939-10-04 13:52 libc6.postinst
        --wxr-Sr-- 1 672442890 184549440  49152 2005-04-16 22:26 unzip.md5sums
        >
        I was able to rename the info directory, create a new one, and move all the other files over. Then adept worked fine. I also tried rm -df on the renamed dir but it won't let me delete a non-empty directory.

        Comment


          #5
          Re: Can't delete certain files

          Originally posted by tfbiv427
          I think the condition was somehow caused by upgrading libc6 with adept. These two files cannot be deleted.
          Code:
          > ls -l /var/lib/dpkg/infoNOT
          If you boot to single user mode, or boot from the live CD, then you should be able to delete them. I don't recommend deleting them, but it's your system.
          Welcome newbies!
          Verify the ISO
          Kubuntu's documentation

          Comment


            #6
            Re: Can't delete certain files

            Unfortunately, that did not work either. I still got the error on both files while in single-user mode. I couldn't even do chmod 777 libc6.postinst. >

            I guess I'll just leave those files there until I think of something else to try.

            Thanks for your assistance.

            Comment


              #7
              Re: Can't delete certain files

              Did you try deleting them after booting from the live CD?

              Note: I still think it is probably a bad idea to delete those files, but I respect your right to administer your computer as you please.
              Welcome newbies!
              Verify the ISO
              Kubuntu's documentation

              Comment


                #8
                Re: Can't delete certain files

                Linux permissions

                6.2. Textual representation
                SUID If set, then replaces "x" in the owner permissions to "s", if owner has execute permissions, or to "S" otherwise. Examples:
                -rws------ both owner execute and SUID are set
                -r-S------ SUID is set, but owner execute is not set
                SGID If set, then replaces "x" in the group permissions to "s", if group has execute permissions, or to "S" otherwise. Examples:
                -rwxrws--- both group execute and SGID are set
                -rwxr-S--- SGID is set, but group execute is not set
                This will, I'm sure, allow those with more knowledge concerning SUID and SGID to assist here.
                Windows no longer obstructs my view.
                Using Kubuntu Linux since March 23, 2007.
                "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                Comment


                  #9
                  Re: Can't delete certain files

                  Could it be a permissions problem if I can't even do "sudo chmod 777" in single-user mode?

                  I booted from the live CD but haven't yet figured out how to get hda mounted so I can try deleting the file.

                  Comment


                    #10
                    Re: Can't delete certain files

                    OK, figured out how to mount drive. Still no joy. I think now it IS a permissions problem but caused by corruption. I copied one of the files to ensure I was really looking at the drive and that the filesystem was writable. To wit:

                    Code:
                    >ls -l
                    -rwxr-xr-x 1    336   37609 10497235 1939-10-04 18:52 libc6.postinst
                    --wxr-Sr-- 1 672442890 184549440  49152 2005-04-17 02:26 unzip.md5sums
                    --wxr-Sr-- 1 root   root     49152 2009-11-03 13:51 unzip.md5sumscopy
                    This tells me that what's corrupted is the group and user info. But "sudo chown root" still gets "Operation not permitted". I think I'm stuck with these files until I wipe the drive.

                    Comment


                      #11
                      Re: Can't delete certain files

                      Is the drive using the EXT4 file system? If it is, it could be corruption. I had a similar problem with a file that had a name composed of hex characters, which appeared as various graphical symbols and had a byte length of zero.

                      I booted a LiveCD and used

                      fsck.ext4 -C0 -f /dev/sda1

                      fsck.ext4 -C0 -f /dev/sda5

                      (because I have two partitions, the first with Juanty on it and the second with Karmic)

                      Before I did that when I used Dolphin and right moused on the file and selected "delete" Dolphin said it couldn't find the file. Afterward, it did, and deleted it. HOWEVER, it took all the other files in the directory with it, emptying it out.

                      Moral: backup. How often do you need to back up? That depends on how much you are willing to lose. I back up my KMyMoney bank file every time I use it. I have been using the same file for 5 years and I don't want to lose that data. So, after every session I open the Juanty side and save it there. THen I stick in a USb stick and save it there, too.


                      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                      – John F. Kennedy, February 26, 1962.

                      Comment


                        #12
                        Re: Can't delete certain files

                        The filesystem is ext3 according to fstab.

                        With system running, I did a

                        fsck -n -C0 /dev/hda1

                        The only errors listed were in Pass5 - several free block counts were wrong (some high, some low). Either there wer no other errors, or the check quit at pass 5.

                        This makes me wonder why the fsck I forced by touching /forcefsck didn't clear this up.

                        Comment

                        Working...
                        X