I am facing issues in upgrading ubuntu from 16.04 LTS to 18.04 LTS. I followed all online sources but could not pass through the initial stages
Got the following error when I tried from the terminal
$ /usr/lib/ubuntu-release-upgrader/check-new-release-gtk
/usr/lib/ubuntu-release-upgrader/check-new-release-gtk:30: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version(‘Gtk’, ‘3.0’) before import to ensure that the right version gets loaded.
from gi.repository import Gtktried all possible help online
It stops in the highlighted step, as shown in imageimage
Can any one help?
Closed: Reinstalled 16.04 and upgraded
2 Answers
Step 1: Upgrade the packages to the latest version for 16.04 decreases the chance of something going wrong during the upgrade to version 18.04. Run the command below
sudo apt update && sudo apt upgradeStep 2: Install the Ubuntu Update Manager.
sudo apt install update-manager-coreStep 3: Upgrade Ubuntu
sudo do-release-upgradeAfter you enter the upgrade command, you will be asked to confirm that you want to update via SSH. Type Y to continue.
Step 4: After the upgrade is complete, a restart will be required.
Step 5:To check what version of Ubuntu is currently installed, use the command below.
lsb_release -aEdit:
You will have to remove the PPA which were added to the system
Step 1: List the PPAs
find /etc/apt/sources.list.d -type f -name "*.list" -print0 | \ while read -d $'\0' file; do awk -F/ '/deb / && /ppa\.launchpad\.net/ {print "sudo ppa-purge ppa:"$4"/"$5}' "$file"; doneStep 2: Now, remove them
find /etc/apt/sources.list.d -type f -name "*.list" -print0 | \ while read -d $'\0' file; do awk -F/ '/deb / && /ppa\.launchpad\.net/ {system("sudo ppa-purge ppa:"$4"/"$5)}' "$file"; doneStep 3: Install bleachbit and gtkorphan
sudo apt install bleachbit
sudo apt install gtkorphanStep 4: Run bleachbit and gtkorphanas root
Step 5: Now, run the command
sudo do-release-upgradeEdit
Step 1: Edit apt configuration
Press Ctrl Alt T to open terminalNow, type
sudo nano /etc/apt/apt.confStep 2: Change the config:
APT::Default-Release *;Note If the apt.conf file does not exist, create your own user file in /etc/apt/apt.conf.d so you can guarantee that it won't be overwritten by package updates.
Use the command to create the file
sudo touch /etc/apt/apt.conf.d/apt.confThen to edit your file run
sudo nano /etc/apt/apt.conf.d/apt.confAdd this line to thee file
APT::Default-Release *; 7 This should do what you're looking to do.
Either of these options should work.
apt full-upgradeor
apt-get dist-upgradeHope this helps!
Also I would hope it goes without saying but these need to be ran as the root user. If you aren't root just use
sudo su root------ UPDATE -------
sudo su root
cd /usr/lib/ubuntu-release-upgraderLook for a file with a name similar to
check-new-release-gtk:30:Look for
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import GtkThe version requirement may not be there. If it isn't we need to add it.
------ UPDATE ------
Try this ...
sudo do-release-upgrade sudo apt-get update --fix-missing; sudo dpkg --configure -a; sudo apt-get install -f; sudo apt-get update; sudo apt-get upgrade;
sudo do-release-upgradeAfter a bit of research I found this answer on an older post from last year. The wording was a bit different.
17