Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 35

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

  1. #21
    Join Date
    Mar 2008
    Beans
    209

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

    I believe it's sdb that's got my system on it. I should have unplugged the extraneous. I have my Live USB system 20.04LTS running and have prepped a 22.04LTS dvd-r with the current (22.04.3LTS) system for that. The 16 and 18 TB drives will just be unplugged before anything is upgraded. I think sda is where my ancient and never used Dell OS still resides.

    Does anyone know if I'm able to make a Live USB from the Live CD these days? I seem to recall having a heck of a time getting it to work when I did 20.04 initially. May have even made the bootable USB in Windows first. Can't recall.

    In any case, my plan this evening is to reboot the system into 22.04LTS live, and then try a manual update as suggested by @guiverc. If the above output helps anyone see things I might need to know beforehand, thank you as always for the help!

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

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

    In that case, from a Live Session, do whatever you have to do to get networking working... Meaning if it uses a WiFi network, connect to your home WiFi. Open Firefox to get back to this past, then open a terminal session where you can cut-and-paste the commands into.

    You do not have LVM, LUKS or anything else special, so is fairly straight forward...
    Code:
    sudo su -
    mount /dev/sdb1 /mnt
    ls /mnt
    You should see the OS root folder structure there. If not, find which partition is the OS root, and mount it instead... If it is so, then
    Code:
    mount --make-private --rbind /dev  /mnt/dev
    mount --make-private --rbind /proc /mnt/proc
    mount --make-private --rbind /sys  /mnt/sys
    mount --make-private --rbind /run  /mnt/run
    cd /mnt
    chroot /mnt /usr/bin/env bash --login
    mount -a
    apt update
    apt install --reinstall -y python3
    exit
    umount /mnt
    reboot
    Test.

    Do a good backup, then upgrade the release to something supported.

    Good luck and enjoy.
    Last edited by MAFoElffen; December 21st, 2023 at 09:03 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. #23
    Join Date
    Mar 2008
    Beans
    209

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

    So, I've successfully mounted sdb1 to /mnt, but I'm not seeing what I expect from a Linux / directory, the /var, /home, /sbin, and so on directories. All I'm seeing are three directories, one of them my home directory. Call them "dirA," "dirB," and "MyHome."

    Would mounting /mnt onto sdb (without the 1) be what you mean by finding the root?

    AH, hold on, I think I see it: Maybe it's sda7? I see a 719.2GB ext4 partition on sda...Going to try that. I may have kept the /home drive on a separate partition for this exact reason, in case things got corrupted.

    Checking that...

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

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

    No... Not directly to a drive only.

    Explanation. When you mount something, it's not to a disk (that is a Windows kind of misconception). You actually mount to the filesystem 'within' a container. So withi a partition, LVM LV or ZFS dataset...

    To unmount that, please do (still as root)
    Code:
    umount /mnt
    We know most of /dev/sda is Windows (except for /dev/sda7), and /dev/sdg is your Lubuntu LiveUSB...

    So your other choices would be /dev/sda7, /dev/sde1, and /dev/sdf1... do the same to mount them, one by one, check them to ensure your are on the correct filesystem.

    "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. #25
    Join Date
    Mar 2008
    Beans
    209

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

    Well, thank you all for the help thus far, I've tried a few things...successfully chrooted into the old system as per the instructions, but got a "cannot unmout" error and when I finally exited (just turned things off, hoping the --restore worked...nope, same thing was happening.)

    I then decided to install 22.04.3LTS in place of the old 20.04LTS partition. That had some quirks (installer failed once, tried again, got partway through, failed...not sure why).

    But third time's a charm and I'm writing from a freshly installed 22.04.3LTS NON live system. It's in there. Yay.

    But I am now running into a problem in that I can't seem to get my /etc/fstab line to point properly to the old home directory. Copying syntax from another recent post I tried using the UUID, but that mounts the drive one step higher in the path than I want...is there a way to use the /etc/fstab line to point further down the directory tree?

    For example, I have:

    Code:
    UUID=888xxx444bbblahblahblah  /home/myhome ext4 defaults 0 2
    And what I WANT is:

    Code:
    UUID=888xxx444bbblahblahblah/myhome  /home/myhome ext4 defaults 0 2
    I'm loathe to just guess if this is doable. Should I be using the non-UUID descriptor? /dev/sdb1/myhome?

    Thank you. I'm nearly there!!

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

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

    So your home is a Folder that resides within a partition?

    What you do for something like that is to mount the the folder "somewhere" where it doesn't matter, such as to a Folder called /exports... Then replace /home/myhome with a symlink.

    Not pretty, but it works.

    What would be better for the future, is to just move that user home folder to it's ow partition, where you can just mount the filesystem of it like normal... That would straighten that out, for growth and portability down the road. It looks like you have plenty of storage there to do that.
    Last edited by MAFoElffen; December 23rd, 2023 at 02:45 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

  7. #27
    Join Date
    Mar 2008
    Beans
    209

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

    Thank you for the info, as always. How would I "move the user home folder to its own partition," seeing as this is probably as good a time as any to do that? Is it something I'd do with gparted? And would I maybe rsync the current /dev/sdb1/myhome to another location, then wipe and repartition that whole /dev/sdb, and then restore the folder back into the new partition, sans any folders above it?

    Thank you. I know we're now into a sort of different topic than the original post, but I appreciate the walkthrough just the same!

  8. #28
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

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

    Wait... Let me rephrase that... I think I was confused. Doing several things at once.

    Are you talking about /dev/sb1? if the root of /dev/sda1 has your /myfolder in it then do this

    Make sure in your new install you do this
    Code:
    sudo su -
    mv /home /home-old
    mkdir /home
    echo "/dev/disk/by-uuid/$(blkid -s UUID -o value /dev/sdb1) /home ext4 defaults 0 0" >> /etc/fstab
    mount /home
    That will mount that partition as home, and the folder within it will showup in the correct place within it.

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

  9. #29
    Join Date
    Mar 2008
    Beans
    209

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

    No, the 22.04LTS install is in /dev/sda7 (sda)

    But the home directory is in /dev/sdb1 (sdb)

    But the home directory isn't in the root of /dev/sdb1, it's in a subdirectory (folder?). I'm not sure this is the right syntax, but it's /dev/sdb1/myhome

    There's also a /dev/sdb1/downloads and a /dev/sdb1/oldstuff location.

    So instead of mounting /dev/sdb1 as my /home, I need to mount /dev/sdb1/myhome.

    Does that make any sense? I know it's confusing...even for me and I'm the one looking at the computer.

    (But it's there earlier in this thread, in the output I posted. You can see /sda7 and /sdb1 are separate.

  10. #30
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

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

    Yes... I understood which that it was in /dev/sb1. And yes, It makes sense... There are other folders there in that partition

    So the there there if you mounted that partition to a folder called /exports would look like
    Code:
    /exports
     |_ MyFolder
     |_ Downloads
     |_ Oldstuff
    That changes the above directions back to
    Code:
    sudo su -
    mv /home/MyHome /home/MyHome-old
    mkdir /export
    echo "/dev/disk/by-uuid/$(blkid -s UUID -o value /dev/sdb1) /exports ext4 defaults,uid=1000,gid=1000,fmask=0002,dmask=0002,rw  0 0" >> /etc/fstab
    mount /exports
    chown -R /export MyUser
    ln -s /exports /home/MyUser
    Like I started to explain above, but then... Back to that.

    Understand that now?
    Last edited by MAFoElffen; December 23rd, 2023 at 06:14 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

Page 3 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
  •