How to change ubuntu install from legacy to uefi

You can re-install Ubuntu, as Pilot6 suggests, and this may be acceptable if you haven't done much customization or created many user files in Ubuntu; however, it's pretty easy to install an EFI-mode boot loader for Linux. The two easiest methods are:

Method 1:

  1. Disable the Compatibility Support Module (CSM; aka "legacy mode" or "BIOS mode" support) in your firmware.
  2. Boot the Ubuntu installer in its "try before installing" mode.
  3. Double-check that you've booted in EFI mode by looking for a directory called /sys/firmware/efi. If it's present, you've booted in EFI mode and can continue; but if it's absent, you've booted in BIOS mode and should review your firmware settings and how you created the boot medium.
  4. Download and run the Boot Repair program, as described here.
  5. Tell Boot Repair to repair your installation.
  6. Reboot. With any luck, GRUB will appear and give you the option of booting either Windows or Ubuntu. In some rare cases, the system may boot straight to Ubuntu in EFI mode and you'll need to tweak GRUB to get Windows to appear in the GRUB menu.

Method 2:

  1. Disable the Compatibility Support Module (CSM; aka "legacy mode" or "BIOS mode" support) in your firmware. You may also need to disable Secure Boot, as described on this page of mine, at least temporarily.
  2. Download the USB flash drive or CD-R version of my rEFInd boot manager. (Download links for both are on that page.)
  3. Prepare the rEFInd boot medium.
  4. Reboot into the rEFInd boot medium.
  5. Boot to Ubuntu.
  6. In Ubuntu, install an EFI-mode boot loader. Two options are easiest:
    • You can run Boot Repair, as in steps #4 and #5 of Method 1
    • You can install the Debian package or PPA of rEFInd.
  7. Reboot. GRUB or rEFInd, whichever you specified, should come up and enable you to boot either Windows or Ubuntu.
  8. If desired, you can re-enable Secure Boot; however, if you installed rEFInd, you may need to manually configure Shim and install a MOK key, as described in the rEFInd Secure Boot documentation.

EDIT:

I thought you were dual-booting with Windows, but when I re-read your question, I didn't see this explicitly stated. If you're dual-booting with Windows, the above procedures should both work as-is. If you do not have a dual-boot with Windows, though, your computer may lack an EFI System Partition (ESP) and it may even use the Master Boot Record (MBR) partitioning system rather than the GUID Partition Table (GPT). If so, I recommend that you convert from MBR to GPT (if necessary), as described here. You will also need to create an ESP, which you can do with GParted using an emergency disk. You'll need to shrink an existing partition by about 550 MiB, create a new FAT32 partition in the freed space, and mark it ask an ESP by giving it a "boot" or "esp" flag (in GParted) or assigning it a type code of EF00 (in gdisk). Note that the MBR-to-GPT conversion will destroy the current BIOS-mode boot loader, so if something goes wrong and you have problems getting EFI-mode booting working, it will be harder to return to BIOS-mode booting.


It is much easier to do another clean install in UEFI mode, especially if you do not have enough skill in Linux systems.

But if you have some skill, it is not very difficult to switch to UEFI without re-install.

You will need to create a EFI partition and re-install grub using that partition. You can do it manually or using Boot Repair program.

In case you don't know how to manage partitions or re-install grub, I suggest re-install.