• 0 Posts
  • 49 Comments
Joined 2 years ago
cake
Cake day: June 26th, 2023

help-circle







  • Package managers are complex tools that handle versioning, dependencies, updates, uninstalls and so on.

    No. The original package manager can only handle install, uninstall and update (even no update). Since 1995 CPAN was invented, the package manager start to add feature to handle download and dependency resolve.

    Actually you still can find this kind old school package manager: Slackware, its package manager can only handle install, uninstall and update. It won’t do any dependency check or version check. It’s package format also very simple: just a tarball, install is extract tarball to specific directory and execute doinst.sh in tarball. Uninstall is invert, remove all files in tarball and execute douninst.sh.

    If you package all files needed by install process into a tarball and place it in your repo, you will get a Slaceware package manager with download feature. (Slackware don’t have download feature, all official packages were included in install media and you must download third-party packages by yourself.)

    Package mangers are also distro specific.

    Package manager can be universal. But make it universal with cost: since it can’t depend on any distro-specific thing, it must include nearly everything of userspace.
    (NOTE: Your script repo is not universal since prebuilt binary downloaded from script usually depends on some distro-specific things, such as Glibc version. Glibc is backward compatible, but not forward compatible. So you can’t use these binary in the environment with lower version glibc than when it was built. So many projects will try to avoid these things, they use static-linked musl or don’t use libc at all (e.g. Golang). But it will bring maintenance pressure so most projects don’t do it unless there is an infrastructure to do it easily, such as Golang)
    Actually there is some package manager make themselves universal like Gentoo-prefix and Nix.

    Someone suggested brew. How do you install brew according to https://brew.sh/ ?
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    See the problem?

    That’s bootstrap problem. You always need a way to get the first package manager. I don’t know how Homebrew do. But you can use curl command to download static-linked version package manager to use it without any https://example.com/install.sh for most linux package manager (Except the one written by python. Actually you can do it as well, just download hundreds of files is annoying.).





  • In anicent China, the writer and statesman Su Xun (蘇洵,苏洵) wrote a article named “On the Six Fallen States” (六國論, 六国论) about why the six states (韓、趙、魏、楚、燕、齊) were conquered by Qin (秦) during the Warring States period (戰國時代,战国时期)? The following is an excerpt from the relevant paragraph.

    今日割五城,明日割十城,然后得一夕安寝。
    One day five cities could be ceded, and on the next day, another ten cities could be surrendered just so that a certain person would have a single night of good sleep.
    起视四境,而秦兵又至矣。
    But in waking up and looking around, Qin troops again were approaching.
    然则诸侯之地有限,暴秦之欲无厌,奉之弥繁,侵之愈急。
    However, there was a limit to the available land of the lords and callous Qin’s avarice could never be satiated. The more there were giveaways, the more earnest Qin’s aggression would become.
    故不战而强弱胜负已判矣。
    So, even before going into battle, the odds-on-favorite and the most likely victor had already been decided.
    至于颠覆,理固宜然。
    As to the ultimate toppling, that was a forgone conclusion.
    古人云:“以地事秦,犹抱薪救火,薪不尽,火不灭。”
    Ancient people said: “Using land to serve Qin State would be like carrying firewood to put out fire. As long as there’s firewood left, the fire would not be extinguished.”

    In ancient, the six states use land to serve Qin state; in modern, the people use money to serve the companies provide subscription. The more people who pay for a subscription, the more power they have over price increases and control over your data.