Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Newbie in Ubuntu Made a Dumb Potentially Fatal Mistake

  1. #1
    Join Date
    May 2020
    Beans
    1

    Newbie in Ubuntu Made a Dumb Potentially Fatal Mistake

    So I'm fairly new to Ubuntu and was installing some packages in a server that was given to me for my project.
    But I encountered that some of the pre-existing packages are in conflict with the packages that I'm trying to install.
    Long story short I typed in the terminal sudo apt purge ...
    Which Deleted all the packages in the server.
    My question is, will the real data in this server be any way affected,deleted or modified because of this command?
    Real data like images, texts, saved models and etc. since we're doing machine learning.
    This because this server is used by multiple people and I fear I may have affected their data.

  2. #2
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    11,245
    Distro
    Ubuntu

    Re: Newbie in Ubuntu Made a Dumb Potentially Fatal Mistake

    My question is, will the real data in this server be any way affected,deleted or modified because of this command?
    Unknown, but in general apt never touches anything in the home directory.
    I cannot say that same for anything outside the home directory though.

    Worst case, leave the drive/disk untouched and use a recovery tool like testdisk to try and recover the data before doing anything else.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  3. #3
    Join Date
    Jul 2010
    Location
    ozarks, Arkansas, USA
    Beans
    13,605
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Newbie in Ubuntu Made a Dumb Potentially Fatal Mistake

    kspjohndoe501; Hello - Welcome to the forum

    The command's result depends on where you were located in the file system when the command was executed ( ... directs two levels up).

    What file system is in use ? As there may be tools to help recover.
    For instance ext4 ?
    see:
    Code:
    apt show extundelete

    these things happen
    THE current(cy) in Documentation:
    https://help.ubuntu.com/community/PopularPages

    Happy ubuntu'n !

  4. #4
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    5,234
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Newbie in Ubuntu Made a Dumb Potentially Fatal Mistake

    sudo apt purge [something] removes some software, including configuration. It shouldn't touch any documents. It will run the removal scripts belonging to the packages it removes, which, if well-behaved, will only cleanly remove the software, but if the software is not from the official repos, that can't be guaranteed.

  5. #5
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    20,231
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Newbie in Ubuntu Made a Dumb Potentially Fatal Mistake

    It also removed config files in the /etc/ directory structure which were installed as part of the package.
    Data that was added while running a desktop or some server shouldn't be touched. Anything in $HOME should be 100% fine.

    If you are new, please learn to use the manpages. What any command does should be spelled out there. Obviously, it won't say what it doesn't do. The apt command is/was a wrapper around apt-get, so check both manpages. Sorry, but when working at the level you are working, reading manpages is mandatory.

    Linux does what you ask it to do, not necessarily what you want it to do.
    Last edited by TheFu; May 30th, 2020 at 07:03 PM.

  6. #6
    Join Date
    Oct 2005
    Location
    Al Ain
    Beans
    9,934

    Re: Newbie in Ubuntu Made a Dumb Potentially Fatal Mistake

    Hmm, I can understand how this is 'potentially fatal'. Someone just might want to revenge his data loss with a nerf gun if you are lucky, or a cattle prod if you are not so lucky. Either way, you probably need to go and buy a few boxes of doughnuts.

    As mentioned above, if the important data is in /home, then it should still be there, but if it was anywhere else, then it may now be in lalaland. You should therefore look around for backups.

  7. #7
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Newbie in Ubuntu Made a Dumb Potentially Fatal Mistake

    I looked around briefly for .. reverse sudo apt purge .. and found a few threads which might help you.

    https://askubuntu.com/questions/5227...t-remove-purge

    and as I though .. try the history command to see what actions were run.

  8. #8
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    11,245
    Distro
    Ubuntu

    Re: Newbie in Ubuntu Made a Dumb Potentially Fatal Mistake

    I kind of wonder how far it actually got, since at some point something that was to be removed would have caused the package management system to halt.
    Not to say the system isn't totaled, it most likely is.
    Just kind of have to wonder where it stopped itself.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    20,231
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Newbie in Ubuntu Made a Dumb Potentially Fatal Mistake

    This is where someone needs to ask ... how are your backups? There are over 1000 uses for backups. This is one.

  10. #10
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Newbie in Ubuntu Made a Dumb Potentially Fatal Mistake

    ... since we're doing machine learning
    this is a good learning exercise.

Page 1 of 2 12 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
  •