Find the answer to your Linux question:
Results 1 to 7 of 7
I want to edit my yum.conf file. Ummmm...how do I do it using a text editor when it's marked as read-only and I don't have the rights to alter permissions? ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2005
    Posts
    44

    Editing a read-only file using a text editor


    I want to edit my yum.conf file. Ummmm...how do I do it using a text editor when it's marked as read-only and I don't have the rights to alter permissions?

    It's not obvious to me atm!

    TIA

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    It's pretty easy to simply su, password, then fire up vim to edit those files.

  3. #3
    Linux Newbie
    Join Date
    Jul 2005
    Location
    classified
    Posts
    246
    Use the command line to become root, and then launch the editor from the command line. gedit will work, just enter "gedit yum.conf". But you ought to learn how to use vi or emacs or some other command-line editor. In vi, the command to exit and write is :wq or :wq!

  4. #4
    Just Joined!
    Join Date
    Jun 2005
    Posts
    44
    Can't I just do it with a gui-based editor and copy & paste the text in? Would be easier for a numpty like me for sure!

  5. #5
    Linux Guru bryansmith's Avatar
    Join Date
    Nov 2004
    Location
    /Ontario/Canada
    Posts
    2,619
    Type the following into a terminal (system tools menu):
    Code:
    su:
    <Enter your root password &#40;you made one during installation&#41;>
    gedit /etc/yum.conf
    Looking for a distro? Look here.
    "There can be no doubt that all our knowledge begins with experience." - Immanuel Kant (Critique of Pure Reason)
    Queen's University - Arts and Science 2008 (Sociology)
    Registered Linux User #386147.

  6. #6
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    As long as you have read access on the file, you can always just save it under a different name, then move it.
    For the su thing to work, you'll need to be
    Code:
    su -
    not just
    Code:
    su

  7. #7
    Just Joined!
    Join Date
    Aug 2006
    Location
    Mountain West
    Posts
    3

    edit read only files

    Wahoo!
    gedit as root worked for me.

Posting Permissions

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