Skip to content

Use apt-shim from elementary - #872

Merged
jumpyvi merged 4 commits into
mainfrom
remove-apt
Sep 26, 2026
Merged

jumpyvi merged 4 commits into
mainfrom
remove-apt

Conversation

@jumpyvi

@jumpyvi jumpyvi commented Sep 23, 2026

Copy link
Copy Markdown
Member

fix #852

@jumpyvi

jumpyvi commented Sep 23, 2026

Copy link
Copy Markdown
Member Author

@ryonakano I don't have much time to test rn, but I started a build if you want to check it out

https://github.com/elementary/os/actions/runs/35802534671

@jumpyvi

jumpyvi commented Sep 23, 2026

Copy link
Copy Markdown
Member Author

If someone can confirm it works, it can be merged

@ryonakano

Copy link
Copy Markdown
Member

I'll test this

@ryonakano

Copy link
Copy Markdown
Member

Hmm I confirmed the sysupdate installation of elementaryos-9.0-daily-x86-64.20260923003501.iso surely includes the apt-shim command but the update-alternatives is not set, which results the apt command can be used.

@ryonakano

Copy link
Copy Markdown
Member

update-alternatives surely sets up it though 🤔

2026-09-23T00:48:46.8034801Z ‣ + apt-get -o APT::Architecture=amd64 -o APT::Architectures=amd64 -o APT::Install-Recommends=false -o APT::Immediate-Configure=off -o APT::Get::Assume-Yes=true -o APT::Get::AutomaticRemove=true -o APT::Get::Allow-Change-Held-Packages=true -o APT::Get::Allow-Remove-Essential=true -o APT::Sandbox::User=root -o Ac
quire::AllowReleaseInfoChange=true -o Acquire::Check-Valid-Until=false -o Dir::Cache=/var/cache/apt -o Dir::State=/buildroot/var/lib/apt -o Dir::State::lists=/var/lib/apt/lists/ -o Dir::Log=/var/log/apt -o Dir::State::Status=/buildroot/var/lib/dpkg/status -o Dir::Bin::DPkg=/usr/bin/dpkg -o Debug::NoLocking=true -o DPkg::Options::=--root=/bu
ildroot -o DPkg::Options::=--force-unsafe-io -o DPkg::Options::=--force-architecture -o DPkg::Options::=--force-depends -o DPkg::Options::=--no-debsig -o DPkg::Use-Pty=false -o DPkg::Install::Recursive::Minimum=1000 -o pkgCacheGen::ForceEssential=, install io.elementary.apt-shim
2026-09-23T00:48:46.9863385Z Reading package lists...
2026-09-23T00:48:47.2021802Z Building dependency tree...
2026-09-23T00:48:47.2032817Z Reading state information...
2026-09-23T00:48:47.3266948Z Solving dependencies...
2026-09-23T00:48:47.4848198Z The following NEW packages will be installed:
2026-09-23T00:48:47.4858661Z   io.elementary.apt-shim
2026-09-23T00:48:47.8771277Z 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
2026-09-23T00:48:47.8772779Z Need to get 5524 B of archives.
2026-09-23T00:48:47.8774156Z After this operation, 32.8 kB of additional disk space will be used.
2026-09-23T00:48:47.8775506Z Get:1 https://ppa.launchpadcontent.net/elementary-os/daily/ubuntu resolute/main amd64 io.elementary.apt-shim amd64 9.0.0+r7+pkg1~daily~ubuntu9.1 [5524 B]
2026-09-23T00:48:48.0824205Z Fetched 5524 B in 0s (14.6 kB/s)
2026-09-23T00:48:48.1144861Z Selecting previously unselected package io.elementary.apt-shim.
2026-09-23T00:48:48.1658700Z (Reading database ... 115885 files and directories currently installed.)
2026-09-23T00:48:48.1687621Z Preparing to unpack .../io.elementary.apt-shim_9.0.0+r7+pkg1~daily~ubuntu9.1_amd64.deb ...
2026-09-23T00:48:48.1688717Z Unpacking io.elementary.apt-shim (9.0.0+r7+pkg1~daily~ubuntu9.1) ...
2026-09-23T00:48:48.2076383Z Setting up io.elementary.apt-shim (9.0.0+r7+pkg1~daily~ubuntu9.1) ...
2026-09-23T00:48:48.2109971Z update-alternatives: using /usr/bin/apt to provide /usr/sbin/apt (apt) in auto mode
2026-09-23T00:48:48.2127414Z update-alternatives: using /usr/bin/io.elementary.apt-shim to provide /usr/sbin/apt (apt) in auto mode
2026-09-23T00:48:48.2146162Z update-alternatives: using /usr/bin/apt-get to provide /usr/sbin/apt-get (apt-get) in auto mode
2026-09-23T00:48:48.2163061Z update-alternatives: using /usr/bin/io.elementary.apt-shim to provide /usr/sbin/apt-get (apt-get) in auto mode

@ryonakano

ryonakano commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

The symlink at /etc/alternatives/apt is being dangling:

user@elementary:~$ which apt
/usr/bin/apt
user@elementary:~$ ls -l /usr/bin/apt
-rwxr-xr-x 1 root root 23072 Apr  7 09:02 /usr/bin/apt
user@elementary:~$ ls -l /usr/sbin/apt
lrwxrwxrwx 1 root root 21 Apr  7 09:02 /usr/sbin/apt -> /etc/alternatives/apt
user@elementary:~$ ls -l /etc/alternatives/apt
ls: cannot access '/etc/alternatives/apt': No such file or directory
user@elementary:~$ sudo update-alternatives --display apt
update-alternatives: error: no alternatives for apt
user@elementary:~$

@jumpyvi

jumpyvi commented Sep 23, 2026

Copy link
Copy Markdown
Member Author

/etc/alternatives should be correctly copied over: https://github.com/elementary/os/blob/97da00e1ae8731631e68d7227132c69308c472f2/mkosi.images/base/mkosi.extra/usr/lib/tmpfiles.d/etc.conf

Do you need to run update-alternative for the shim to be detected?

@ryonakano

ryonakano commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Yes, apt and apt-get points to apt-shim once I run the following commands:

https://github.com/elementary/apt-shim/blob/36f2528796f8d78470828e116d4547bc9e640b6b/debian/postinst#L5-L9

@github-actions

Copy link
Copy Markdown

Installer builds for 7205d0b

Do not use these installers for production systems. They are intended for testing purposes only. They will update to the latest PR build, which will break your install eventually.

Arch ISO Checksum
amd64 elementaryos-9.0-proposed-x86-64.20260924150458.iso sha256
arm64 elementaryos-9.0-proposed-arm64.20260924145755.iso sha256

@jumpyvi

jumpyvi commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

@ryonakano

With tmpfiles it does work, should it go in apt-shim or os?

L      /etc/alternatives/apt       -    -    -    -   /usr/bin/io.elementary.apt-shim
L+     /usr/sbin/apt               -    -    -    -   /etc/alternatives/apt
L       /etc/alternatives/apt-get   -    -    -    -   /usr/bin/io.elementary.apt-shim
L+     /usr/sbin/apt-get           -    -    -    -   /etc/alternatives/apt-get

@ryonakano

Copy link
Copy Markdown
Member

Thank you for investigation! I think it should be in the os-repository because I think apt-shim itself handles update-alternatives correctly as it worked as expected in elementary/apt-shim#1

@github-actions

Copy link
Copy Markdown

Installer builds for 0a955a1

Do not use these installers for production systems. They are intended for testing purposes only. They will update to the latest PR build, which will break your install eventually.

Arch ISO Checksum
amd64 elementaryos-9.0-proposed-x86-64.20260926135121.iso sha256
arm64 elementaryos-9.0-proposed-arm64.20260926134906.iso sha256

@jumpyvi
jumpyvi enabled auto-merge (squash) September 26, 2026 15:16
@github-actions

Copy link
Copy Markdown

Installer builds for 000b24b

Do not use these installers for production systems. They are intended for testing purposes only. They will update to the latest PR build, which will break your install eventually.

Arch ISO Checksum
amd64 elementaryos-9.0-proposed-x86-64.20260926151737.iso sha256
arm64 elementaryos-9.0-proposed-arm64.20260926151703.iso sha256

@jumpyvi
jumpyvi merged commit f0b016f into main Sep 26, 2026
3 checks passed
@jumpyvi
jumpyvi deleted the remove-apt branch September 26, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove APT from sysupdate

3 participants