1

We made a very silly mistake in a server, using the sources in the sources.list file from ubuntu 14 into ubuntu 12.

The system still works but needless to say there are a lot of errors on upgrade.

Now the system seems to think it's a release 14, but it's not!

I was going to go and fetch the sources from 12 and try to start over so I could have a clean upgrade without having to reinstall but I just wanted to ask if it's the safe thing to do.

Any ideas?

I got the sources from here:

http://repogen.simplylinux.ch/generate.php

Ulukai
  • 385
  • 3
  • 13

1 Answers1

1

if you ran upgrade command and no one package upgraded and you directly get error then no problem you can replace your /etc/apt/sources.list entries with Ubuntu 12.04. generate from here and copy and paste to your /etc/apt/sources.list file and then update

sudo apt-get update  

or

if some packages upgraded then you can downgrade them but it is not sure you will get result equivalent to previous system. You can change this through pinning.

first do correct /etc/apt/sources.list with correct Ubuntu release . then create or edit /etc/apt/preferences

sudo nano /etc/apt/preferences

add

Package: *
Pin: release v=12.04
Pin-Priority: 1001

save and run command

 sudo aptitude dist-upgrade

see apt preferences document

 P > 1000
           causes a version to be installed even if this constitutes a
           downgrade of the package

priority is 1001 more than 1000 so it will downgrade packages that are installed in your system.

pl_rock
  • 11,297
  • What if you upgraded some packages and it got cut off right in the middle? Cause we did upgrade a good number of packages, but obviously not all. The whole thing was a bit iffy even before we did that. For example, it kept exiting when I was trying to do do-release-upgrade and such. – Ulukai Oct 29 '15 at 19:05