malordin / steamdeck-samba-server

Setting Up a Samba Server on Steam Deck
MIT License
68 stars 7 forks source link

error: failed to commit transaction (invalid or corrupted package) #4

Open QuickBASIC opened 1 year ago

QuickBASIC commented 1 year ago

Doesn't seem to work currently.

(1)(deck@steamdeck ~)$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/malordin/steamdeck-samba-server/main/script.sh)"

WARNING: This script will install Samba server on your system.
Did you change the password via passwd? [Y/N] y
Please enter your password: [sudo] password for deck: Continuing with Samba server installation...
Disabling steamos-readonly...
Editing pacman.conf file...
Populating pacman keys...
==> Appending keys from archlinux.gpg...
==> Updating trust database...
gpg: next trustdb check due at 2023-10-27
Initializing pacman keys...
Installing samba...
:: Synchronizing package databases...
 jupiter-rel is up to date
 holo-rel is up to date
 core-rel is up to date
 extra-rel is up to date
 community-rel is up to date
 multilib-rel is up to date
resolving dependencies...
looking for conflicting packages...

Packages (3) liburing-2.2-1  perl-parse-yapp-1.21-5  samba-4.17.1-1

Total Installed Size:  56.65 MiB

:: Proceed with installation? [Y/n] 
(3/3) checking keys in keyring                                                                [#######################################################] 100%
(3/3) checking package integrity                                                              [#######################################################] 100%
error: liburing: signature from "David Runge <dvzrv@archlinux.org>" is invalid
:: File /var/cache/pacman/pkg/liburing-2.2-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] 
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.
Adding 'deck' user to samba user database...
sudo: smbpasswd: command not found
Enabling and starting smb service...
Failed to enable unit: Unit file smb.service does not exist.
Failed to start smb.service: Unit smb.service not found.
Writing new smb.conf file...
tee: /etc/samba/smb.conf: No such file or directory
Restarting smb service...
Failed to restart smb.service: Unit smb.service not found.
Filesystem now read-only
Samba server set up successfully! You can access the 'steamapps', 'downloads' and 'mmcblk0p1' folders on your Steam Deck from any device on your local network.
Press Enter to continue...
malordin commented 1 year ago

It looks like you are having the keys checked during installation for some reason, try editing the file manually.

Type sudo steamos-readonly disable in the terminal.

Then, go to /etc/ via Steam Deck explorer and find the pacman.conffile, open it with KWrite text editor, find the line that starts with SigLevel =

and make this line equal to this:

SigLevel = TrustAll

Save the changes and try to run the script again.

QuickBASIC commented 1 year ago

As far as I can tell SigLevel = TrustAll was already added by your script (this screenshot before any changes). I assume it's in there multiple times because I ran the script multiple times.

image

miscalaneous commented 1 year ago

I'm having this same issue. After running steamos updates, samba quit working for me with "smb.service does not exist", and attempting to reinstall leads to the same as above. SigLevel = TrustAll is already set by the script.

I can set up and configure samba on other distros easy peasy but trying to get it running on the steamdeck is endlessly tricky and I had to rely on this script last time.

malordin commented 1 year ago

@miscalaneous @QuickBASIC

Apparently something really broke with the Steam OS update. Please run the following commands and then run the script with Samba again.

sudo steamos-readonly disable
sudo rm -r /etc/pacman.d/gnupg
sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman -Sy gnupg archlinux-keyring

When asked Y or N, answer "Y."

I had the same error, I checked everything again and I have it working. Please do what I ask and share the results, thanks.

miscalaneous commented 12 months ago

Edit: On an updated fresh install of the stable branch, your fix works and it installed and runs properly.

It got farther along the install process, but fails after it adds the deck user to the samba database. I tried manually installing samba and then running the script but it throws the same errors. One thing to note though, is that I upgraded to the Preview channel of Steam OS.

(deck@steamdeck ~)$ sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/malordin/steamdeck-samba-server/main/script.sh)"
WARNING: This script will install Samba server on your system.
Did you change the password via passwd? [Y/N] y
Please enter your password: Continuing with Samba server installation...
Disabling steamos-readonly...
Warning: The rootfs is already read-write!
         Nothing is performed.
Editing pacman.conf file...
Populating pacman keys...
==> Appending keys from archlinux.gpg...
==> Updating trust database...
gpg: next trustdb check due at 2023-09-30
Initializing pacman keys...
Installing samba...
:: Synchronizing package databases...
 jupiter-rel is up to date
 holo-rel is up to date
 core-rel is up to date
 extra-rel is up to date
 community-rel is up to date
 multilib-rel is up to date
warning: samba-4.17.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) samba-4.17.1-1

Total Installed Size:  56.35 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
(1/1) checking available disk space                [######################] 100%
:: Processing package changes...
(1/1) reinstalling samba                           [######################] 100%
:: Running post-transaction hooks...
(1/3) Reloading system manager configuration...
(2/3) Creating temporary files...
/usr/lib/tmpfiles.d/steamos.conf:6: Duplicate line for path "/root", ignoring.
/usr/lib/tmpfiles.d/steamos.conf:23: Duplicate line for path "/var/empty", ignoring.
/usr/lib/tmpfiles.d/tmp.conf:12: Duplicate line for path "/var/tmp", ignoring.
/usr/lib/tmpfiles.d/var.conf:19: Duplicate line for path "/var/cache", ignoring.
(3/3) Arming ConditionNeedsUpdate...
Adding 'deck' user to samba user database...
smbpasswd: /usr/lib/samba/libsamba3-util-samba4.so: version `SAMBA_4.17.1_SAMBA4' not found (required by smbpasswd)
smbpasswd: /usr/lib/samba/libmsrpc3-samba4.so: version `SAMBA_4.17.1_SAMBA4' not found (required by smbpasswd)
smbpasswd: /usr/lib/samba/libgenrand-samba4.so: version `SAMBA_4.17.1_SAMBA4' not found (required by smbpasswd)
smbpasswd: /usr/lib/samba/libreplace-samba4.so: version `SAMBA_4.17.1_SAMBA4' not found (required by smbpasswd)
smbpasswd: /usr/lib/samba/libcliauth-samba4.so: version `SAMBA_4.17.1_SAMBA4' not found (required by smbpasswd)
smbpasswd: /usr/lib/samba/liblibsmb-samba4.so: version `SAMBA_4.17.1_SAMBA4' not found (required by smbpasswd)
smbpasswd: /usr/lib/samba/libsecrets3-samba4.so: version `SAMBA_4.17.1_SAMBA4' not found (required by smbpasswd)
smbpasswd: /usr/lib/samba/libsamba-debug-samba4.so: version `SAMBA_4.17.1_SAMBA4' not found (required by smbpasswd)
smbpasswd: /usr/lib/samba/libcli-smb-common-samba4.so: version `SAMBA_4.17.1_SAMBA4' not found (required by smbpasswd)
smbpasswd: /usr/lib/samba/libdcerpc-samba-samba4.so: version `SAMBA_4.17.1_SAMBA4' not found (required by smbpasswd)
Enabling and starting smb service...
Job for smb.service failed because the control process exited with error code.
See "systemctl status smb.service" and "journalctl -xeu smb.service" for details.
Writing new smb.conf file...
Restarting smb service...
Job for smb.service failed because the control process exited with error code.
See "systemctl status smb.service" and "journalctl -xeu smb.service" for details.
Filesystem now read-only
Samba server set up successfully! You can access the 'steamapps', 'downloads' and 'mmcblk0p1' folders on your Steam Deck from any device on your local network.
Press Enter to continue...
malordin commented 8 months ago

@miscalaneous

Valve is apparently breaking the samba package and its dependencies in some way. I ran into the exact same problem, but in trying to fix it I only completely broke my system. When upgrading from a bootable flash drive and updating to the latest Steam OS version, the script works fine.

➜  ~ sh -c "$(curl -fsSL https://raw.githubusercontent.com/malordin/steamdeck-samba-server/main/script.sh)"
WARNING: This script will install Samba server on your system.
Did you change the password via passwd? [Y/N] Y
Please enter your password: Continuing with Samba server installation...
Disabling steamos-readonly...
Editing pacman.conf file...
Initializing pacman keys...
Populating pacman keys...
==> Appending keys from archlinux.gpg...
==> Updating trust database...
gpg: next trustdb check due at 2023-12-31
Installing samba...
:: Synchronizing package databases...
 jupiter-3.5 is up to date
 holo-3.5 is up to date
 core-3.5 is up to date
 extra-3.5 is up to date
 community-3.5 is up to date
 multilib-3.5 is up to date
resolving dependencies...
looking for conflicting packages...

Packages (1) samba-4.18.3-1

Total Installed Size:  56.41 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                [#######################################################] 100%
(1/1) checking package integrity                                                              [#######################################################] 100%
(1/1) loading package files                                                                   [#######################################################] 100%
(1/1) checking for file conflicts                                                             [#######################################################] 100%
(1/1) checking available disk space                                                           [#######################################################] 100%
:: Processing package changes...
(1/1) installing samba                                                                        [#######################################################] 100%
Optional dependencies for samba
    python-dnspython: netads_dns.py, dnsresolver.py and traffic_packets.py 
    python-markdown: ms_schema_markdown.py and ms_forest_updates_markdown.py
    python-cryptography: lockout_tests.py gp_cert_auto_enroll_ext.py gpo.py and kcrypto.py
:: Running post-transaction hooks...
(1/3) Reloading system manager configuration...
(2/3) Creating temporary files...
/usr/lib/tmpfiles.d/steamos.conf:6: Duplicate line for path "/root", ignoring.
/usr/lib/tmpfiles.d/steamos.conf:23: Duplicate line for path "/var/empty", ignoring.
/usr/lib/tmpfiles.d/tmp.conf:12: Duplicate line for path "/var/tmp", ignoring.
/usr/lib/tmpfiles.d/var.conf:19: Duplicate line for path "/var/cache", ignoring.
(3/3) Arming ConditionNeedsUpdate...
Writing new smb.conf file...
Adding 'deck' user to samba user database...
New SMB password:
Retype new SMB password:
Enabling and starting smb service...
Created symlink /etc/systemd/system/multi-user.target.wants/smb.service → /usr/lib/systemd/system/smb.service.
Restarting smb service...
Filesystem now read-only
Samba server set up successfully! You can access the 'steamapps', 'downloads' and 'mmcblk0p1' folders on your Steam Deck from any device on your local network.
Press Enter to continue...
➜  ~ sudo cat /etc/*-release
DISTRIB_ID="SteamOS"
DISTRIB_RELEASE="rolling"
DISTRIB_CODENAME="Holo"
DISTRIB_DESCRIPTION="SteamOS Holo"
NAME="SteamOS"
PRETTY_NAME="SteamOS"
VERSION_CODENAME=holo
ID=steamos
ID_LIKE=arch
ANSI_COLOR="1;35"
HOME_URL="https://www.steampowered.com/"
DOCUMENTATION_URL="https://support.steampowered.com/"
SUPPORT_URL="https://support.steampowered.com/"
BUG_REPORT_URL="https://support.steampowered.com/"
LOGO=steamos
VARIANT_ID=steamdeck
VERSION_ID=3.5.7
BUILD_ID=20231122.1
➜  ~ 

I guess in your case you need to uninstall samba and its dependencies and install it again, but I don't have this error anymore and I don't know how to fix it. It would be great if you suddenly fixed it, then tell me what was done to fix it! :)

miscalaneous commented 1 week ago

I guess in your case you need to uninstall samba and its dependencies and install it again, but I don't have this error anymore and I don't know how to fix it. It would be great if you suddenly fixed it, then tell me what was done to fix it! :)

Apologies for the necro. I think I did end up getting it running again, but it broke with a subsequent update. I recently upgraded to a Steam Deck OLED and will be attempting setting this up again, and I remembered reading that awhile back SteamOS added whitelists, which might let samba and the samba config persist through updates. Haven't found any documentation on it yet though and I'm still a newbie to Arch. Just something to maybe look into.