Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 35

Thread: Removed python, how do I put it back?

  1. #11
    Join Date
    Mar 2008
    Beans
    209

    Re: Removed python, how do I put it back?

    Thank you all so much for the suggestions and info. Yes, I do know that 20.04LTS is EOL, which is why I'm leaning heavily on just installing 22.04LTS, but those always come with a whole agony of different tweakings to settings, figuring out which new programs replace the ones that now no longer run, and so on.

    Another question, though, since I'm trying to see whether I purged or just "removed" my pythons...and realized I have access to my user home directory but not the .bash_history file that's for sudo. Is there a way to find that? I thought I'd just cd into the root directory but it looks like I've been mounted into my user home only, without any root. Is the .bash_history for "sudo apt-get remove python2" hiding somewhere that I don't realize?

    Also, is there a good step-by-step out there for using chroot to accomplish this? I've seen a number of things that seem to be using chroot to do the opposite: sandbox commands within a virtual environment so they're not affecting the system.

    Lastly, will anything that was removed in the python mess be retained if I rsync my /home directory and rsync it back after I upgrade to 22.04LTS? Like, I'm thinking things like VirtualBox, which I remember seeing vanish in the purge, among other things. Am I going to be stuck with an unusable system AFTER upgrading if I use an archive of the existing drive? (I'm asking because in a stroke of sheer luck, I have a backup that was made just a few days beforehand, so it would be pre-purge/remove, and I could use that...I may have a few files that get lost but nothing vital.)

    Thank you again for all the help!

  2. #12
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Removed python, how do I put it back?

    It's name is ".bash_history" and is located at the root of your User Home Folder...
    Code:
    mafoelffen@Mikes-ThinkPad-T520:~$ ls -l $HOME/.bash_history
    -rw------- 1 mafoelffen mafoelffen 68876 Dec 20 10:44 /home/mafoelffen/.bash_history
    Still waiting for information from you, such as the URL of your system-info report, so I can talk you through chrooting into this to fix this, or any feedback on whether you tried anything yet...

    This can be fixed.
    Last edited by MAFoElffen; December 20th, 2023 at 11:45 PM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  3. #13
    Join Date
    Mar 2008
    Beans
    209

    Re: Removed python, how do I put it back?

    Hi again, yes, I can get the /home/user/.bash_history, but I can't see the /home/root/.bash_history if there is one. Or is the "sudo" .bash_history file identical? If so, when I do "cat .bash_history | grep python" nothing shows up. I feel like it's because I need to be in the root, not the user directory.

    And sorry to miss the request for that URL, I'll try to get that for you. THANK YOU!

  4. #14
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Removed python, how do I put it back?

    There is nothing such as /home/root. Root's user folder is /root, and there is for that at "/root/.bash_history".

    What "exactly" do you "think you need"?

    This could have been fix yesterday... Been bouncing between things, trying to get something else taken care of. Sorry, I guess I don't understand the holdup.

    If you are searching for what you removed, that's the wrong place to look to see what else might have been removed... That would be in /var/log/apt/history.log

    EDIT: Tell you want... Please post the results of this, posted within CODE Tags
    Code:
    lsblk -e7 -o name,label,size,fstype,type,mountpoint,model
    Last edited by MAFoElffen; December 21st, 2023 at 02:47 AM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  5. #15
    Join Date
    Jul 2007
    Location
    Tāmaki Makau-rau, NZ
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Removed python, how do I put it back?

    Should "lable" be "label" in the code line?
    BACKUPS are unsexy — until you discover you should have done one yesterday.
    Spare your nerves and do one before you upgrade or install.

  6. #16
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Removed python, how do I put it back?

    @irihapeti -- Yes, corrected, thank you for the other set of eyes!

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  7. #17
    Join Date
    Aug 2017
    Location
    melbourne, au
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Removed python, how do I put it back?

    Quote Originally Posted by goemonburo View Post
    Thank you all so much for the suggestions and info. Yes, I do know that 20.04LTS is EOL, which is why I'm leaning heavily on just installing 22.04LTS, but those always come with a whole agony of different tweakings to settings, figuring out which new programs replace the ones that now no longer run, and so on.
    You can non-destructively re-install a Ubuntu system, which is actually even easier with the *flavors* like Lubuntu.

    Lubuntu actually QA-test for it; with the Understanding our Testing Checklist document here , with this install case allowing you to re-install a different release, which can achieve an release-upgrade in a fraction of the time of `do-release-upgrade` etc.


    I last did it last night, so maybe 15 hours ago now, where I re-installed the Lubuntu 22.04.4 daily ISO as a QA test on an existing system of mine, which accomplished two things, it upgraded my packages (I don't upgrade that box normally, but re-install it regularly using dailies to achieve the same thing) plus did the QA test of that unreleased ISO. In the testcase checklist that install is "Install using existing partition" where I re-install using the same partition without format, and my prior used apps get auto-reinstalled as part of that upgrade, eg. after install & reboot, and I've logged in, I start my `clementine` music app & have it continue playing my playlist, as I perform the checks of that system. As `clementine` is not included by default on a Lubuntu install I confirm that app got re-installed, the fact that my music plays confirms my files still exist etc.. I don't expect to really notice any difference from my prior setup due to this install, except the system won't report a week+ of upgrades are waiting to be installed (which it did prior to re-install).. I thus have to jump to terminal, check file-system meta data to confirm the re-install did occur, that `/var/log/installer/media-info` contains the ISO date I actually just QA-tested.. given in using the system via GUI I can't detect it was re-installed.

    Of note: My QA re-installs do not include 3rd party applications generally; as we QA only with Ubuntu repository software, and whilst it will work with some 3rd party, it may not work with all. Regardless I use this on occasion to fix my own messes; in fact used it long ago to fix a uninstall of default python myself (we all learn sometime; repeating the mistakes is what we shouldn't do).

    As for changing release, the box I performed the test on also contains lunar (23.04) & mantic (23.10) installs; the lunar will switch to be a noble or 24.04 install box rather soon, where I'll use this non-destructive re-install to have it switch releases.

  8. #18
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Removed python, how do I put it back?

    it seemed like a good idea at the time. Only it wasn't.)
    We've all been there! Sorry, I have nothing useful to add, but that I've done some bonehead things too, but never removed the system python. I did specifically wipe a partition table and the backup, however. I had a boot-sector virus and figured doing that was the easy solution. Bonehead enough? BTW, it did handle the virus nicely ...

  9. #19
    Join Date
    Mar 2008
    Beans
    209

    Re: Removed python, how do I put it back?

    Haha, @TheFu, thanks for the moral support. I'm grateful to everyone for chipping in and helping...and yes, it could have been fixed, only I have a deadline for work I have to get done and once that's complete, I'll put in the hour or two needed to restore the system. In the meantime, I'd love to know @guiverc about the non-destructive reinstall. That sounds like perhaps the best option. If 22.04LTS can be non-destructively installed over 20.04LTS, then that's what I'll do. I don't have it in a Live USB, unfortunately, so I'll have to make that first. But will it be an option I can choose out of the Live USB installer? Or do I have to prep or have separated my /home dir or something?

    I will post the output, @MAFoElffen, in just a bit. Thank you (all) for your suggestions and time!

  10. #20
    Join Date
    Mar 2008
    Beans
    209

    Re: Removed python, how do I put it back?

    Here is the output:

    Code:
    lsblk -e7 -o name,label,size,fstype,type,mountpoint,model
    NAME   LABEL                       SIZE FSTYPE TYPE MOUNTPOINT         MODEL
    sda                              931.5G        disk                    TOSHIB
    ├─sda1 ESP                         650M vfat   part                    
    ├─sda2                             128M        part                    
    ├─sda3 OS                        195.3G ntfs   part /media/lubuntu/OS  
    ├─sda4 WINRETOOLS                  990M ntfs   part                    
    ├─sda5 Image                      13.9G ntfs   part                    
    ├─sda6 DELLSUPPORT                 1.4G ntfs   part                    
    └─sda7                           719.2G ext4   part /media/lubuntu/0ff 
    sdb                                3.7T        disk                    WDC_WD
    └─sdb1                             3.7T ext4   part /media/lubuntu/889 
    sde                               14.6T        disk                    M001G-
    └─sde1 16TB                       14.6T ext4   part /media/lubuntu/16T 
    sdf                               16.4T        disk                    M000J-
    └─sdf1 18TB                       16.4T ext4   part /media/lubuntu/18T 
    sdg    Lubuntu 20.04.3 LTS amd64   3.8G iso966 disk                    USB_Fl
    ├─sdg1 Lubuntu 20.04.3 LTS amd64   1.7G iso966 part /media/lubuntu/Lub 
    ├─sdg2                             3.9M vfat   part                    
    └─sdg3 writable                      2G ext4   part /media/lubuntu/wri 
    sdh                                1.9G        disk                    U3_Tit
    └─sdh1 2GB_SANDISK                 1.9G vfat   part /media/lubuntu/2GB 
    sr0    Lubuntu 22.04.3 LTS amd64   2.7G iso966 rom  /media/lubuntu/Lub HL-DT-
    zram0                              2.4G        disk [SWAP]             
    zram1                              2.4G        disk [SWAP]             
    zram2                              2.4G        disk [SWAP]             
    zram3                              2.4G        disk [SWAP]             
    zram4                              2.4G        disk [SWAP]             
    zram5                              2.4G        disk [SWAP]             
    zram6                              2.4G        disk [SWAP]             
    zram7                              2.4G        disk [SWAP]

Page 2 of 4 FirstFirst 1234 LastLast

Tags for this Thread

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
  •