К основному контенту

How update Debian 7 (Wheezy) to 8/9 (Jessie/Stretch) in OpenVZ

OpenVZ allows you to create a virtual system (container) of a Linux system at the system level, with a common core.
Often, the most cheap VPS works on this technology.
Unfortunately, the OpenVZ project is developing poorly, new containers with fresh distributions do not come out.
However, you can simply update the system inside the container (in this case, Debian 7) to more relevant and fresh.
On some small VPS LES projects, I needed to use the current version of Debian, with i386 architectures, but only the Debian 7 wheezy assemblies were available, as the latest ones for this architecture.

No problem, update the system to a fresh release. The best solution would be to upgrade the system stepwise, upgrading the version by one after each update.
First, open the file /etc/apt/sources.list and change wheezy to jessie, so
deb http://ftp.debian.org/debian jessie main contrib
Save, exit, and execute apt-get update
root@de:~# apt-get update
Get:1 http://ftp.debian.org jessie Release.gpg [1652 B]
Get:2 http://ftp.debian.org jessie Release [77.3 kB]  
Get:3 http://security.debian.org jessie/updates Release.gpg [1601 B]       
Get:4 http://security.debian.org jessie/updates Release [43.3 kB]          
Get:5 http://ftp.debian.org jessie/main i386 Packages [6821 kB]
Get:6 http://security.debian.org jessie/updates/main i386 Packages [717 kB]
Get:7 http://security.debian.org jessie/updates/contrib i386 Packages [2526 B]          
Get:8 http://security.debian.org jessie/updates/non-free i386 Packages [4540 B]            
Get:9 http://security.debian.org jessie/updates/contrib Translation-en [1211 B]  
Get:10 http://security.debian.org jessie/updates/main Translation-en [360 kB]    
Get:11 http://security.debian.org jessie/updates/non-free Translation-en [11.8 kB]             
Get:12 http://ftp.debian.org jessie/contrib i386 Packages [49.1 kB]                            
Get:13 http://ftp.debian.org jessie/non-free i386 Packages [79.5 kB]             
Get:14 http://ftp.debian.org jessie/contrib Translation-en [38.3 kB]          
Get:15 http://ftp.debian.org jessie/main Translation-en [4581 kB]                      
Get:16 http://ftp.debian.org jessie/non-free Translation-en [72.0 kB]                        
Fetched 12.9 MB in 17s (737 kB/s)                                                              
Reading package lists... Done
W: There is no public key available for the following key IDs:
For fix this error run
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50
After start upgrade apt-get dist-upgrade
There will be a download and update packages

During the update, various questions regarding this or that configuration will appear. It is recommended to leave everything as default, if no changes are required.
libc6 error is ignored, it's will work anyway.

After the installation is completed, it is better to reboot vps
Now edit file /etc/apt/sources.list and change jessie to stretch and do command apt-get dist-upgrade After finish upgrade you can check the version:
root@de:~# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION="9 (stretch)"
The system is updated and ready to go.
Upgrading to buster or sid is not possible, because it requires updating the system library glib and the kernel of the system, which is not accessible inside the container. You'll get next error:
Configuring libc6

Kernel must be upgraded

This version of the GNU libc requires kernel version 3.2 or later.  Please upgrade your kernel 
before installing glibc.

dpkg: error processing archive /var/cache/apt/archives/libc6_2.28-10_i386.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)


Популярные сообщения из этого блога

How install mmcli and fix dbus error

mmcli - a great simple utility for controlling usb modems, included in Modem manager. The installation process is quite simple. First you need to install the package networkmanager. --- Install processs Then you need to add a daemon to autorun and run it. # systemctl enable ModemManager # systemctl start ModemManager  Now you can run mmcli utility. List of detected modems:  mmcli -L select you modem  Usage of mmcli utility here (link to other topic) In most cases, using most mmcli commands is impossible without sudo due to access restrictions for dbus and you will receive this error instead of executing the required command. dargod@zeropi:~$ mmcli -e -m 34 error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized: PolicyKit authorization failed: not authorized for 'org.freedesktop.ModemManager1.Device.Control'' if you want to use mmcli without superus