8

I am trying to upgrade my computer. I am using apt-get. This is the command I am typing:

root@alphabeta:~# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I am confused. I cannot understand why apt-get does not download a newer version of Xubuntu 16.04, Xenial Xerus LTS from the Xubuntu 17.04, Zesty Zapus and install xubuntu upgrade.

I have updated my repositories before trying to use the command line argument apt-get update.

The links that are associated to not answer my question I do not think it is a problem with my repository I do not understand why apt-get returned saying there was nothing to upgrade: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded, the only thing I thought to do is clean my cache.

I would really like a better answer the information I received from asking about disk formatting with hdparm was excellent.

aptitude is nt my forte I learn as I go like lsof I cannot remember all the command line arguments.

2 Answers2

9

The preferred way to upgrade Xubuntu to the newest LTR version is to do:

sudo do-release-upgrade

The manual way you were attempting can be used to upgrade to any version you desire. however, some manual clean up is required after because apt-get will try to resolve the upgrade with the minimal amount of removals.
To manually upgrade:

First run: apt-mark showhold to be sure nothing is being held back.
If you find held packages then remove the hold and update them I find aptitude is the easiest way for marking and updating multiple packages at one time. Aptitude will also suggest removal of orphaned packages (packages that are no longer used by anything).
sudo apt-get autoremove will also remove packages that are no longer used.

After your system is fully up to date in the current version, change you sources to point to the version of Xubuntu that you want.
EX: change "trusty" to 'xenial"

Next run this series of commands:

sudo apt-get update This updates the package list
sudo apt-get upgrade This upgrades packages that can be upgraded without changing other packages. thus easing the dependency resolving in the next step.
sudo apt-get dist-upgrade This upgrades the remaining packages that can be upgraded with a minimal amount of removals.

You now have the new version of Xubuntu, and need to clean up obsoleted packages. Again I find aptitude to be the easiest way to do this.
Open aptitude and it will already have a list of suggested removals (orphaned packages), it is generally safe to remove them.
Now go through the remaining obsolete packages. In most cases, remaining packages have been replaced with another: ie gt4 with gt5 and gstreamer0.1-good with gstreamer1.0-good. The replacements will be under the heading of new packages.
This step is the most critical and why I like aptitude, replacing the obsoleted packages will often break other packages; however the broken package usually also has a replacement package to correct dependencies.
Aptitude will list broken packages and recommend fixes. Check over actions to be performed before committing to them.

When you have finish, clean your package cache: sudo apt-get autoclean this will remove the package cache for packages that are no longer used.

ravery
  • 6,874
  • are you saying that packages reported as being kept back is what is causing do-release-update to tell me I need to install all available updates first, while trying to upgrade tells me there is nothing to do? – Michael Oct 22 '20 at 23:50
  • and why are packages marked to be kept back? i didn't do it, is it possible that not doing so will break something? – Michael Oct 22 '20 at 23:51
2
sudo apt-get dist-upgrade

Installs the newest kernel and anything else that is held back by a normal apt-get upgrade. Perhaps you are looking for:

sudo do-release-upgrade
Synesso
  • 553
  • sudo apt-get dist-upgrade isn't just kernels. it will update/upgrade everything to the newest version available in the repositories. To do what he wants, his source lists must first be pointed to a newer version of ubuntu. – ravery Jul 24 '17 at 12:21
  • 1
    @ravery Forgive me, but I've never done an in-place upgrade before: Why would OP have to point his source lists to a newer version? – wjandrea Jul 24 '17 at 12:22
  • @wjandrea -- OP was trying to upgrade via the debian method. this answer incorrectly says that sudo dist-ugrade only upgrade kernel. If the sources are not changed nothing will be upgraded. – ravery Jul 24 '17 at 12:25
  • @ravery But that's why Ubuntu has do-release-upgrade – You'reAGitForNotUsingGit Jul 24 '17 at 12:26
  • @AndroidDev Yeah, that's why I'm confused. – wjandrea Jul 24 '17 at 12:27
  • @AndroidDev -- exactly, though I have had some desaters with it. Ubuntu has automated the various steps of upgrading with one command do-release-upgrade – ravery Jul 24 '17 at 12:29
  • @ravery Oh. Then I'm still confused. Why would OP have to change his source lists? – wjandrea Jul 24 '17 at 12:30
  • If there's an easier way of doing something, why make the OP do it the hard way? – You'reAGitForNotUsingGit Jul 24 '17 at 12:33
  • to upgrade via apt-get update,apt-get upgrade, then apt-get dist-upgrade the sources first have to point to the version of ubuntu that you want to upgrade to. Actually this method could be used to change to any debian based linux... as one poster had done, he changed his distro to kali – ravery Jul 24 '17 at 12:35
  • @AndroidDev I am not making him do it the hard way, just pointing out why he didn't succeed, he forgot a step. and the error in your original statement.. the automated way has had some dependency chain disasters that has resulted in complete removal of the desktop. maybe the OP wants to do the manual way – ravery Jul 24 '17 at 12:36