[Tutor] ImportError: No module named '_sysconfigdata_m'
Oscar Benjamin
oscar.j.benjamin at gmail.com
Wed Sep 25 11:58:27 CEST 2013
On 25 September 2013 00:25, Steven D'Aprano <steve at pearwood.info> wrote:
> On Tue, Sep 24, 2013 at 01:33:23PM +0100, Oscar Benjamin wrote:
>
>> If you want to mess with your system 'sudo rm -rf' is definitely the
>> way to go. Don't bother reporting this as a bug since you've
>> *definitely* voided the warranty (that your free software didn't come
>> with).
>
> I first read that as "sudo rm -rf ." and thought "That's a bit harsh,
> isn't it?"
I guess it does seem harsh but it's definitely true. Albert-Jan still
hasn't explained what he was trying to achieve with that command but I
stand by my claim that whatever it was can be achieved in a better and
safer way.
If you try 'sudo apt-get remove python3' then apt will check the
database of installed packages to see if anything depends on the
python3 package. If nothing depends on it then it will be safely
removed and the apt database will be updated to reflect the fact that
it is no longer installed. Otherwise it will report the full list of
packages that would also need to be removed because they depend on
python3 and ask if you want to remove all of them. At this point
you'll probably think "What on earth are all those packages? Maybe I
need them." and then answer no.
On the other hand 'sudo rm -rf /some/system/dir' will check nothing
and will simply remove the files. The combination of sudo and the -f
flag means "I know what I'm doing so shut up and do what I say". I
rarely feel confident enough to do that and I can't think of the last
time I had a reason to do it.
I regularly use 'rm -rf' because that's needed to delete e.g. a git
repository which contains a whole load of files marked as read-only.
Without the -f you'll have to answer 'y' thousands of times. But I
don't usually have git repositories that are owned by root so I don't
need the sudo part (I have sometimes used git to manage system files
like fstab, grub etc.).
Oscar
More information about the Tutor
mailing list