Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/DistUpgrade/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/DistUpgrade/__pycache__/DistUpgradeController.cpython-310.pyc
o

S(e���@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZddlmZddlmZmZmZmZmZmZmZmZmZddlmZddlm Z dd	l!m"Z"dd
l#m$Z$ddl%m&Z&ddl'm'Z'dd
l(m)Z)ddl(m*Z*e)j+e*_+ddl,m-Z-m.Z.ddl/m0Z0m1Z1ddl2m3Z4ddl2m5Z5ddl3Z3ddl#m6Z6m7Z7m8Z8ddl9m:Z:dZ;dd�Z<Gdd�de=�Z>Gdd�de?�Z@eAdkr�ddlBmBZBejCejDd�eB�ZEe@eE�ZFeF�G�eF�H�dSdS)�N)�
NoOptionError)�ConfigParser�)�get)	�country_mirror�url_downloadable�check_and_fix_xbit�get_arch�iptables_active�
inside_chroot�)get_string_with_no_auth_from_source_entry�is_child_of_process_name�
inhibit_sleep)�Template)�urlsplit)�Step)�MyCache)�DistUpgradeConfig)�DistUpgradeQuirks)�distinfo)�sourceslist)�SourcesList�	is_mirror)�
get_distro�NoDistroTemplateException)�gettext)�ngettext)�CacheExceptionDpkgInterrupted�CacheExceptionLockingFailed�NotEnoughFreeSpaceError)�
run_apportz/var/run/reboot-requiredcCs4gd�}z|�|�WStyt|�dYSw)zB key() function for sorted to ensure "correct" component ordering )�main�
restricted�universe�
multiverser)�index�
ValueError�len)�a�ordering�r*�C/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeController.py�component_ordering_keyNs�r,c@seZdZdS)�NoBackportsFoundExceptionN)�__name__�
__module__�__qualname__r*r*r*r+r-Ysr-c@s�eZdZdZdadd�Zdbdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdcdd�Z
dd�Zdd�Zdd�Zdddd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Z d?d@�Z!dAdB�Z"dCdD�Z#dEdF�Z$dGdH�Z%dIdJ�Z&dKdL�Z'dedMdN�Z(dedOdP�Z)dQdR�Z*dSdT�Z+dUdV�Z,dWdX�Z-dYdZ�Z.d[d\�Z/d]d^�Z0d_d`�Z1dS)f�DistUpgradeControllerz3 this is the controller that does most of the work NcCs�d}|dks
|dkrt��}tj�|d�}||_||_t�d|�t�d�t	�
d|jj�||_
|j
�td��d|_d|_|jrI|jjdkrMd|_n|jj|_t|�|_d|j�dd	�|_|j�d
�|j�d
dt|j��|j�d
dd
�|jr�|jjr�|j�d
dd�|j�dd�|_|j�dd�|_|j�dd�|_t�|_ dtj!vr�t	�
d�t"j�dd�d|_#t$||j�|_%t&�|_'dtj!d<dtj!d<dt��dtj!dftj!d<t(d�|j�)dd �}t"j�d!t|��t"j�d"td#��t"j�d$td%��t"j�d&d'�t"j�d(d'�t"j�d)d*�|j�*d+d,�|_+|j�,dd-�|_-g|_.|j�/d.��r?d/d0�|j�0d.�D�|_.d1|_1d|_2dS)2Nz/usr/share/locale/�.�mo�ubuntu-release-upgraderzUsing '%s' viewz
Reading cacheT�Files�	BackupExt�Options�withNetwork�
devRelease�False�True�Sources�From�To�ValidOrigin�"RELEASE_UPGRADE_NO_FORCE_OVERWRITEzenable dpkg --force-overwritezDPkg::Options::z--force-overwriteF�1�RELEASE_UPGRADE_IN_PROGRESS�PYCENTRAL_FORCE_OVERWRITEz%s:%sz	/imported�PATHz./imported/invoke-rc.d�Network�
MaxRetrieszAcquire::Retriesz
Dpkg::MaxArgsizDpkg::MaxArgBytesizAcquire::http::Timeout�20zAcquire::ftp::TimeoutzApt::Get::List-Cleanup�false�Distro�ForcedObsoletes�ValidMirrors�ThirdPartyMirrorscSsg|]}|d�qS)rr*)�.0�pairr*r*r+�
<listcomp>�sz2DistUpgradeController.__init__.<locals>.<listcomp>i�)3�os�getcwd�path�join�datadir�optionsr�bindtextdomain�
textdomain�logging�debug�	__class__r.�_view�updateStatus�_�cache�fetcherr8�
useNetworkr�configr�sources_backup_ext�add_section�set�str�
devel_release�fromDist�toDist�originr	�arch�environ�apt_pkg�_partialUpgrader�quirksr�inhibitor_fdr�getint�getlist�forced_obsoletes�getListFromFile�
valid_mirrors�valid_3p_mirrors�has_section�items�_aptCronJobPerms�_session_bus)�self�distUpgradeViewrUrT�	localedir�
maxRetriesr*r*r+�__init__`sp






�
�
zDistUpgradeController.__init__TFc
Cs�t�d�|jdur|j�d�n
|j��|j��d}d}	z|�|�WStyo}z=|d7}|j	�
�t�d�t�d|�||kret�
d	|�|j	�
td
�td��|r`|��nt�d�WYd}~nd}~wwq )NzopenCache()�PreCacheOpen�rTr皙�����?z'failed to lock the cache, retrying (%i)zCache can not be locked (%s)zUnable to get exclusive lockz�This usually means that another package management application (like apt-get or aptitude) already running. Please close that application first.)rXrYr^rn�run�release_lock�unlock_lists_dir�
_openCacherr[�
processEvents�time�sleep�errorr]�abort�sys�exit)rz�lock�restore_sources_list_on_fail�MAX_LOCK_RETRIES�
lock_retry�er*r*r+�	openCache�s8





��

���zDistUpgradeController.openCachec	Cs�zt|j|j|j|j��|�|_|j|_Wn5tyJt�	d�gd�}t
j�d�dkr2|�
d�|j���|�t|j|j|j|j���|_Ynw|j|j_t�dt|j��dS)Nz-dpkg interrupted, calling dpkg --configure -a��
/usr/bin/dpkgz--configurez-a�DEBIAN_FRONTEND�noninteractive�--force-confoldz/openCache(), new cache size %i)rrar[rn�getOpCacheProgressr^�	apt_cacherrX�warningrPrkr�append�getTerminal�callrm�partialUpgraderYr')rzr��cmdr*r*r+r��s,�


��

z DistUpgradeController._openCachecCs$|j�dd�}|jjj|vrdSdS)z�
      Returns True if this view support upgrades over ssh.
      In theory all views should support it, but for savety
      we do only allow text ssh upgrades (see LP: #322482)
      �View�
SupportSSHTF)rarqr[rZr.)rz�	supportedr*r*r+�_viewSupportsSSH�sz&DistUpgradeController._viewSupportsSSHcCs�tj�d�}tj�|�s{tj�d�r{td�r{|��s1t�d�|j	�t
d�t
d��t�d�dSd	}|j	�
t
d
�t
d�|�}|dkrIt�d�t�dd
d|dt|�g�}|dkr{t
d�}t
d�|}t�rtd|}|t
d�|7}|j	�||�dS)z� this will check for server mode and if we run over ssh.
            if this is the case, we will ask and spawn a additional
            daemon (to be sure we have a spare one around in case
            of trouble)
        z"/var/run/release-upgrader-sshd.pidz/proc�sshdzupgrade over ssh not allowedz.Upgrading over remote connection not supportedz�You are running the upgrade over a remote ssh connection with a frontend that does not support this. Please try a text mode upgrade with 'do-release-upgrade'.

The upgrade will abort now. Please try without ssh.rFi�zContinue running under SSH?aThis session appears to be running under ssh. It is not recommended to perform a upgrade over ssh currently because in case of failure it is harder to recover.

If you continue, an additional ssh daemon will be started at port '%s'.
Do you want to continue?z/usr/sbin/sshdz-oz
PidFile=%sz-przStarting additional sshdz�To make recovery in case of failure easier, an additional sshd will be started on port '%s'. If anything goes wrong with the running ssh you can still connect to the additional one.
z-iptables -I INPUT -p tcp --dport %s -j ACCEPTz�If you run a firewall, you may need to temporarily open this port. As this is potentially dangerous it's not done automatically. You can open the port with e.g.:
'%s'T)rPrRrS�exists�isdirr
r�rXr�r[r]r�r��askYesNoQuestion�
subprocessr�rer
�information)rz�pidfile�port�res�summary�descrr�r*r*r+�	_sshMagicsP
��
�

��

����zDistUpgradeController._sshMagiccCs�ddlm}ddlm}d}|jdks"|jdks"|jdks"|jdkr$d	}|d|d
�}|j��|j�d�s@|j��|j�d�r5|jdurLt	�
d
�dS|j��}||j||j|jd�}|�
�dS)z� this is a helper that is run if we are started from a CD
            and we have network - we will then try to fetch a update
            of ourself
        r)�MetaReleaseCore)�DistUpgradeFetcherSelfF�dapper�hardy�lucid�preciseT)�useDevelopmentRelease�forceLTSr�NzNo new dist found)�new_dist�progressrU�view)�MetaReleaser�r��releaser[r��
downloaded�waitr�rXr��getAcquireProgressrUr�)rzr�r�r��mr�r_r*r*r+�_tryUpdateSelfCs2



�

�


�z$DistUpgradeController._tryUpdateSelfc
Cs0t�d�dg}|D]�\}}d|}tj�|�r�t�}t|��
}|�|�Wd�n1s/wYz|�dd�}Wnt	yPt�d||f�YdSwz
tj�
d	|�}Wntyv}	zt�d
|	�WYd}	~	dSd}	~	ww||tj�
d|�fvr�t�d|||tj�
d|�f�dSq
d
S)z� check that /usr/bin/python3 points to the default python version.
            Users tend to modify this symlink, which breaks stuff in obscure
            ways (Ubuntu #75557).
        z_pythonSymlinkCheck run)�python3r�z/usr/share/%s/debian_defaultsN�DEFAULTzdefault-versionz'no default version for %s found in '%s'Fz/usr/bin/%szos.path.realpath failed (%s)z/usr/binz8%s symlink points to: '%s', but expected is '%s' or '%s'T)rXrYrPrRr��SafeConfigParser�open�readfprr�realpath�OSErrorr�rS)
rz�binaries_and_dirnames�binary�dirname�debian_defaultsra�f�expected_default�fs_default_versionr�r*r*r+�_pythonSymlinkCheckbs>

�������z)DistUpgradeController._pythonSymlinkCheckc
Csxtjgd�tjdd���d��|_}t�d|�||jksD||j	ksDt�
d||jf�|j�
td�td||j	f��t
�d	�|jr�|jjr�t��d
}t�d|�t�dt�|d
��tj�|d�rutj�d|d�tj�|d�r�tj�d|d�|d}tj�|�r�t�d|�t�tj|�|��|��s�t�
d�|j�
td�td��t
�d	�z|��Wnty�}zt�
d|�WYd}~dSd}~ww|j� |j�s�dS|j�!�|_"|j"r�dtj#d<ndtj#d<|�$��st�
d�dSd	dl%m&}|D],}tj�|��r8t�'|tj(��s8t�
d|�|j�
td�|td �|�|�)��q
dS)!z= initial cache opening, coherence checking, network checking )�lsb_releasez-cz-sT)�stdout�universal_newlinesrzlsb-release: '%s'zBad upgrade: '%s' != '%s' zCan not upgradez=An upgrade from '%s' to '%s' is not supported with this tool.rz
/backportszusing backports in '%s' zhave: %sz/*.udebr�zDir::Bin::dpkgz/usr/lib/apt/methodszDir::Bin::methodsz/etc/apt/apt.conf.d/01ubuntuzadding config '%s'z%pythonSymlinkCheck() failed, abortingzMYour python3 install is corrupted. Please fix the '/usr/bin/python3' symlink.zopenCache() failed: '%s'NF�server�RELEASE_UPGRADE_MODE�desktopzcheckViewDepends() failed)�SYSTEM_DIRSz%s not writablezCan not write to '%s'z�Its not possible to write to the system directory '%s' on your system. The upgrade can not continue.
Please make sure that the system directory is writable.)*r��Popen�PIPE�communicate�stripr�rXrYrgrhr�r[r]r�r�rU�havePrerequistsrPrQ�info�globrRr�rlrard�read_config_filer�r�r��SystemErrorr^�coherence_check�need_server_mode�
serverModerk�checkViewDepends�DistUpgradeMainr��access�W_OKr�)rzr��backportsdir�confr�r��	systemdirr*r*r+�prepare�s�
�����

�
��



���zDistUpgradeController.preparecCs>t�d|�|jst�d�dSd|j|jf}t|tj�S)zf
        helper that checks if a sources.list entry points to 
        something downloadable
        zverifySourcesListEntry: %sz(skipping downloadable check (no network)Tz%s/dists/%s/Release)rXrYr`�uri�distr)rz�entryr�r*r*r+�_sourcesListEntryDownloadable�s
z3DistUpgradeController._sourcesListEntryDownloadablecs�	|rt�d�nt�d��j�dd�}�j�ddd�s!dtjvr(t�d�d}d}|d	kr�jr�t��j�d
d���j�d
d�D]�}t�d|�|�j	vs~�j	|j
r~t�j	|j
j�d
ks~�j	|j
r�t�j	|j
j�dkr�j	|j
jd
j
dkr�t�d|�zt�}|��j�|�d�d	}t�d�WnKty�}z?t�d|�t�d�d}ddg}d}	�j�d|	�j||��j�d|	�jd||��j�dd�jd||�WYd}~nd}~wwnqB�j�dd�}
�jg�fdd�|
D�}�jg�fdd�|
D�}d�_g}
�jjdd�D]F}d |jv�r#�q|j�d!��r,�q|j�d"��r5�qd#|jv�sW|j�d$��sW|j�d%��sW|j�d&��sW|j�d'��rY�q|
�|��q|
�j_d}i�_i}�jjdd�D�]�}|j|v�r�d(||j<|j�s�|j�r��qs|j�d)��r�|j �jk�r�t�d*|�d	|_�qs|j�d)��r�t!j�"d+�}tj#�$d,|t!�%|j�d-|j d.f��s�t�d/|�d	|_�qsd0�j}|j�s�|j�d1��r�|j |k�r��j|_ d2g|_&t�d3|��qs|j�s|j�d4�j��rt�d5�d	|_�qs|j�sD�j'�rD�j'j(d	k�rDd6�j|j v�rDt�d7�d6�j|_ |j)t*d8��j7_)d	|_�qs|j�s�d9|jv�r�t�d:�d;t+�dfD],}	t,�,|�}|	|_�j|_ ��-|��r�t�.d<|	�|	|_|j|v�r�d=||j<n�qZt�d>t/|����0|j�}|�p���1|j�}|�s�|�r�d	}|j�s�|j2d?k�s�d@|jv�s�dA�j|j v�s�dB�j|j v�s�d#|jv�r�d}|j |v�r�t�dCt/|��||O}nu|j |v�rA||jd(k�r||O}t,�,|�}�j|_ ��-|��s
dD||j<nd=||j<||jdDk�r*d	|_d	�_t�dEt/|��n1||O}||�3|j �|_ t�dFt/|��n|j2d?k�rI�qs|�r[d	|_d	�_t�dGt/|��|j2dk�r~dH|jv�smdI|jv�r~�j4dJv�r~t�dK�j4�dL|_dM�jdN�jdA�jfD]1}�j�5|t6��|j�s�|j |k�r�|j2dk�r�|j&D]}||v�r��q��j|�|��q��q��qs|j �jk�rˈj|_ dOt*dP��j}t7|j)t8��r�|j)|�9dQ�7_)n|j)|7_)d	|_d	�_t�dRt/|��|�rp|j |v�r||�3|j �|_ |j |v�r�qsdM�jdN�jdA�jfD]-}�j�5|t6��|j |k�rP|j2dk�rP|j&D]}||v�rF�q=�j|�|��q=�q$t�dS|j2|j |j&f�d}	d}�j�|j2|	|j |j&|��qs�jjdd�D]X}|j�s�|j�s�|j2d?k�s�|j�d)��s�|j �jk�r��qz|j �jv�rшj�j�j|j }|�r�t�.dTt/|��|j&�:t;|t<dU��t�.dVt/|���j|j =�qz|S)WNz&rewriteSourcesList() with mirror_checkzrewriteSourcesList()r<�
Components�AllowThirdPartyF�"RELEASE_UPGRADER_ALLOW_THIRD_PARTYz,mirror check skipped, *overriden* via configTrI�BaseMetaPkgszChecking pkg: %srr�nowz)BaseMetaPkg '%s' has no candidate.originsr!z/get_distro().enable_component("main") succeededz$NoDistroTemplateException raised: %sz]get_distro().enable_component("main") failed, overwriting sources.list instead as last resortz* auto generated by ubuntu-release-upgraderr"� http://archive.ubuntu.com/ubuntu�deb�-updatesz!http://security.ubuntu.com/ubuntu�	-security�Pocketsc�g|]	}d�j|f�qS�z%s-%s)rg�rM�x�rzr*r+rO��z<DistUpgradeController.rewriteSourcesList.<locals>.<listcomp>cr�r�)rhr�r�r*r+rOr�z/extras.ubuntu.comzE## This software is not part of Ubuntu, but is offered by third-partyz5## developers who want to ship their latest software.z/archive.canonical.comzE## Uncomment the following two lines to add software from Canonical'sz## 'partner' repository.zK## This software is not part of Ubuntu, but is offered by Canonical and thez2## respective vendors as a service to Ubuntu users�unknownzcdrom:z,disabled '%s' cdrom entry (dist == fromDist)zDir::State::listsz
%s/%s%s_%s_%s�dists�Releasez:disabling cdrom source '%s' because it has no Release filez
%s-commercialzhttp://archive.canonical.com�partnerz transitioned commercial to '%s' z*http://landscape.canonical.com/packages/%sz&commenting landscape.canonical.com outz%s-proposedz2upgrade to development release, disabling proposedz5Not for humans during development stage of release %szold-releases.ubuntu.com/z-upgrade from old-releases.ubuntu.com detectedz"http://%sarchive.ubuntu.com/ubuntuz%transition from old-release.u.c to %s�passedzexamining: '%s'zdeb-srcz/security.ubuntu.comz%s-securityz%s-backportsz%entry '%s' is already set to new dist�failedz)entry '%s' was disabled (no Release file)zentry '%s' updated to new distz&entry '%s' was disabled (unknown dist)zarchive.ubuntu.comzsecurity.ubuntu.com)�amd64�i386z-moving %s source entry to 'ports.ubuntu.com' z%http://ports.ubuntu.com/ubuntu-ports/�%s�
%s-updates� zdisabled on upgrade to %szUTF-8z(entry '%s' was disabled (unknown mirror)zAdding entry: %s %s %sz)fixing components inconsistency from '%s')�keyzto new entry '%s')=rXrYrarq�getWithDefaultrPrkr�r`r^�	candidater'�origins�archiver�get_sources�sources�enable_componentr�	exception�addrhrg�sources_disabled�listr��line�
startswithr��found_components�invalid�disabledr�rl�find_dirrRr��uri_to_filename�compsrUrf�commentr]r�copyr�r�r�isMirror�isThirdPartyMirror�typer%rj�
setdefaultrd�
isinstance�bytes�encode�extend�sortedr,)rz�mirror_check�sync_components�main_was_missing�pkgname�distror�rrr��pockets�	fromDists�toDists�new_listr��foundToDist�entry_uri_test_results�listdir�cdist�
test_entry�validMirror�thirdPartyMirror�validTo�d�comp�disable_comment�component_diffr*r�r+�rewriteSourcesList�s�




�
�

��
����������������


��

��


�

�


�

���

��
�
�
�z(DistUpgradeController.rewriteSourcesListcst�d�t�jd��_�j��j�t�fdd��jD��s3�j�	t
d�t
d��j�}|s3����j
dd�s�t�d	��j�	t
d	�t
d
��j�jf�}|r�t�jd��_�j
dd�s��jr�t
d�}t
d
��j�jf}�j�	||�sz���t�d�d}ddg}�j�d|�j|��j�d|�jd|��j�dd�jd|�n����j��z
t��}|��Wn:ty�t�d�tj�d�r�j�t
d�t
d��t�ddg�YdS�j�t
d�t
d��t�d�YdSw�j�r�j�t
d�t
d��t�� �j�dS) NzupdateSourcesList()��matcherPathc3s&�|]}|jdko|j�jkVqdS)r�N)r#r�rg)rMr�r�r*r+�	<genexpr>��$z:DistUpgradeController.updateSourcesList.<locals>.<genexpr>z!No valid sources.list entry foundz�While scanning your repository information no entry about %s could be found.

An upgrade might not succeed.

Do you want to continue anyway?T)r*zNo valid mirror foundaWWhile scanning your repository information no mirror entry for the upgrade was found. This can happen if you run an internal mirror or if the mirror information is out of date.

Do you want to rewrite your 'sources.list' file anyway? If you choose 'Yes' here it will update all '%s' to '%s' entries.
If you select 'No' the upgrade will cancel.FzGenerate default sources?z�After scanning your 'sources.list' no valid entry for '%s' was found.

Should default entries for '%s' be added? If you select 'No', the upgrade will cancel.z"Generated new default sources.listr�r!r"r�r�z"http://security.ubuntu.com/ubuntu/r�z<Repository information invalid after updating (we broke it!)�/usr/bin/apport-bugzRepository information invalidzlUpgrading the repository information resulted in a invalid file so a bug reporting process is being started.�
apport-bug�ubuntu-release-upgrader-corez�Upgrading the repository information resulted in a invalid file. To report a bug install apport and then execute 'apport-bug ubuntu-release-upgrader'.�.Missing apport-bug, bug report not autocreatedzThird party sources disabledz�Some third party entries in your sources.list were disabled. You can re-enable them after the upgrade with the 'software-properties' tool or your package manager.)!rXrYrrTr�backuprb�anyr[r�r]rgr�r?r�rhr`r�r�saverl�
SourceList�read_main_listr�rPrRr�r�r�rr��
get_telemetry�set_using_third_party_sources)rzr��prim�seconr�rrr*r�r+�updateSourcesList
s�
��

��
�
�

��

�	��
��z'DistUpgradeController.updateSourcesListcCst�d�g}g}g}g}g}|jD]9}|jr|�|j�q|jr(|�|j�q|jr2|�|j�q|jr?|j	r?|�|j�q|jrK|j
rK|�|j�qt�dd�|��t�dd�|��t�dd�|��t�dd�|��t�dd�|��dS)Nz$About to apply the following changeszKeep at same version: %sr
zUpgradable, but held- back: %sz
Remove: %szInstall: %szUpgrade: %s)rXrYr^�marked_installr��name�marked_upgrade�
marked_delete�is_installed�
is_upgradable�marked_keeprS)rz�inst�up�rm�held�keep�pkgr*r*r+�_logChangesrs$

�z!DistUpgradeController._logChangescCs�t�d�|j�d�|jsdSt|jj�dkr(t�d�|j�|j	�|�
�t|jj�dkrR|jj}tddt|��}tdd	t|��d
�|�}|j	�
||�dSg}|j�dd�D]}||jvrm|j|jrm|�|�q[t�d
d�t|���|j��|_|j�|j|j|j�|_t|j�dkr�|j�ddd�n|j�ddd�|jr�|jj|_t�dd�t|j���t�dd�t|j���dS)N�doPostInitialUpdate�PostInitialUpdateFrz-packages in reqReinstall state, trying to fixzPackage in inconsistent statezPackages in inconsistent statez�The package '%s' is in an inconsistent state and needs to be reinstalled, but no archive can be found for it. Please reinstall the package manually or remove it from the system.z�The packages '%s' are in an inconsistent state and need to be reinstalled, but no archive can be found for them. Please reinstall the packages manually or remove them from the system.z, rI�MetaPkgszMetaPkgs: %sr
r7�foreignPkgsr;r:�Foreign: %s�Obsolete: %sT)rXrYrnr�r^r'�req_reinstall_pkgsr��fix_req_reinstr[r�rrSr�rarqrVr�r)�_getObsoletesPkgs�
obsolete_pkgs�_getForeignPkgsrirgrh�foreign_pkgsrdr��installedTasks�tasks)rz�	reqreinst�headerr��	meta_pkgsr^r*r*r+r`�sL

��
�
�
z)DistUpgradeController.doPostInitialUpdatec
Cs�t�d|�|jst�d�dS|jj��|j��}d}|dur%|}n|j�	dd�}d}||kraz	|j�
|�WdSttfy`}zt
|�}t�d||f�|d	7}WYd}~q.d}~wwt�d
�|rv|j�td�td�d
|�dS)Nz"running doUpdate() (showErrors=%s)zBdoUpdate() will not use the network because self.useNetwork==falseTrrErF�zHIOError/SystemError in cache.update(): '%s'. Retrying (currentRetry: %s)rzdoUpdate() failed completelyzError during updatez�A problem occurred during the update. This is usually some sort of network problem, please check your network connection and retry.rF)rXrYr`r^�_listrLr[r�rarp�updater��IOErrorrer�r])rz�
showErrors�forceRetriesr��currentRetryr}�	error_msgr�r*r*r+�doUpdate�s:

���
�zDistUpgradeController.doUpdatecsFtj�d�s
t�d�dSgd�}t�fdd�|D��s#t�d�dSd}td	��V}|D]K}|��}z|��\}}}}}	}
Wnt	yY}zt�d
||f�WYd}~q,d}~ww|dkr_q,d}d
|�d�vrwt�d|�Wd�dSq,Wd�n1s�wY|s��j
�td�td��dS�j
�td�td��dS)z= check that /boot/efi is a mounted partition on an EFI systemz/sys/firmware/efizNot an UEFI systemT)zshim-signedzgrub-efi-amd64z
grub-efi-ia32zgrub-efi-armzgrub-efi-arm64�
sicherbootc3s&�|]}|�jvo�j|jVqdS�N)r^rV)rM�blr�r*r+rB�rCz6DistUpgradeController._checkBootEfi.<locals>.<genexpr>z'UEFI system, but no UEFI grub installedFz/proc/mountsz-line '%s' in /proc/mounts not understood (%s)Nz	/boot/efi�rw�,zFound writable ESP %sz%EFI System Partition (ESP) not usablezxYour EFI System Partition (ESP) is not mounted at /boot/efi. Please ensure that it is properly configured and try again.zzThe EFI System Partition (ESP) mounted at /boot/efi is not writable. Please mount this partition read-write and try again.)
rPrRr�rXrYrIr�r��splitr&r[r�r])rz�bootloaders�mounted�mountsr�what�where�fsrUr(�br�r*r�r+�
_checkBootEfi�sJ


������	��z#DistUpgradeController._checkBootEficCs8td�}td�}td�}td�}td�}td�}td�}|j�dd	d
�r+t�d�dS|��}z	|j�|�WdSty�}	zWt	j�
d
�}
d}|
|d|d|d|d|d|i}|	jD]/}
|dkrc|d7}|
j|vrz||j
|
j|
j|
j||
jd�7}qY||j
|
j|
j|
jdd�7}qY|j�||�WYd}	~	d
Sd}	~	ww)z: this checks if we have enough free space on /var and /usrzNot enough free disk spacez�The upgrade has aborted. The upgrade needs a total of {str_total} free space on disk '{str_dir}'. Please free at least an additional {str_needed} of disk space on '{str_dir}'. {str_remedy}zIRemove temporary packages of former installations using 'sudo apt clean'.z�You can remove old kernels using 'sudo apt autoremove' and you could also set COMPRESS=xz in /etc/initramfs-tools/initramfs.conf to reduce the size of your initramfs.zbEmpty your trash and remove temporary packages of former installations using 'sudo apt-get clean'.z!Reboot to clean up files in /tmp.rq�	FreeSpace�	SkipCheckFz,free space check skipped via config overrideT�Dir::Cache::archivesz/varz/boot�/z/tmpz/usrr
)�	str_total�str_dir�
str_needed�
str_remedyN)r]rarrXr�� _is_apt_btrfs_snapshot_supportedr^�checkFreeSpacerrlr�free_space_required_list�dir�format�
size_total�size_neededr[r�)rz�err_sum�err_msg�remedy_archivedir�remedy_boot�remedy_root�
remedy_tmp�
remedy_usr�with_snapshotsr��
archivedir�err_long�remedy�reqr*r*r+�_checkFreeSpacesP
��


�
���z%DistUpgradeController._checkFreeSpacecCs�|j�td��|j�|j|j|j�sdS|jr!|j�|j�s!dS|j�	�}|j�
�|��|j�
�|��s:dS|�
�s@dS|j�
�|j��|_t|j�dkro|j��t�dd�dd�|jD���t�d|j�|j�
�|S)	N�Calculating the changesFrz
demoted: '%s'r
cS�g|]}|j�qSr*�rSr�r*r*r+rOe�z9DistUpgradeController.calcDistUpgrade.<locals>.<listcomp>zfound components: %s)r[r\r]r^�distUpgrader�rm�installTasksrm�get_changesr�r_r�r��get_installed_demoted_packages�installed_demotionsr'�sortrXrYrSr)rz�changesr*r*r+�calcDistUpgradeFs,




 
z%DistUpgradeController.calcDistUpgradecCs0|��}|sdS|j�td�||j|jj�}|S)NFz!Do you want to start the upgrade?)r�r[�confirmChangesr]r�r^�required_download)rzr�r�r*r*r+�askDistUpgradels�z$DistUpgradeController.askDistUpgradecCs t��}|�|j�otj�d�S)Nz2/var/snap/canonical-livepatch/common/machine-token)�distro_info�UbuntuDistroInfo�is_ltsrgrPrR�isfile)rz�dir*r*r+�_isLivepatchEnabledysz)DistUpgradeController._isLivepatchEnabledcsZt��}���r|��j�rdSt�fdd�|�d�D��j�}�j�dt	d�|�}|S)NTc3s"�|]}|j�jkr|jVqdSr{)�seriesrh�version)rM�rr�r*r+rB�s� z5DistUpgradeController.askLivepatch.<locals>.<genexpr>�objectzdLivepatch security updates are not available for Ubuntu %s. If you upgrade, Livepatch will turn off.)
r�r�r�r�rh�next�get_allr[�askCancelContinueQuestionr])rzr�r�r�r*r�r+�askLivepatch}s ��z"DistUpgradeController.askLivepatchcCs4tj�d�rt�dt|j��t�dd�dSdS)N�/etc/cron.daily/aptzdisabling apt cron job (%s)i�)rPrRr�rXrY�octrx�chmodr�r*r*r+�_disableAptCronJob�s�z(DistUpgradeController._disableAptCronJobcCs,tj�d�rt�d�t�d|j�dSdS)Nr�zenabling apt cron job)rPrRr�rXrYr�rxr�r*r*r+�_enableAptCronJob�s
�z'DistUpgradeController._enableAptCronJobc

Cs�|��d}|j��}|j�ddd�}|r:z
t��d�d�d}Wnt�	d�d}Y|j�
��d||f�|j�dd	�}d
}d}||kr�zt
�|jj�}t
�|�|_|j�|j|�WdStjjy~}	zt�d�d}|	}WYd}	~	n%d}	~	wty�}	zt�d
|	|f�|d7}|	}WYd}	~	qEd}	~	ww|r�|j�td�td��nt�d�|j�td�td�d|�|��|��dS)NrrI�SlideshowUrlr]�getdefaultlocale�enz%s#locale=%srErFFz
user canceledT�:IOError in cache.commit(): '%s'. Retrying (currentTry: %s)rzUpgrade canceledzwThe upgrade will cancel now and the original system state will be restored. You can resume the upgrade at a later time.�+giving up on fetching after maximum retries�Could not download the upgradesz�The upgrade has aborted. Please check your Internet connection or installation media and try again. All files downloaded so far have been kept.r)r�r[r�rar�localer�rrXr�getHtmlViewr�rprl�PackageManagerr^�	_depcache�Acquirer_�_fetch_archives�apt�FetchCancelledExceptionr�rtr�r�r]r�r�)
rzrw�	fprogress�url�langr}�
user_canceledr�pmr�r*r*r+�doDistUpgradeFetching�sX

�
���	�
�z+DistUpgradeController.doDistUpgradeFetchingcCs`zddl}Wn
tyYdSwz
|��}|��}Wnt�d�YdSt�d|�|S)z' check if apt-btrfs-snapshot is usable rNzfailed to check btrfs supportFz!apt btrfs snapshots supported: %s)�apt_btrfs_snapshot�ImportError�AptBtrfsSnapshot�snapshots_supportedrXrrY)rzr��	apt_btrfsr�r*r*r+r��s�
z6DistUpgradeController._is_apt_btrfs_snapshot_supportedcCsF|��sdSddl}|��}d|j}|�|�}t�d||f�dS)z2 create btrfs snapshot (if btrfs layout is there) Nrzrelease-upgrade-%s-z#creating snapshot '%s' (success=%s))r�r�r�rh�create_btrfs_root_snapshotrXr�)rzr�r��prefixr�r*r*r+� _maybe_create_apt_btrfs_snapshot�s

z6DistUpgradeController._maybe_create_apt_btrfs_snapshotcCs�i}tjdg|d<dtjd<dD]}tj�|�||d<tj�|�qz|��W|D]}||D]	}tj�||�q1q+S|D]}||D]	}tj�||�qEq?w)Nzdir::bin::dpkgz	/bin/true)zdpkg::pre-invokezdpkg::pre-install-pkgszdpkg::post-invokezdpkg::post-install-pkgsz::)rlra�
value_list�clear�
doDistUpgraderd)rz�backups�lst�itemr*r*r+�doDistUpgradeSimulation�s"
�
���z-DistUpgradeController.doDistUpgradeSimulationc
Cs�d}|j��}|j�|j�}|j�dd�}|js"|j�d�|�	�d}d}||k�rWz|j�
||�}t�d|�W�nt
y�}z�t�d|�|}tj�d�r�td��}|��}Wd�n1sfwYt�d	|�d
dg}	|	D]1}
t|��|
�r�t�d�|��td
�}|dt|�7}|td�7}|j�td�|�|��qxtd�}|js�t�s�|td|�7}|j�td�|�gd�}tj�d�dkr�|�d�|j���|�|��WYd}~dSd}~wt�y}zt�d||f�|d7}|}WYd}~q&d}~wt �yP}z6t�!d�|}|j"dk�rF|��td
�}|dt|�7}|td�7}|j�td�|�|��WYd}~nd}~ww|��dSt�d�|j�td�td�d|�|��dS) NrrErF�StartUpgradeFzcache.commit() returned %sz#SystemError from cache.commit(): %sz./var/run/ubuntu-release-upgrader-apt-exceptionzfound exception: '%s'z;E:Internal Error, Could not perform immediate configurationz E:Couldn't configure pre-depend z-detected preconfigure error, restorting state�Error during commitz
'%s'
�Restoring original system statezCould not install the upgradeszrThe upgrade has aborted. Your system could be in an unusable state. A recovery will run now (dpkg --configure -a).z�

Please report this bug in a browser at http://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+filebug and attach the files in /var/log/dist-upgrade/ to the bug report.
%sr�r�r�r�r�rzcache.commit()�Tr�r�zdThe upgrade has aborted. Please check your Internet connection or installation media and try again. r)#r[r��getInstallProgressr^rarprmrnr�r��commitrXrYr�r�rPrRr�r��readrerr�r]r�r rkrr�r�r�rtr�r�errno)
rzrwr��	iprogressr}r�rr�r��pre_configure_errors�
preconf_error�msgr�r*r*r+r�s�



��
��
��
��
�z#DistUpgradeController.doDistUpgradec
Cs�t��d�tj�tj�d��}|jj	D]!}tj�tj�
|j��|kr5zt�|j�Wqt
y4Yqwq|��|j�d�|j�tj�|j�td��|j��}|j�|j|j|j�}t�dd�t |���t�dd�t |���|j�!dd	�D]}||vr�t�"d
|�t#�}nq~|j�$ddd�s�t�d
�dS|j�!dd�D]}||jvr�|j|j%r�|j&�'|j�!|d��q�t�d|j&�|j(r�||j)}n
t#dd�|j*D��}|t#|j&�O}|j�+�}t�dd�|��|t#|�O}|j�$ddd��st�d�t#�}t�d|�t�d�|j�,�}t-|�D]/\}	}
|�.|	t/t0|��d�|
|j1v�rK|j�2�|j�3|
||j&|j1��sKt�d|
��qt�d�|�4�|j�5�}t�dd�dd�|D���td�}td�td�g}
t0|�dk�r�|j�6||gd|
d ��r�|j�7�}|j�8|j�}z	|j�9||�Wn*t:t;f�y�}zt�"d!|�|j�"td"�td#�d$|�WYd}~nd}~ww|j�d%�|j<�s�|�=�dS)&N�POSTUPGRADEr��PostUpgradezSearching for obsolete softwarerer
rdrIr�zXthe BaseMetaPkg '%s' is in the obsolete list, something is wrong, ignoring the obsoletes�RemoveObsoletesTzSkipping obsolete RemovalrbrJzforced_obsoletes: %scSr�r*r�)rM�pr*r*r+rO�r�z7DistUpgradeController.doPostUpgrade.<locals>.<listcomp>zUnused dependencies: %sz0Skipping RemoveObsoletes as stated in the configzremove_candidates: '%s'z Start checking for obsolete pkgsgY@z:'%s' scheduled for remove but not safe to remove, skippingz!Finish checking for obsolete pkgsz1The following packages are marked for removal: %scSr�r*r�)rMr^r*r*r+rO�r�zRemove obsolete packages?�_Keep�_RemoverFz,cache.commit() in doPostUpgrade() failed: %sr�z[A problem occurred during the clean-up. Please see the below message for more information. r�PostCleanup)>rM�	add_stagerPrRr�rlrarr_rw�abspath�destfile�unlinkr�r�rnr�r[�setStepr�CLEANUPr\r]r^rhrjrirgrhrXrYrSr)rqr�rdrrVrrr(r`rir��_getUnusedDependenciesr��	enumeraters�floatr'rkr��tryMarkObsoleteForRemoval�doner�r�r�r�r�r�rtrm�runPostInstallScripts)rzr�r��now_obsolete�now_foreignr^�remove_candidates�unused_dependenciesr��ir-r�r��actionsr�r�r�r*r*r+�
doPostUpgradens�
���
�
�




�

�
���z#DistUpgradeController.doPostUpgradecCs�|jr
|j��|j��|j�dd�D]C}tj�|�s$t�	d|�qt�
d|�zt|�|j�
�j|gdd�WqtyW}zt�d||f�WYd}~qd}~ww|jrb|j��dSdS)	z� 
        scripts that are run in any case after the distupgrade finished 
        whether or not it was successful

        Cache lock is released during script runs in the event that the
        PostInstallScripts require apt or dpkg changes.
        rI�PostInstallScriptsz!PostInstallScript: '%s' not foundzRunning PostInstallScript: '%s'T)�hiddenz(got error from PostInstallScript %s (%s)N)r^r�r�rarqrPrRr�rXr�rYrr[r�r��	Exceptionr��get_lock)rz�scriptr�r*r*r+r�s$

���z+DistUpgradeController.runPostInstallScriptscCsRt�d�t|d�r|j�|j�|j�td��|j�	�|�
�t�d�dS)z2 abort the upgrade, cleanup (as much as possible) zabort calledrr�rN)
rXrY�hasattrr�restore_backuprbr[r\r]r�r�r�r�r�r*r*r+r��s


zDistUpgradeController.abortc	Cs�t�|�D]G}t�d|�|D];}|d}|d}|d}||jvr.t�d|�dS|j|}t|jdd�}|dkrKt�|||�d	krKd	Sqqt�d
|�dS)z+ check if a given depends can be satisfied zchecking: '%s' rr�z_checkDep: '%s' not in cacheFr�NTzdepends '%s' is not satisfied)	rl�
parse_dependsrXrYr^r��getattr�	installed�	check_dep)	rz�depstr�or_group�dep�depname�ver�operrY�instverr*r*r+�	_checkDeps$

��zDistUpgradeController._checkDepcCs�t�d�d}|j�dd�}|�|j�|jjjd��|D]#}t�d|�||�|�M}|s@|j�	t
d�t
d|��t�d�q|S)	z  check if depends are satisfied zcheckViewDepends()Tr��Dependsz
depends: '%s'z!Required depends is not installedz/The required dependency '%s' is not installed. r)
rXrYrarqr(r[rZr.r"r�r]r�r�)rzr��dependsrr*r*r+r�s$
���
�z&DistUpgradeController.checkViewDependscCs�|j�dd�}d}tj�dd�}|j�dd�}||krT|jdd	�|��|D]}||jvr9t�	d
|�t
|��q'|�|�r@nt�d�tj�
dd�|d
7}||ks||kr_t�	d�dStj�
d|�dS)N�PreRequists�PackagesrzAcquire::http::No-CacherHrErFF)ruzCan not find backport '%s'z>setting a cache control header to turn off caching temporarily�truerz+pre-requists item is NOT trusted, giving upT)rarqrl�findrpryr�r^rXr�r-�_allBackportsAuthenticatedrYrd)rz�
backportslistr�noCacher}r-r*r*r+�_verifyBackports(s.
�

�
z&DistUpgradeController._verifyBackportscCs�tj�dd�dkrt�d�dSz|j�dd�}|rWdSWn	ty'Ynw|D]}|j|}|js7dS|jj	D]}|j
rBnq;dSq*dS)NzAPT::Get::AllowUnauthenticatedFTzIskip authentication check because of APT::Get::AllowUnauthenticated==truerI�AllowUnauthenticated)rlra�find_brXr��
getbooleanrr^r
r�trusted)rzr*r�r-r^�candr*r*r+r)Cs,
��
��z0DistUpgradeController._allBackportsAuthenticatedc
Cs�|�d�}t|�\}}}}}d|vr|�d�d}d|||f}|jD]%}|�d�}t||�r2dS|�d�d}	|�|	�rHt�d|�dSq#dS)	z  check if uri is a known mirror r��@rz	%s://%s%sTz//z)found apt-cacher/apt-torrent style uri %sF)�rstriprrrtr�endswithrXrY)
rzr��raw_uri�scheme�netlocrR�query�fragment�mirror�mirror_host_partr*r*r+r!Ys




�zDistUpgradeController.isMirrorcCs4|�d�}|jD]}|�d�}t||�rdSqdS)z/ check if uri is an allowed third-party mirror r�TF)r3rur)rzr�r:r*r*r+r"os



�z(DistUpgradeController.isThirdPartyMirrorcCs�d}tdd�}|jD]B}|js|jrq
|jdkrL|jdkrL|�|j�rLd|jvrLd|j|j	vrL|j�
d�sL|j�
d	�sLd
|j|jf}||vrL||7}q
|S)z7 get sources.list snippet lines for the current mirror rqr2r@r�Fr!r	zhttp://security.ubuntu.comzhttp://archive.ubuntu.comzdeb %s %s-updates main
)rrrrr#r!r�rrgr�r)rz�dumb�linesrr��new_liner*r*r+�_getPreReqMirrorLinesxs(




�

�
��z+DistUpgradeController._getPreReqMirrorLinesc		Cs�t�d|�|�|�}t|d��@}t|��#}|D]}t|�}|j|d�}|�|�t�d|�qWd�n1s<wYWd�dSWd�dS1sTwYdS)z9 add prerequists based on template into the path outfile z*writing prerequists sources.list at: '%s' �w)r:zadding '%s' prerequistsNT)rXrYr?r�r�safe_substitute�write)	rz�template�outr<�mirrorlines�outfile�infiler�outliner*r*r+�_addPreRequistsSourcesList�s

�(���z0DistUpgradeController._addPreRequistsSourcesListc
Cs�t�d�d}tj�t��d�}tj�|�st�|�|j�	dd�}d}|j�
d|d|j�r7|d|j}|j�d|�}tj�|�sMt�
d|�d	Stj�tj�d
�|�}tj�tj�d
�|�}|�||�z|��Wn3ty�|j||dd�z|��WYd	Sty�}zt�d|�WYd
}~Yd	Sd
}~www|D]B}	|j|	}
|jj�|
j�}|s�t�
d|	�t�|�d	S|jd
kr�t�
d|	�t�|�d	St�d|	�|
jd	d	d�q�d	}z|j�|j��|j�|j��}Wn7t�y}zt�
d|�d	}WYd
}~n d
}~wt �y2}zt�
d|�d	}WYd
}~nd
}~ww|d	k�r=t�d�z
t�|�W|�"�St!�yd}zt�
d|�WYd
}~|�"�Sd
}~ww)z5 download the backports specified in DistUpgrade.cfg zgetRequiredBackports()T�	backportsr%r&rz-%szsourceslist not found '%s'FzDir::Etc::sourceparts)r<zno backport for '%s' foundNzNo candidate for '%s'zNo ver.file_list for '%s'zmarking '%s' for install)�	auto_inst�auto_fixzfetch_archives returned '%s'zinstall_archives returned '%s'z,_fetch_archives for backports returned Falsez(failed to unlink pre-requists file: '%s')#rXrYrPrRrSrQr��mkdirrarq�
has_optionrjrr�rlrrIr,r-r�r^r��get_candidate_ver�_pkgr��	file_list�mark_installr�r[r�r�rtr�r�setupRequiredBackports)rzr�r�r*�conf_option�prereq_template�outpathrFr�r-r^rr*r*r+�getRequiredBackports�s�


����	



����

���z*DistUpgradeController.getRequiredBackportscCsxdtjd<t��t�dd�tjdg}|jr|�	d�n|�	d�t�
d�ttjd	�t�tjd	|tj�dS)
Nz$/usr/lib/release-upgrader-python-apt�
PYTHONPATHz/var/log/dist-upgrade/main.logz&/var/log/dist-upgrade/main_pre_req.logz--have-prerequistsz--with-networkz--without-networkzrestarting upgraderr)
rPrkrX�shutdown�shutilr r��argvr`r�r�r�execve)rz�argsr*r*r+rS�s
�

z,DistUpgradeController.setupRequiredBackportsc
Cs�|j�td��|j�tj�|��sEt�d�t	j
�d�r1|j�td�td��t�
ddg�n|j�td�td��t�d	�|��|j�d
�r�|jr�|jjdkr�t�d�|��s�t	j
�d�rv|j�td
�td��t�
ddg�n|j�td
�td��t�d	�|��|��s�|��|jddd�|��|��s�|���z$|j�tj�|j�td��|��s�|��|��s�|��|j�td��|jdd�|j��|_|j��|j� dd�D][}||jvs�|j�!|j|��sAt�d|�||jv�rt�d|�|j�!|j|��st�d|�|j�td�td�|�t	j
�d��r8t�
ddg�nt�d	�|��q�|j�td��|�"��sS|��|�#�|j�tj$�|j�td��|�%��ss|�&�|��|j�tj'�|j�td��|�(��s�|j�td�td ��|��|j�)�d}z|jd!�*�d}Wn t+�y�}zd"t,|�v�r�t�d#�	WYd}~nd}~wwWnt-�y�|��Ynw|�r|j�tj'�|j�td��|�.��s|j�/td$�td%��t0�1d�|jdd�|j��|_|j��|j�td��|�2��s6|�r2|j�/td$�td%��t0�1d�n|��|j�tj'�|j�td��|�.��s^|�3�|j�/td&�td'��t0�1d�|�4�t	j
�d(��rnt	�5d(�|j�tj6�|j�td)��t7��8�t9��s�|�:��r�|j�;�t<d*d+d,d-��
}|�=d.�Wd�n	1�s�wY|j�>�n|j�?��r�t�
d/�t0�1d0�dS)1NzChecking package managerzself.prepare() failedrDzPreparing the upgrade failedzXPreparing the system for the upgrade failed so a bug reporting process is being started.rErFz�Preparing the system for the upgrade failed. To report a bug install apport and then execute 'apport-bug ubuntu-release-upgrader'.rGr%Fzneed backportsz$Getting upgrade prerequisites failedz�The system was unable to get the prerequisites for the upgrade. The upgrade will abort now and restore the original system state.

Additionally, a bug reporting process is being started.z�The system was unable to get the prerequisites for the upgrade. The upgrade will abort now and restore the original system state.

To report a bug install apport and then execute 'apport-bug ubuntu-release-upgrader'.r)rurvzUpdating repository informationT)r�rIr�z@No '%s' available/downloadable after sources.list rewrite+updatez'%s' was not in the cachez'%s' was not downloadablezInvalid package informationa�After updating your package information, the essential package '%s' could not be located. This may be because you have no official mirrors listed in your software sources, or because of excessive load on the mirror you are using. See /etc/apt/sources.list for the current list of configured software sources.
In the case of an overloaded mirror, you may want to try the upgrade again later.r��Fetching�	UpgradingzUpgrade infeasiblezQThe upgrade could not be completed, there were errors during the upgrade process.�libc6�pkgProblemResolverz'Unable to mark libc6 alone for install.zUpgrade incompletezUThe upgrade has partially completed but there were errors during the upgrade process.�Upgrade complete�KThe upgrade has completed but there were errors during the upgrade process.z:/var/lib/ubuntu-release-upgrader/release-upgrade-availablezSystem upgrade is complete.z/run/launcher-commandzw+zutf-8)�encodingzaction: reboot
�/sbin/rebootr)@r[r\r]rr�PREPAREr�rXr�rPrRr�r�r�r�rarvrUr�rYrWr�ryr�r`�MODIFY_SOURCESrQr^r�r�rn�+ensure_recommends_are_installed_on_desktopsrq�anyVersionDownloadabler��_inhibitIdle�FETCHr�r��INSTALLr�r�rRr�re�KeyboardInterruptr�r�r�r�r�rrr��REBOOTrMrr�_inside_WSL�adviseExitOtherWSLr�rB�adviseRestartWSL�confirmRestart)rzr^�libc6_possibler�r�r*r*r+�fullUpgrade
s
��
�
��
	

���
�


�

����
�


�
�




�

z!DistUpgradeController.fullUpgradecCs|j��|��Sr{)r[r�rtr�r*r*r+r��s
zDistUpgradeController.runcCs|j�tj�|j�tj�|j�tj�d|_|��|�	�s"dS|�
�s(dS|j�tj�|j�t
d��|��s=dS|j�tj�|j�t
d��|��s]|j�t
d�t
d��dS|��sn|j�t
d�t
d��dStj�t�r�|j��r~t�d�dS|j�t
d�t
d��dS)	z, partial upgrade mode, useful for repairing TFr^r_rbrcrez"The partial upgrade was completed.)r[rrrf�hideSteprgrnrmr�r`r�rkr\r]r�rlr�r�rrPrRr��REBOOT_REQUIRED_FILErrr�r�r�r*r*r+�doPartialUpgrade�sB��

��z&DistUpgradeController.doPartialUpgradec
Cst�d�zoz+ddl}|��|��|_|j�dd�}|j|dd�}|�dd�t	d�}t	d	�}Wn:t
yk}z.t�d
d�dvrPWYd}~Wt�
t���dSt�d
t|��t	d�}t	d�}WYd}~nd}~wwWt�
t���nt�
t���w|j�||�dS)Nzinhibit screensaverrzorg.freedesktop.ScreenSaverz/org/freedesktop/ScreenSaver)�dbus_interfacer4zUpgrading UbuntuzLock screen disabledzOYour lock screen has been disabled and will remain disabled during the upgrade.�XDG_SESSION_TYPErq)rq�ttyzfailed to inhibit screensaver: zUnable to disable lock screenz�It is highly recommended that the lock screen be disabled during the upgrade to prevent later issues. Please ensure your screen lock is disabled before continuing.)rXrY�dbus�_setNonRootEUID�
SessionBusry�
get_object�	Interface�Inhibitr]rrP�getenv�seteuid�getuidrer[r�)rzr{�proxy�screensaverr��messager�r*r*r+rj#s0

�
���� z"DistUpgradeController._inhibitIdlecCsLt��dkrdSt�d�}|st�d�}|st�d�dSt�t|��dS)Nr�SUDO_UID�
PKEXEC_UIDz"failed to determine user upgrading)rPr�r�rXrYr��int)rz�uidr*r*r+r|Is


z%DistUpgradeController._setNonRootEUIDcCstj�d�S)Nz#/proc/sys/fs/binfmt_misc/WSLInterop)rPrRr�r�r*r*r+roVsz!DistUpgradeController._inside_WSL)NN)TF)T)TN)F)2r.r/r0�__doc__r~r�r�r�r�r�r�r�r�r?rQr_r`ryr�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r"r�r,r)r!r"r?rIrWrSrtr�rwrjr|ror*r*r*r+r1]sf

b#;I
7e
3$/:&
J
fn
	
Xo'&
r1�__main__)�DistUpgradeViewText)�level)Ir�rlr�r�rPr�r�rXrZr�r�r �configparserrrr��	telemetryrrM�utilsrrrr	r
rrr
r�stringr�urllib.parser�DistUpgradeViewr�DistUpgradeCacher�DistUpgradeConfigParserrr�
aptsourcesrr�DistInfo�aptsources.sourceslistrrr.rr�DistUpgradeGettextrr]rrrr�DistUpgradeApportr rvr,rr-r�r1r.r��basicConfig�DEBUG�v�dcr�r�r*r*r*r+�<module>sx,	
�

Spamworldpro Mini