Page 1 of 4 123 ... LastLast
Results 1 to 10 of 37

Thread: Permissions for sources list files

  1. #1
    Join Date
    May 2012
    Location
    Morden, Surrey
    Beans
    227
    Distro
    Ubuntu 12.04 Precise Pangolin

    Permissions for sources list files

    HI,

    I used this guide:

    http://askubuntu.com/questions/24338...tall-a-new-one

    ...for a quick reinstall so I didn't have to manually get all my software again one by one. However, I just dragged the sources.list and sources.list.d folder onto an external drive (via opening nautlius as standard, not via 'gksudo nautilus') and hoped I could just drag them back to the right place on once ubuntu was reinstalled. Wrong!

    My permissions on these files are now all screwed so the steps from 6 onwards on the link above fail miserably. I have two questions then:

    1) What are the correct permissions for the sources.list file and sources.list.d folder (and contained files)?
    2) Can I run deja-dup as root in the first place to just make a backup of /home/ and /etc/apt/ so a reinstall would be a bit less painful.

    I will look into clonezilla as that seems like a decent option but any help with the above would be most appreciated, thanks.

    Sam.

  2. #2
    Join Date
    Mar 2010
    Location
    Metro ATL
    Beans
    Hidden!
    Distro
    Lubuntu 12.04 Precise Pangolin

    Re: Permissions for sources list files

    Backups as root are a must. Without root, the permissions will be screwed.
    Restoration as root is also a must. Without root, the permissions will be screwed.

    Running any* GUI tool as root is dangerous. Don't do it. ....[*] for certain values of "any"; gui tools often leave files behind with settings. Often, those settings will be stored under your userid, not /root/, so accessing them later as your normal ID will fail.

    /etc is tiny and there are lots of things you want in there, not just /etc/apt/ Grab the entire thing in your backup process.

    Oh and the permissions in /etc are root.root and 644. Which explains why you could copy, but not put them back under your normal userid.

    Clonezilla rocks for many purposes, but it just isn't needed for Linux backups. It is extremely wasteful when you just need to install a basic system, put the settings back from /etc/, your data back where it goes (often /home ; occasionally /var) and tell the box to install all the old packages via dpkg --set-selections. My profile has links to how I do this with scripts that I use.

    I use apt-cache-ng to prevent multiple downloads of the same package over the internet. It also means that reinstallations are much, much faster as almost every needed package is local already. That tool has a few issues, but seems to work well enough.
    Last edited by TheFu; January 19th, 2014 at 06:44 PM.

  3. #3
    Join Date
    Jul 2005
    Location
    England
    Beans
    Hidden!

    Re: Permissions for sources list files

    If what you want is the packages you have previously installed to your system so that you can install them again to the new one, this is one situation where it is probably quicker and easier to use the terminal to copy what you want from your filesystem to a usb disk with command
    Code:
    cp /var/cache/apt/archives/*.deb /media/path/to/usb
    , and then copy them back to the filesystem of your new installation with
    Code:
    sudo cp /media/path/to/usb/*.deb /var/cache/apt/archives/
    This is something I have done a lot and continue to do when necessary as it can save a lot of time downloading masses of packages that you have already in /var/cache.
    DISTRO: Xubuntu 12.04-64bit --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  4. #4
    Join Date
    May 2012
    Location
    Morden, Surrey
    Beans
    227
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Permissions for sources list files

    Quote Originally Posted by TheFu View Post
    Backups as root are a must.
    Restoration as root is also a must.

    /etc is tiny and there are lots of things you want in there, not just /etc/apt/ Grab the entire thing in your backup process.

    Oh and the permissions are root.root and 644. Which explains why you could copy, but not put them back under your normal userid.
    Thanks, that's helpful.

    Quote Originally Posted by ajgreeny View Post
    If what you want is the packages you have previously installed to your system so that you can install them again to the new one, this is one situation where it is probably quicker and easier to use the terminal to copy what you want from your filesystem to a usb disk with command
    Code:
    cp /var/cache/apt/archives/*.deb /media/path/to/usb
    , and then copy them back to the filesystem of your new installation with
    Code:
    sudo cp /media/path/to/usb/*.deb /var/cache/apt/archives/
    This is something I have done a lot and continue to do when necessary as it can save a lot of time downloading masses of packages that you have already in /var/cache.
    Thanks for the info.

    What about the /etc/ folder in this situation? How do you reinstall all the packages after the archives have been copied to the new install?

  5. #5
    Join Date
    Jul 2005
    Location
    England
    Beans
    Hidden!

    Re: Permissions for sources list files

    After copying all the archived *.deb files back to your new filesystem you simply install them in the usual way, using software-centre or better, I think, synaptic, or terminal with sudo apt-get install packagename. If you used the set-selections system etc etc that is shown in your link you can also do that to reinstall the packages. All my copying suggestion will do is allow you to avoid downloading all those packages again.

    Synaptic is always the first application I add to any *ubuntu system nowadays if it's not in by default as it is so much better, in my opinion, than software-centre.
    DISTRO: Xubuntu 12.04-64bit --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  6. #6
    Join Date
    May 2012
    Location
    Morden, Surrey
    Beans
    227
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Permissions for sources list files

    Ok, thanks. I am still working on a way to get a decent backup solution. I admit I don't use automatic stuff, I just manually backup every week or so, nothing much changes on my system once it's set up. OSX time machine was perfect for me but the whole lockdown on mac stuff really puts me off.

  7. #7
    Join Date
    Mar 2010
    Location
    Metro ATL
    Beans
    Hidden!
    Distro
    Lubuntu 12.04 Precise Pangolin

    Re: Permissions for sources list files

    Quote Originally Posted by ajgreeny View Post
    Synaptic is always the first application I add to any *ubuntu system nowadays if it's not in by default as it is so much better, in my opinion, than software-centre.
    +1 - for desktops. I find software-center to be toooooo dumbed down to be touched. My systems are mostly servers, so GUI tools don't fit very often.

  8. #8
    Join Date
    Mar 2010
    Location
    Metro ATL
    Beans
    Hidden!
    Distro
    Lubuntu 12.04 Precise Pangolin

    Re: Permissions for sources list files

    Quote Originally Posted by samwillc View Post
    Ok, thanks. I am still working on a way to get a decent backup solution. I admit I don't use automatic stuff, I just manually backup every week or so, nothing much changes on my system once it's set up. OSX time machine was perfect for me but the whole lockdown on mac stuff really puts me off.
    If you like "time machine" - check out "back-in-time" - .... this is suitable for individual user backups. Not so much for system stuff. For the system stuff, rbackup, duplicity, and rdiff-backup (all using librsync) are great choices.

    We all start out doing backups manually. I would use ZIP files, then just a weekly rsync mirror to another partition in a different system. Did that manually every week for about 6 months ... nothing bad happened, so I got lazy. It happened monthly, then quarterly then .. some system changes prevented backups and I didn't have enough room to backup everything.
    Then it happened.
    A HDD failed. It was being merged with 2 other partitions on different HDDs using LVM into a single file system. I lost all the data on all three of those disks. That lead to ....
    I got backup religion.
    Never looked back. I am not afraid of a hardware failure anymore. I am not afraid of accidentally deleting a file or having a program corrupt a file. My backups are THAT good. I might loose 23 hrs of data that changed - worst case. Doing backups the correct way is actually easier and automatic. I check that backups finished on every box daily, but that's it. I get an email with any failures from each backup task. The backup storage is managed automatically. It is extremely efficient in time and storage. Most backups take 1-3 minutes and just 5MB of storage. I know each backup set can be used to restore a system in about 30 minutes - had to do this a few times over the years. Most of my systems have 60 days of backups, a few have 90 days. That means any backup during that time for any file can be restored. 1 file or a million. Doesn't matter. I can restore.

    If a box gets a virus and we don't notice for a week or two, I can drop back and see exactly what changed. Backups are NOT just for HW failures, they are a critical security tool as well.

    Also, I sleep very well too.

    While I'm here, rsync is a great tool and makes a mirror copy when that is needed. Let there be NO mistake, a mirror is NOT a backup. It fails on some of the most important parts of a good backup. There are more complex ways to get rsync to make a good backup tool, but most people are happy to use a derivative tool, based on rsync or librsync, to perform their backups. Anyone using rsync for backups probably really wants to use rsnapshot or rbackup or back-in-time instead. Each of these will create timestamped backups that can be restored after a virus hits and more than 1 backup has happened since the attack. If you only have a mirror, then the modified file will likely be pushed to the backup storage BEFORE realizing that a virus has been successful. Please learn from this.

    Still, only you can decide what you need to protect your system(s). What works for others is NOT necessarily the best answer for you. Starting with a simple backup script is 10% of the effort. Backups aren't really the point. Don't loose sight of the real goal - restore.
    Last edited by TheFu; January 23rd, 2014 at 11:49 PM. Reason: missing letters/fixed meaning

  9. #9
    Join Date
    Jul 2005
    Location
    England
    Beans
    Hidden!

    Re: Permissions for sources list files

    I find rsync or grsync ideal for backups to an external hard disk. It does all my /home very regularly, but I don't bother with anything else very often, except for the contents of /var/cache/apt/archives which are copied occasionally to a folder in my /home and therefore backed up with the rest of my /home.
    DISTRO: Xubuntu 12.04-64bit --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  10. #10
    Join Date
    May 2012
    Location
    Morden, Surrey
    Beans
    227
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Permissions for sources list files

    Thanks everyone, gives me somewhere to start.

Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

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