Announcement

Collapse
No announcement yet.

Install a package on another os partition

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Install a package on another os partition

    Hi Folks:
    here is my question:
    I have kubuntu 18.04 on my laptop. I need to install "xserver-xorg-input-evdev". This is because my keyboard is not working due to an inadvertent mistake on my part. I have ubuntu 18.04 installed on a separate partition as well. From here I can mount and get inside the Kubuntu partition with no problem.
    Now I am wondering while in this partition could I issue "sudo apt install xserver-xorg-input-evdev"?
    Would this work OK?
    BTW, please note that I can not log-in into Kubuntu or use terminal screen at login due to lack of keyboard.
    Thanks!

    #2
    You should be able to chroot into your kubuntu installation and install the package(s) you need, something like this:

    1. switch to root shell:
    $ sudo -i

    2. mount your kubuntu root directory (I'm mounting it to /mnt...replace sdXX with the correct partition):
    # mount /dev/sdXX /mnt

    3. If you have a separate boot partition (that your kubuntu installation uses), mount that too.
    # mount /dev/sdXX /mnt/boot

    4. Mount special system directories
    # mount -t proc none /mnt/proc
    # mount -o bind /dev /mnt/dev
    # mount -o bind /sys /mnt/sys

    5. chroot into the /mnt
    # chroot /mnt

    Now you should be able to "apt install" packages you need in your kubuntu installation
    Once you're done, you can leave the chroot with 'exit' (or Ctrl+d), then umount the mounts (or just reboot).

    Comment


      #3
      Thanks for your guidance!!
      You mean I should do these while I am in ubuntu and from here into the kubuntu partition? Is my understanding correct? Or do you mean I switched to terminal at kubuntu's log-in screen, which I cannot do due to keyboard not functioning.

      Originally posted by kubicle View Post
      You should be able to chroot into your kubuntu installation and install the package(s) you need, something like this:

      1. switch to root shell:
      $ sudo -i
      When i do the above, I am using the password for ubuntu. Would this be OK?
      thanks!

      Comment


        #4
        Originally posted by marco07 View Post
        You mean I should do these while I am in ubuntu and from here into the kubuntu partition? Is my understanding correct?
        Yes, the steps are performed from your ubuntu installation (with the working keyboard), the preliminary steps prepare a temporary chroot environment for your kubuntu installation under /mnt, and step 5 will switch you into that.
        Do note it has been a while since I've had to do this myself, and am writing the steps from memory (so if you get any errors, report back and hopefully we can get them sorted).

        Originally posted by marco07 View Post
        When i do the above, I am using the password for ubuntu. Would this be OK?!
        Yes

        Comment


          #5
          Well, all went well, except installation of needed package. Although the wireless is on and I have access to the internet from Ubuntu, for one or other reasons there seems to be no access to internet from chroot. I get failure to reach the repositories message. this is the very same message produced when on my other computer trying to "apt install ..." while the internet connection is off.
          It seems this leaves me with no choice but a re-installation of system. Fortunately though, I can save my documents through access from Ubuntu. But I still will wait a couple of days to see what will happen.
          Thanks again for your help!

          Comment


            #6
            Originally posted by marco07 View Post
            for one or other reasons there seems to be no access to internet from chroot.
            Does ping work in your chroot, for example "ping 1.1.1.1"?

            If it does, this could be a simple DNS problem, and you could try to set a nameserver in /etc/resolv.conf on your kubuntu chroot environment (that is /mnt/etc/resolv.conf in your ubuntu installation), for example add "nameserver 1.1.1.1" for cloudfare DNS or "nameserver 8.8.8.8" for Google DNS. Like I said, it's been a while since I've needed a full chroot, and now that Name reolution is handled dynamically, there might not be functioning name resolution available in your kubuntu chroot environment without manually configuring it.
            Last edited by kubicle; Sep 04, 2018, 02:39 PM.

            Comment


              #7
              Well, to make the story short, my efforts in doing above did not end up to a positive outcome. Then I thought instead of wasting additional time and efforts, I'd better reinstall Kubuntu. Of course I had already copied all my important docs into the Ubuntu system partition and fortunately nothing was lost. Now I am back into a fresh and clean install of kubuntu 18.4.1 and things are back to normal.
              Thank you very much kubicle!!
              Last edited by marco07; Sep 05, 2018, 12:01 PM.

              Comment


                #8
                What to avoid having to back up your data and do fresh installs every time you mess up your system experimenting or making a mistake?

                Install Btrfs as the root file system and take snapshots of @ (/) and @home (/home) before you attempt anything fancy or life changing. If a disaster happens you can roll back to what you had before within a few minutes. You don't have to waste hours or days trouble shooting or experimenting or searching the Internet. See the BTRFS subforum under the Miscellaneous forum.
                "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                – John F. Kennedy, February 26, 1962.

                Comment

                Working...
                X