403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/uaclient/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/uaclient/__pycache__/apt.cpython-314.pyc
+
GvKj��
���^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RI	H
t
Ht^RIH
t
HtHtHtHtHtHt^RIt^RIHt^RIHtHtHtHtHtHtHt^RIH t ^RI!H"t"Rt#R	t$R
t%Rt&Rt'R
t(Rt)Rt*Rt+Rt,Rt-Rt.Rt/Rt0Rt1Rt2Rt3Rrt4Rt5R]PlPo] R4]PlPo] R4.R]PlPo] R4]PlPo] R4]PlPo] R 4]PlPo] R!4./t8.RsOt9]Pt!4t;]Px!]Pz!]>44t?]P�!R"R#]P�44tB]!R$R%]C3R&]C3R']C3.4tDR(tE]ER)R*l4tFR+tGR,R-ltHRtR.R/lltI]
!RR07RtR1R2ll4tJ!R3R44tKR5tLR6tMR7R8ltNRuR9R:lltORvR;R<lltP]P�!]P�]P�3]94R=R>l4tTRtR?R@lltURARBltVRCRDltWRvRERFlltXRGRHltYRuRIRJlltZRuRKRLllt[RMt\RNt]RvRORPllt^RQt_RRt`RStaRTtbRURVltcRWRXltdRYRZlteRR]BP�3R[R\lltgR]R^lthR_R`ltiRaRbltjRctkRdReltlRfRgltmRhRiltnRjRkltoRltpRmtqRnRoltrRpRqltsR#)w�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/statusz�# Written by ubuntu-pro-client
Types: deb{deb_src}
URIs: {url}
Suites: {suites}
Components: main
Signed-By: {keyrings_dir}/{keyring_file}
�fileszetc/apt/sources.listzvar/lib/dpkg/status�folderszetc/apt/apt.conf.dzetc/apt/preferences.dzvar/cache/apt/archives/partialzvar/lib/apt/lists/partialc�2�]tRt^ct]!4t]!4tRtR#)�
AptProxyScope�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�0a�\S4V3Rl4pV#)z*Decorator ensuring apt_pkg is initialized.c�<�\PPR4R8Xd\P!4S!V/VB#)�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)r3r4sf r$�ensure_apt_pkg_initr6ns"����1�X�"��"��Lr#c�0�V^8�dQhR\R\/#)��a�b��str)�formats"r$�__annotate__r>}s��)�)�s�)�s�)r#c�.�\P!W4#�N)r-�version_compare)r9r:s&&r$rArA|s���"�"�1�(�(r#c��\PPR4'gR#VPR4wr4\	4pVR,pVPR4'gVR,pMTpRP
VVVR7p\P!WhRR	7\P!4;_uu_4p	\P!RR
RP
W44\PPV	R4.\\R
7RRR4\P>!T4R# +'giL(;i \P d�p
\"P%R\'T
44T
P(^d8Xd�\'T
P*4P-4p\.P0!RT4'd\P2!TR7h\.P0!RT4'd\P4!TR7h\P6!\'T
4R7hRp
?
i\8P:d\P<!\TR7hi;i \P>!T4i;i)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-helperN�://z-validation�/z9machine {repo_path} login {username} password {password}
)�	repo_path�username�password���modez
download-filez
{}://{}/pool/zapt-helper-output)�timeout�retry_sleepszError running apt-helper: %sz401\s+unauthorized|httperror401)�repozconnection timed out��detail)�secondsrM) �os�path�exists�split�!get_apt_auth_file_from_apt_config�endswithr=r�
write_file�tempfile�TemporaryDirectory�subp�join�APT_HELPER_TIMEOUT�APT_RETRIESr�ProcessExecutionError�LOG�errorr<�	exit_code�stderr�lower�re�search�APTInvalidCredentials�
APTTimeout�APTUnexpectedError�
subprocess�TimeoutExpired�APTCommandTimeout�ensure_file_absent)�repo_urlrFrG�protocolrE�
apt_auth_file�	auth_path�repo_path_slash�	auth_line�tmpd�erbs&&&         r$�assert_valid_apt_credentialsru�s����7�7�>�>�3�4�4��"�.�.��/��H�5�7�M��
�-�I����c�"�"�#�c�/��#��	!�!'��%���"(�"
��-����)�U�;�
�
(�
(�
*�
*�d��K�K�-�#�#�*�*�8�?��G�G�L�L��':�;�	�+�(�	
�+�2	�!�!�)�,�3+�
*���+�+�;��	�	�0�#�a�&�9��;�;�#������]�(�(�*�F��y�y�;�V�D�D� �6�6�H�E�E����2�F�;�;� �+�+��:�:��+�+�3�q�6�:�:���$�$�
��*�*�&�Y�
�	
�
��
	�!�!�)�,�sV�5E�;AD.�E�.D>	�9E�=I)�>E�I&�B#H1�:7H1�1I&�I&�&I)�)Jc�F�V^8�dQhR\R\\,/#)r8�	apt_error�return)r<r
)r=s"r$r>r>�s ��#�#��#���X�#r#c�F�\4pVP4PR4FspV'gK
\P!RV4pV'gK.RVP4R,PR4^,,pVP
V4Ku	V#)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/dists)�set�striprTrdre�	groupdict�add)rw�failed_repos�line�
pattern_match�repo_url_matchs&    r$�(_parse_apt_update_for_invalid_apt_configr��s���(�5�L����!�'�'��-���4��I�I�E�t��M��}��=�2�2�4�U�;�A�A�(�K�A�N�N��� � ��0�.��r#c	��V^8�dQhR\\,R\\,R\\\\3,,R\/#)r8�cmd�	error_msg�override_env_varsrx�rr<r	r)r=s"r$r>r>�sE��(�(�	
�c��(���}�(� ��S�#�X��/�(�	�	(r#c�$�\P!VR\VR7wr4V# \Pd�p\
P
R\T4\T44R\TP49d\P!4h\TP4pT'd0\P!RP\T44R7hT'dTM
\T4p\P!TR7hRp?ii;i)	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)�capturerLr�z Error running apt command %s: %sz%Could not get lock /var/lib/dpkg/lockrz)r�rNN)rrZr]rr^r_r`r<rb�APTProcessConflictErrorr��APTInvalidRepoErrorr[�sortedrh)r�r�r��out�_errrtr��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�B,D
�&$D
�
D)�maxsizec��V^8�dQhR\\,R\\\\3,,R\/#)r8r�r�rx)r	r<r)r=s"r$r>r>s7������}����S�#�X��/��	�r#c�"�\RR.VVR7#)�	apt-cache�policy)r�r�r�)r�)r�r�s&&r$�get_apt_cache_policyr�s��
�
�(�#��+��r#c�2a�]tRtRtoRtRtRtRtVtR#)�PreserveAptCfgic� �Wn/VnR#r@��apt_func�current_apt_cfg)�selfr�s&&r$�__init__�PreserveAptCfg.__init__s�� �
�!��r#c	���\PpVP4Uu/uF(q"\P!VPV44bK*	upVnVP4#uupir@)r-r.�keys�copy�deepcopyr/r�r�)r��cfg�keys&  r$�	__enter__�PreserveAptCfg.__enter__sT���n�n��8;���
� 
�8B�����s�w�w�s�|�,�,�
� 
����}�}����	 
s�.A)c���\PpVPP4F%pVP	WPPV,4K'	\P
!4R#r@)r-r.r�r�r|�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)	rrrrr�r�r�r"�__classdictcell__��
__classdict__s@r$r�r�s����"���r#r�c���\PP4F"p\PPV4K$	\P!4\P
!R4#r@)r-r.r��clearr0�Cache�r�s r$�get_apt_pkg_cacher�.sC���~�~�"�"�$�������S�!�%��L�L�N��=�=���r#c��\4\PP4FAp\P
!RV4'dK"\PP
V4KC	\PPR\4\P!4\P!R4# \d/u#i;i)z^Acquirer+N)�_ensure_esm_cache_structurer-r.r�rdrer�r|rr0r��	Exceptionr�s r$�get_esm_apt_pkg_cacher�5s����	$�%��>�>�&�&�(�C��9�9�Z��-�-����$�$�S�)�)�	�����5�/�2������}�}�T�"�"�����	��s�AB>�A1B>�>
C�
Cc�F�V^8�dQhR\R\\,/#)r8�pkg_namerx)r<r	)r=s"r$r>r>Ms��
�
�c�
�h�s�m�
r#c��\\4;_uu_4pW,pRRR4XP'dTPP#R# \d
RRR4R#i;i +'giLT;ir@)r�r��KeyError�current_ver�ver_str)r��cache�packages&  r$�get_pkg_versionr�Msi��	�)�	*�	*�e�	��o�G�
+������"�"�*�*�*���
�	��	
+�	*�	��
+�	*�s(�A/�A�A,� A/�+A,�,A/�/A?	c�R�V^8�dQhR\R\R\\,/#)r8r��check_esm_cacherx)r<�boolr	)r=s"r$r>r>Zs(��)�)��)�$(�)�
�c�]�)r#c���\\4;_uu_4pW ,p\P!T4pTPT4pT'gRRR4R#TPpRRR4T'gX#\\4;_uu_4pT'dyYp,p\P!T4p	T	PT4p
T
'g
XuuRRR4#T
Pp\P!TX4^8�d
TuuRRR4#RRR4X# \d
RRR4R#i;i +'giL�;i \dXuuuRRR4#i;i +'giX#;ir@)	r�r�r�r-�DepCache�get_candidate_verr�r�rA)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�ZsU��
�)�	*�	*�e�	��o�G��$�$�U�+�	��/�/��8�	���
+�	*�&�-�-��
+�� � �	�-�	.�	.�)��
)�'�1��$�,�,�Y�7�M�)�;�;�K�H�M� �(�
/�	.�%2�$9�$9�!��'�'�)�+<����
-�)
/�	.�	.�,���G�	��	
+�	*�	��
+�	*��(�
)�(�(�
/�	.�
)��	
/�	.�,��su�D6�D�.D6�D6�D6�	E&�E	�#.E&�E&�)E&�D3�'D6�2D3�3D6�6E	�	
E#�E&�"E#�#E&�&E7	c�h�V^8�dQhR\\\\3,,R\/#)r8r�rx)r	rr<)r=s"r$r>r>�s)������S�#�X��/���r#c��\RR.VR7p\P4T# \Pd:p\P	R\T44\P!4hRp?i\Pd'p\P!TPR7hRp?i\Pd'p\P!TPR7hRp?ii;i \P4i;i)�apt-get�update�r�r�z Error running apt-get update: %sN��repo_msgrN)r�rr�r_r`r<�APTUpdateProcessConflictErrorr��APTUpdateInvalidRepoErrorr��UbuntuProError�APTUpdateFailedr��cache_clear)r�r�rts&  r$�run_apt_update_commandr��s���+���H�%�9J�
��	�(�(�*��J���-�-�9��	�	�4�c�!�f�=��6�6�8�8���)�)�C��2�2�A�E�E�B�B���$�$�7��(�(����6�6��7��	�(�(�*�sD�(�C(�4A1�1C(�C(�	!B*�*C(�C(�!C#�#C(�(C+�+Dc�$�V^8�dQhR\/#)r8�sources_list_pathr;)r=s"r$r>r>�s��#/�#/�3�#/r#c	�:�\\4;_uu_4p\PP	R\
PPV44\PP	RR4\PP	RR4\P!4pVP4\4p\
PP\PPR4R4p\P!V4pV;_uu_4VPW2^4RRR4\.P14RRR4R# +'giL/;i \\RR4d:p\ P#R	\%T44\&P(!4hRp?i\*d&p\&P,!\%T4R
7hRp?ii;i \.P14i;i +'giR#;i)zDir::Etc::sourcelistzDir::Etc::sourcepartszN.O.F.O.L.D.E.RzAPT::List-Cleanup�0zDir::State::Lists�lockN�ErrorzError updating apt cache: %srNr)r�r�r-r.r|rQrR�abspath�
SourceList�read_main_listrr[�find_dir�FileLockr��getattrr_r`r<rr��SystemErrorr�r�r�)r�r��sources_list�fetch_progress�	lock_filer�rts&      r$�update_sources_listr��su��

�)�	*�	*�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
+�	*�	*�sr�DH	�
E0�#E	�6E0�>H	�E-
�(E0�,G0�-E0�0G-�4F:�:G-�G-� G(�(G-�-G0�0H�H	�	H	c	���V^8�dQhR\\,R\\\,,R\\\\3,,R\/#)r8�packages�apt_optionsr�rxr�)r=s"r$r>r>�sJ�����3�i���$�s�)�$�� ��S�#�X��/��	�	r#c�H�Vf.p\.ROV,V,VR7pV# \Pd-\P	RT4\P
!4h\Pd'p\P!TPR7hRp?ii;i)Nr�z)Error running apt install for packages %sr�)r��install�--assume-yes)	r�rr�r_r`�APTInstallProcessConflictErrorr��APTInstallInvalidRepoErrorr�)r�r�r�r�rts&&&  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�B!c�Z�V^8�dQhR\R\\P,/#�r8�originrx)r<rr-�Package)r=s"r$r>r>�s#����S��T�'�/�/�5J�r#c�V�\4p\\4;_uu_4pVPFRpVPpV'gKVP
F)wrVVPV8XgKVPV4K+	KT	RRR4\V4# +'giL;ir@)	r|r�r�r�r��	file_listr�r�list)r��resultr�r��installed_version�file�_s&      r$� get_installed_packages_by_originr�s}���U�F�	�)�	*�	*�e��~�~�G� '� 3� 3�� � �0�:�:�G�D��{�{�f�,��
�
�7�+� ;�&�
+���<��
+�	*�s�!B�B�,B�B(	c�p�V^8�dQhR\\,R\\P,/#r�)r	r<rr-r�)r=s"r$r>r>�s)�����S�M��	�'�/�/��r#c���Vf.#\4p\\4;_uu_4p\P!V4pVP
FupVPpV'gKVPV4pV'gK4We8wgK<VPF)wrxVPV8XgKVPV4K+	Kw	RRR4\V4# +'giL;ir@)r|r�r�r-r�r�r�r�rr�rr)	r�rr�r�r�rr�rrs	&        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�?C�C�+C�C'	c��V^8�dQhR\PR\\,R\\P
,/#)r8r��exclude_originrx)r-r�r	r<r�Version)r=s"r$r>r>s5����
�_�_��.6�s�m��	�'�/�/��r#c��.pVPFcpVPUUu.uF-wrEVPR8wgKVPV8wgK+VNK/	pppV'gKRVP	V4Ke	V#uuppi)�now)�version_listr�	componentr��append)r�r�valid_versionsr'rr�
valid_originss&&     r$�get_remote_versions_for_packagers����N��'�'��#�,�,�
�,����~�~��&�
�
,0�;�;�.�+H�
�D�,�	�
��=��!�!�'�*�(����
s�A8�A8�A8c
�j�V^8�dQhR\\,R\R\R\R\/#)r8�suites�series�updates_enabledrmrx�rr<r�)r=s"r$r>r>s8������I��"��59��EH���r#c��RpVFOpW9dKRpRV9d"V'g\PRVV4RpVRPWcVR7,
pKQ	V#)r,�-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_commentr{�suite)r_�warningr=)rrrrm�contentrrs&&&&   r$�_get_list_file_contentr!ss���G�������
������K�K����	
�!�M��
-�-3�V�+��.4�.�	
���&�Nr#c��V^8�dQhR\\,R\R\R\R\R\R\/#)r8rrrrm�keyring_file�include_deb_srcrxr)r=s"r$r>r>2sR������I�������	�
���
�	�r#c�.�VUu.uF
qaV9gKVNK	ppV'g1\PRV4VUu.uFpRV9gKVNK	ppV'dRMRp\PVRP	V4\
VVR7p	V	#uupiuupi)zPNot enabling service-related -updates suites because "%s-updates" is not enabledrz deb-srcr,� )r{r�keyrings_dirr#�deb_src)r_r�DEB822_REPO_FILE_CONTENTr=r[�KEYRINGS_DIR)
rrrrmr#r$r�appliable_suitesr(r s
&&&&&&    r$�_get_sources_file_contentr,2s���,2�E�6�%�u�_���6��E�����
+��	
� 0�
�/�e�:�U�3J�E�E�/�	�
�,�j��G�&�-�-���x�x�(�)�!�!��.��G��N��+F��
s�B
�B
�	B�
Bc��V^8�dQhR\R\R\R\\,R\R\\,R\\,RR	/#)
r8�
repo_filenamerm�credentialsrr#�
snapshot_urls�check_updates_pocketrxN)r<rr	r�)r=s"r$r>r>Rsd��>.�>.��>.��>.��>.�
��I�	>.�
�>.���9�
>.�#�4�.�>.�
�>.r#c�X�VPR4wrx\PP	V4\
P!4Pp	VPR4'dVRRp\WV4Rp
V'dYRp
\RR.\P4pVP4F&pR	PV	4V9dKR
V9dK$Rp
M	V.V,Fp
\W�V4K	V	\ 9dl\"P$P'\(V4p\"P$P'\*V4p\,P.!W�4\1W9W�4pM
\3W9W�V4p\
P4!VV4R# \d	RpTpEL�i;i)z�Add an authenticated apt repo and credentials to the system.

@raises: InvalidAPTCredentialsError when the token provided can't access
    the repo PPA.
�:�bearerrDNTFr�r�za={}-updatesz	o=Ubuntu,���)rT�
ValueErrorr�secrets�
add_secretr�get_release_inforrVrur�r�APT_POLICY_FAILED�
splitlinesr=�add_apt_auth_conf_entry�SERIES_NOT_USING_DEB822rQrRr[r*�APT_KEYS_DIRr�export_gpg_keyr!r,rW)r.rmr/rr#r0r1rFrGrrr�r�r{�source_keyring_file�destination_keyring_filer s&&&&&&&          r$�add_auth_apt_reporBRs����(�.�.�s�3������%�%�h�/�
�
$�
$�
&�
-�
-�F��������C�R�=�� ��X�>��O���� �
�(�#�X�%?�%?�
���%�%�'�D��$�$�V�,�D�8���$�&��"�O��(��z�M�)�)����x�8�*��(�(� �g�g�l�l�<��F��#%�7�7�<�<��l�#K� ����.�I�(��O�
��,��O�|�
�����m�W�-��]�������s�F�F)�(F)c��\4pRV9dVPR4wrEMTpVPR4'g
VR,
p\PPV4'd\P!V4pMRpRPVVV\R7pRp.p	VP4Fyp
V'g^V
P4p\V4^8�d>V^,pW�8XdV	PV4RpKOW�9dV	PV4RpV	PV
4K{	V'gV	PV4V	PR4\P!VRPV	4R	R
7R#)zBAdd or replace an apt auth line in apt's auth.conf file or conf.d.rCrDr,z:machine {repo_path} login {login} password {password}{cmt})rE�loginrG�cmtFTrzrHrIN)rUrTrVrQrRrSr�	load_filer=�APT_AUTH_COMMENTr;�lenrrWr[)
rmrDrGro�	_protocolrE�orig_content�repo_auth_line�added_new_auth�	new_linesr��
split_line�curr_line_repos
&&&          r$r<r<�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��RV9dVPR4wrMTpVPR4'dVRR	p\4p\PPV4'd�\P!V4pRPVR7pRPVP4Uu.uF
qeV9gKVNK	up4pV'g\P!V4R#\P!W7RR7R#R#uupi)
z+Remove a repo from the shared apt auth filerCrDNzmachine {repo_path}/ login)rErzrHrIr5)
rTrVrUrQrRrSrrFr=r[r;rlrW)rmrIrEro�apt_auth�auth_prefixr�r s&       r$�remove_repo_from_apt_auth_filerS�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�T�3�O�
����%�%�m�4����m�5�A�%��
Ps�.D�;Dc
�x�V^8�dQhR\R\R\\,R\\,RR/#)r8r.rmr0r#rxN)r<rr	)r=s"r$r>r>�sB��,�,��,��,���9�,��3�-�	,�

�,r#c�r�\P!V4VPR4'd,\P!\P!VR44V'd;\
PP\V4p\P!V4V.V,Fp\V4K	R#)z>Remove an authenticated apt repo and credentials to the systemz.sourcesrN)
rrlrVr�set_filename_extensionrQrRr[r>rS)r.rmr0r#r{s&&&& r$�remove_auth_apt_reporW�s������m�,����j�)�)��!�!��'�'�
�v�>�	
���w�w�|�|�L�,�?���!�!�,�/��z�M�)�)��&�s�+�*r#c��VPR4wrEVPR4'dVRRpRPW#R7p\P!W4R#)z.Add an apt preferences file and pin for a PPA.rCrDNz<Package: *
Pin: release o={origin}
Pin-Priority: {priority}
)r��priorityr5)rTrVr=rrW)�apt_preference_filermr�rYrIrEr s&&&&   r$�add_ppa_pinningr[�sV��#�>�>�%�0��I����#����c�r�N�	�	%�%+�V�6�V�%M��
���)�3r#c��\P!RRR\.4wrV'd VPR4^,R,#\P!RRR\.4wrVPR4^,PR4#)z7Return to patch to the system configured APT auth file.�
apt-config�shellr��'z90ubuntu-advantagerD)rrZ�APT_CONFIG_AUTH_PARTS_DIRrT�APT_CONFIG_AUTH_FILE�rstrip)r�r�s  r$rUrU�sz�����	�w��'@�A��I�C���y�y��~�a� �#7�7�7��K�K�
�7�E�+?�@�
�	���y�y��~�a� �'�'��,�,r#c��VPR4wr#VPR4'dVRRpRp\P!RRR\.4wrVV'dVPR4^,pVPRR	4p\
\P!\PPWGR
PV4,444#)zEList any apt files in APT_CONFIG_LISTS_DIR given repo_url and series.rCrDNz/var/lib/apt/listsr]r^r�r_rz
_dists_{}*r5)rTrVrrZ�APT_CONFIG_LISTS_DIR�replacer��globrQrRr[r=)rmrrIrE�	lists_dirr�r��aptlist_filenames&&      r$�find_apt_list_filesris���#�>�>�%�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�V�\W4Fp\P!V4K	R#)z?Remove any apt list files present for this repo_url and series.N)rirrl)rmrrRs&& r$�remove_apt_list_filesrks��#�H�5���!�!�$�'�6r#c�0�V^8�dQhR\R\/#)r8�pkgrx)r<r�)r=s"r$r>r>#s��1�1�c�1�d�1r#c��V\49#r@)�get_installed_packages_names)rms&r$�is_installedrp#s���.�0�0�0r#c�:�V^8�dQhR\\,/#�r8rx)rr%)r=s"r$r>r>'s��
�
��%8� 9�
r#c�:�.p\\4;_uu_4pVPFTpVPpV'gKVP	\VPVPVPR74KV	RRR4V# +'giT#;i))r&r'r(N)	r�r�r�r�rr%r&r�r()�	installedr�r�rs    r$�get_installed_packagesru's����I�	�)�	*�	*�e��~�~�G� '� 3� 3�� � �� � �'�$�\�\� 1� 9� 9�.�3�3���&�
+���
+�	*���s�!B	�?B	�	B	c�:�V^8�dQhR\\,/#rr�rr<)r=s"r$r>r>7s����d�3�i�r#c�X�\4pVUu.uFqPNK	ppV#uupir@)rur&)�package_listrm�	pkg_namess   r$roro7s+��)�+�L�%1�2�\�c���\�I�2����3s�'c��V^8�dQhR\\,R\\,R\\,RR/#)r8�
http_proxy�https_proxy�proxy_scoperxN)r	r<r)r=s"r$r>r>=sC��5A�5A���
�5A��#��5A��-�(�5A�
�	5Ar#c�Z�V'g	V'dmV'deRpV\P8XdRpMV\P8XdRp\P	\
PPVR74RpV'dfV\P8XdV\PVR7,
pM2V\P8XdV\PVR7,
pV'dfV\P8XdV\PVR7,
pM2V\P8XdV\PVR7,
pVR8wd\V,pVR8Xd\P!\4R#\P !\V4R#)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
r,z	UA-scoped�global)�scope)�	proxy_urlN)rr!r �event�infor�SETTING_SERVICE_PROXY_SCOPEr=�APT_CONFIG_UA_PROXY_HTTP�APT_CONFIG_GLOBAL_PROXY_HTTP�APT_CONFIG_UA_PROXY_HTTPS�APT_CONFIG_GLOBAL_PROXY_HTTPS�APT_PROXY_CONFIG_HEADERrrl�APT_PROXY_CONF_FILErW)r|r}r~�message�apt_proxy_configs&&&  r$�setup_apt_proxyr�=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�:�V^8�dQhR\\,/#rr�r	�float)r=s"r$r>r>us����H�U�O�r#c��Rp\PP\4'd%\P!\4P
pV#r@)rQrRrS�APT_UPDATE_SUCCESS_STAMP_PATH�stat�st_mtime��
cache_times r$�get_apt_cache_timer�us6���J�	�w�w�~�~�3�4�4��W�W�:�;�D�D�
��r#c�:�V^8�dQhR\\,/#rrr�)r=s"r$r>r>|s����h�u�o�r#c��Rp\PP\4'd%\P!\4P
pV#r@)rQrRrS�DPKG_STATUS_PATHr�r�)�status_times r$�get_dpkg_status_timer�|s6���K�	�w�w�~�~�&�'�'��g�g�.�/�8�8���r#c�N�V^8�dQhR\\P,/#rr)r	�datetime)r=s"r$r>r>�s!��N�N���):�):� ;�Nr#c��\4pVfR#\PPV\PP4#r@)r�r��
fromtimestamp�timezone�utcr�s r$�get_apt_cache_datetimer��s8��#�%�J�������*�*�:�x�7H�7H�7L�7L�M�Mr#c� a�\P!\PP\R4RR7o\
R,\
R,,p\;QJdV3RlV4F'dKRM	RM!V3RlV44'dR#\P!\4\
R,Fp\P!V4K	\
R,Fp\P!VRRR	7K	R#)
z**/*T)�	recursiverrc3�,<"�TF	qS9x�K	R#5ir@r)�.0r�existing_filess& �r$�	<genexpr>�._ensure_esm_cache_structure.<locals>.<genexpr>�s����=�}�t�N�"�}�s�FNi�)�exist_okrJ)rfrQrRr[r�ESM_BASIC_FILE_STRUCTURE�allr�ensure_folder_absent�create_file�makedirs)�
desired_filesr�folderr�s   @r$r�r��s�����Y�Y�
�����_�f�-���N�	!��)�,D�Y�,O�O���s�=�}�=�s�s�s�=�}�=�>�>������0�)��1�1�����4� �2�*�9�5�5��
���F�T��6�6r#c��V^8�dQhRR/#)r8rxNr)r=s"r$r>r>�s��BP�BP�d�BPr#c
���\P!4'gR#\4^RIHp^RIHp^RIHpH	pRpRp\P!4pVfV!V4^,pVPR.4F]pVPRR4R8XdVPR	R
4R8HpVPRR4R8XgKHVPR	R
4R8HpK_	V!V4p	V'd8V	P4^,VP8XdV	P4MV	P!4\P"!4'dXV!V4p
V'd8V
P4^,VP8XdV
P4MV
P!4\%\&4;_uu_4p\(P*!4pVP-4!R
R\.4p
V
!4pVP1W�^4RRR4R# \2d8p\4P7RP9\;T444Rp?LGRp?ii;i +'giR#;i)N)�status)�ApplicationStatus)�ESMAppsEntitlement�ESMInfraEntitlementF�servicesr&r,zesm-apps�	available�no�yesz	esm-infrac�Da�]tRtRtoV3RlRltV3RlRltRtVtR#)�-update_esm_caches.<locals>.EsmAcquireProgressi�c�4<�V^8�dQhRS[P/#�r8�item�r-�AcquireItemDesc)r=r�s"�r$r>�:update_esm_caches.<locals>.EsmAcquireProgress.__annotate__�s���
M�
M��!8�!8�
Mr#c�b�\PRPVP44R#)zFetched ESM Apt Cache item: {}N)r_�debugr=�uri�r�r�s&&r$�done�2update_esm_caches.<locals>.EsmAcquireProgress.done�s���	�	�:�A�A�$�(�(�K�Lr#c�4<�V^8�dQhRS[P/#r�r�)r=r�s"�r$r>r��s���
�
��!8�!8�
r#c�b�\PRPVP44R#)z&Failed to fetch ESM Apt Cache item: {}N)r_rr=r�r�s&&r$�fail�2update_esm_caches.<locals>.EsmAcquireProgress.fail�s �����<�C�C�D�H�H�M�r#rN)rrrrr�r�r"r�r�s@r$�EsmAcquireProgressr��s����
M�
M�
�
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�readr/�application_status�DISABLED�setup_local_esm_repo�disable_local_esm_repo�is_current_series_active_esmr�r�r-r�r�rr�r�r_rr=r<)r�r�r�r�r��apps_available�infra_available�current_status�service�apps�infrar�r�r�r�rts&               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�;<I�8H�I�-I�I�I�I�I*	c�F�V^8�dQhR\\,R\/#�r8�
package_names�
error_messagerw)r=s"r$r>r>�s����4��9��S�r#c�J�\.RO\V4,VRR/R7R#)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.
�DEBIAN_FRONTEND�noninteractive�r�N)r��remover��$-o Dpkg::Options::="--force-confdef"�$-o Dpkg::Options::="--force-confold"�r�r�r�r�s&&r$�remove_packagesr���.���	
��}�
�	�	�,�.>�?�r#c�F�V^8�dQhR\\,R\/#r�rw)r=s"r$r>r>�s����$�s�)��C�r#c�J�\.RO\V4,VRR/R7R#)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�r�r�N)r��purger�r�r�r�r�s&&r$�purge_packagesr��r�r#c�:�V^8�dQhR\\,/#)r8r�rw)r=s"r$r>r>s����d�3�i�r#c�*�\V.RORR/R7R#)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.
r�r�)r�r�N)z--allow-downgradesr�r�)r�)r�s&r$�reinstall_packagesr�s����
�
-�.>�?�r#c���\PP4F"p\PPV4K$	\P!4\P#r@)r-r.r�r��init_configr�s r$�_get_apt_configr�-sE���~�~�"�"�$�������S�!�%������>�>�r#c��\\4;_uu_4pVPV4pRRR4V# +'giX#;ir@)r�r�r)�base_key�apt_cfg�apt_cfg_keyss&  r$�get_apt_config_keysr�7s;��	��	(�	(�G��|�|�H�-��
)���
)�	(���s	�4�A	c	��V^8�dQhR\\,R\\\\\\,3,3,/#)r8�	cfg_namesrx)rr<rrr)r=s"r$r>r>>s7������}��	�#�u�S�$�s�)�^�$�
$�%�r#c��/p\\4;_uu_4pVFDpVPV4p\V4'gVP	V4;'gRpWAV&KF	RRR4V# +'giT#;i)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�r/r<�
value_list)r�apt_cfg_dictr��cfg_name�	cfg_values&    r$�get_apt_config_valuesr>su���L�	��	(�	(�G�!�H����H�-�I��y�>�>�#�.�.�x�8�@�@�D�	�%.��"�
"�
)���
)�	(���s�?A/�A/�/B	c�$�V^8�dQhR\/#rrr;)r=s"r$r>r>Ts�����r#c�\�RpRp\PPV4'dV#T#)z/etc/apt/sources.listz&/etc/apt/sources.list.d/ubuntu.sources)rQrRrS)�old_sources_path�new_sources_paths  r$�get_system_sources_filerTs8��.��?���7�7�>�>�*�+�+�	���r#)�xenial�bionic�focal�jammy)g�?g@g$@)NN)Fr@)tr�r��enumrf�loggingrQrdrirX�	functoolsrr�typingrrrrr	r
rr-�apt.progress.baser�uaclientr
rrrrrr�uaclient.defaultsr�uaclient.files.state_filesrr\rGrar`rdr�r�r�r�r�r>r*�APT_METHOD_HTTPS_FILE�CA_CERTIFICATES_FILEr�r�r�r=r)rRr[r�r]�get_event_loggerr��	getLogger�replace_top_level_logger_namerr_�unique�Enumrr<r%r6rArur�r�r�r�r�r�r�r�r��retryr�r�r�r�rr
rr!r,rBr<rSrWr[rUrirkrpruror r�r�r�r�r�r�r�r�r�r�r�rr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���
��)��)�6-�r#�L(�V�4�������.��0
�)�X�.����'�'��)C�)C�D���#/�	�#/�L�0��.�&�4�@>.�B,G�^B�*,�*
4�-��,(�1�
� �!%�!%�+8�+?�+?�5A�p��N�7�*BP�J�0�0�2���,r#

Youez - 2016 - github.com/yon3zu
LinuXploit