Linux Mint How To Remove Repository

Following is an exercise in removing erroneous repo config that would cause apt update to kick out error messages…

byon@byon:~$ sudo apt update
Hit:1 stable InRelease
Ign:2 ulyana InRelease                                                                                                                                                           
Hit:3 focal-security InRelease                                                                                                                                               
Hit:4 ulyana Release                                                                                                                                       
Ign:5 ulyana InRelease                                                                                                                          
Get:6 focal InRelease [36.2 kB]                              
Hit:7 focal InRelease                                                                              
Hit:8 focal InRelease                                       
Err:10 ulyana Release      
  404  Not Found [IP: 443]
Hit:11 focal-updates InRelease   
Hit:9 kubernetes-xenial InRelease
Hit:12 focal-backports InRelease
Get:14 focal/stable amd64 Packages [7,116 B]
Reading package lists... Done        
E: The repository ' ulyana Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

byon@byon:~$ ls /etc/apt/sources.list.d/
additional-repositories.list  google-chrome.list  kubernetes.list  official-package-repositories.list

byon@byon:~$ cat /etc/apt/sources.list.d/additional-repositories.list 
deb [arch=amd64] ulyana stable
deb [arch=amd64]    focal    stable

byon@byon:~$ vim /etc/apt/sources.list.d/additional-repositories.list 
byon@byon:~$ sudo vim /etc/apt/sources.list.d/additional-repositories.list # the proceed to delete the two entries above

byon@byon:~$ sudo apt update
Ign:2 ulyana InRelease                                                                                                                                                       
Hit:3 ulyana Release                                                                                                                                                         
Get:1 kubernetes-xenial InRelease [9,383 B]                                                                                                    
Hit:4 focal-security InRelease                                                             
Hit:5 focal InRelease                                    
Hit:6 focal InRelease           
Hit:7 stable InRelease
Hit:9 focal-updates InRelease
Hit:10 focal-backports InRelease
Fetched 9,383 B in 2s (5,091 B/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
byon@byon:~$ echo "deb [arch=amd64] $(lsb_release -cs) stable"
deb [arch=amd64] ulyana stable

Often a repo would be installed with a trusted key. Thus, it’s an optional removal process to include the usage of apt-key list to list trusted keys. Then use apt-key del to delete the removed repo’s key.

Posted on Categories Linux

Leave a Reply

Your email address will not be published. Required fields are marked *