apt-add-repository --remove -S ... also deletes other components
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
software-properties (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
apt-add-repository --remove -S deb http://
wrongly disables *every* component, not just xyzzx.
This happens because the entire existing line is commented out in /etc/apt/
When *adding* a component, and existing line is edited IN to an existing line for that repository; the reverse should probably be done when removing a component if there are other components which should remain enabled.
In other words, commenting out the whole line should be done only if the LINE specified in the remove command specifies all the currently-enabled components.
STEPS TO REPRODUCE:
1. sudo cp /etc/apt /tmp/apt.BAK
2. Remove all references to "multiverse" in /etc/apt/
3. sudo apt-add-repository -y --no-update -S deb http://
4. diff -r /etc/apt.BAK /etc/apt
(Should show 'multiverse' added to an existing line in /etc/apt/
diff -r /tmp/apt.
4,5c4,5
< deb http://
< # deb-src http://
---
> deb http://
> # deb-src http://
5. sudo apt-add-repository --remove -y --no-update -S deb http://
6. diff -r /etc/apt.BAK /etc/apt
(Should show 'multiverse' removed from existing line in /etc/apt/
diff -r /tmp/apt.
4,5c4,5
< deb http://
< # deb-src http://
---
> # deb http://
> # deb-src http://
(7. sudo rm -rf /etc/apt; sudo cp -a /tmp/apt.BAK /etc/apt) # restore
RESULTS: *every* component (including 'main') is disabled
EXPECTED RESULTS: Only the specified component is disabled. In other words, --remove should un-do whatever the effect of an 'add' with the same LINE argument
ProblemType: Bug
DistroRelease: Ubuntu 21.04
Package: software-
ProcVersionSign
Uname: Linux 5.11.0-25-generic x86_64
ApportVersion: 2.20.11-0ubuntu65.1
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: GNOME
Date: Wed Jul 21 18:02:20 2021
InstallationDate: Installed on 2021-07-20 (0 days ago)
InstallationMedia: Ubuntu-Server 21.04 "Hirsute Hippo" - Release amd64 (20210421)
PackageArchitec
SourcePackage: software-properties
UpgradeStatus: No upgrade log present (probably fresh install)