Announcement

Collapse
No announcement yet.

[SOLVED] how to delete a line from sources.list?

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

    [SOLVED] how to delete a line from sources.list?

    i've managed to mess up the adept by inserting a line into sources.list that isn't supposed to be there. i cannot take it out, it seems.
    i have tried with konqueror but there's no "edit as root" option there.
    i have tried via the konsole using "sudo kwrite /etc/apt/sources.list" but it just tells me "sudo: kwrite: command not found".
    how do i erase that line from the file so i can use the package manager again?

    #2
    Re: how to delete a line from sources.list?

    Try sudo kate /etc/apt/sources.list

    Comment


      #3
      Re: how to delete a line from sources.list?

      Dennis99's suggestion should work alright.

      An alternative way (especially if you are to start a gui) is to
      hit alt-f2 and enter:
      Code:
      kdesudo <whatever_gui_you_are_to_start>
      So, in this case:
      Code:
      kdesudo kate /etc/apt/sources.list
      thought it'd be useful for you to know.

      cheers
      gnu/linux is not windoze

      Comment


        #4
        Re: how to delete a line from sources.list?

        ok guys, in both it prompts for password (naturally) and in both it says "command not found". any other thoughts?

        thanks for the GUI, btw. always good to know the ALT+F2 thing.

        Comment


          #5
          Re: how to delete a line from sources.list?

          Apparently when calling an application using kdesudo, the path from current user is not used correctly. See https://bugs.launchpad.net/ubuntu/+s...e4/+bug/191264. If you execute
          Code:
          kdesudo /usr/lib/kde4/bin/kate /etc/apt/sources.list
          your sources.list is opened in kate with the right privileges.

          If you wonder what is the full path to common applications, use
          Code:
          which kate
          (and of course substitute the application you want to find)

          Edit: added bugreport
          Kubuntu 9.10<br />

          Comment


            #6
            Re: how to delete a line from sources.list?

            oops.
            i'm sorry.
            i'm still on 7.10 with kde 3.5.x (will be for another good while).
            kdesudo gives no problems here.

            if even the latest suggestion doesn't work, then this will...

            here's a clean template sources.list file for hardy.
            it enables everything, except medibuntu.
            deb http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
            deb-src http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse

            deb http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse
            deb-src http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse

            deb http://archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
            deb-src http://archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse

            deb http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
            deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse

            deb http://archive.canonical.com/ubuntu hardy partner
            open up a konsole.
            enter the following:
            Code:
            sudo -i
            to gain admin (root) privileges

            then enter this:
            Code:
            cat > /etc/apt/sources.list
            your terminal is now waiting for input.
            copy&paste the sources.list file above.
            then hit ctrl-d to end the input and get back to the prompt.

            you now have a new /etc/apt/sources.list file
            containing what you just copied.

            start adept (i use synaptic).
            localize the repos to your mirrors, if necessary.

            you should be back up and running.

            hth
            gnu/linux is not windoze

            Comment


              #7
              Re: [SOLVED] how to delete a line from sources.list?

              thanks a loads kuby, it worked like a charm.

              jankushka, i didn't have time to check your second suggestion but i apologize for forgetting to post in this post that i'm using hardy with kde4.

              Comment

              Working...
              X