Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: What is a package, really?

  1. #1
    Join Date
    Jun 2014
    Beans
    295

    What is a package, really?

    A quick Google search reveals that packages are a collection of items: scripts, libraries, text files, a manifest, a license, etc... I know what scripts and text files are, and I also have a general idea about what a license is, but what about libraries and a manifest? Could somebody explain what these are exactly?

    Also, when I decide to install a package, say mpg123 like so,

    Code:
    sudo apt install mpg123
    and use the utility like so,

    Code:
    mpg123 ~/Music/"Mozart - Requiem.mp3"
    what is the name of the package?

    What about if I do:

    Code:
    sudo apt install tofrodos
    and then:

    Code:
    todos test_file.txt
    What is the package name here? Is it tofrodos or is it todos/fromdos? Do package names have to have the same name as the utility contained within the package? This is what confuses me when people talk about packages. In Windows, the term "package" isn't used. When you want to install a program, you download the executable, preferably from a trusted source, and then double-click on the executable file to install it. The name of the executable is the same name as the application once installed.

  2. #2
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,430
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: What is a package, really?

    There is absolutely no reason, other than convenience, for the name of the package to have any relation at all to the names of any of the files inside it, nor to the name of the .deb file that's actually downloaded.

    The package file contains an archive of the files that will be installed, to locations fitting the Filesystem Hierarchy Standard, and a list of other packages that are required for the software to function.

    There is no Windows equivalent to packages and, in general, you should not attempt to think of Ubuntu in Windows terms. They are not the same, and you will only cause yourself confusion by thinking that they are.

  3. #3
    Join Date
    Mar 2009
    Beans
    1,982

    Re: What is a package, really?

    Quote Originally Posted by John_Patrick_Mason View Post
    A quick Google search reveals that packages are a collection of items: scripts, libraries, text files, a manifest, a license, etc... I know what scripts and text files are, and I also have a general idea about what a license is, but what about libraries and a manifest? Could somebody explain what these are exactly?
    • script -- A human-readable text file which is intended to be executed by the computer. It requires an interpreter of some sort which can understand the language(s) contained in the file.
    • library -- A file containing compiled bytecode which is directly executable by the CPU on the system. Alternately it could be bytecode intended for a virtual machine. Not readable by a human.
    • text file -- Self explanatory I think.
    • manifest -- When you order a package from Amazon and it has 6 things in it, you get a piece of paper either inside the box or taped to the outside. This is a manifest. The package manifest is the same idea but more specific and detailed.
    • license -- Not going to preach, but you should figure this one out. Open Source licenses tend to be very readable by people who are not lawyers. And they're important.


    Also, when I decide to install a package, say mpg123 like so,

    Code:
    sudo apt install mpg123
    and use the utility like so,

    Code:
    mpg123 ~/Music/"Mozart - Requiem.mp3"
    what is the name of the package?

    What about if I do:

    Code:
    sudo apt install tofrodos
    and then:

    Code:
    todos test_file.txt
    What is the package name here? Is it tofrodos or is it todos/fromdos? Do package names have to have the same name as the utility contained within the package? This is what confuses me when people talk about packages. In Windows, the term "package" isn't used. When you want to install a program, you download the executable, preferably from a trusted source, and then double-click on the executable file to install it. The name of the executable is the same name as the application once installed.
    Catkiller already pretty much covered all of this. But package names in a distribution are not random.

    You could define a package and put stuff in it, it's kind of like a zip file. Your package could have all of the features of an Ubuntu .deb file (package). You can name it spongebob.deb and it will have some random stuff in it, none of which have anything to do with an irritating children's cartoon.

    When a Linux distribution is made, its maintainers usually use "upstream" project names as their package names. Otherwise, for packages maintained by the distro, they will try to make a name which is informative to the user base. Sometimes there is a customary form for the package name. For example, a package containing libraries is almost always named 'libsomething'. Packages relating to QEMU usually are named 'qemusomething'. Variants of the system logger tend to contain 'syslog' in the name.

  4. #4
    Join Date
    Mar 2009
    Beans
    1,982

    Re: What is a package, really?

    To reverse some of this, if you want to find out what package installs a file, you can do this:

    Code:
    dpkg -S /path/to/file
    For example,

    Code:
    $ dpkg -S /bin/ls
    coreutils: /bin/ls

  5. #5
    Join Date
    Jun 2014
    Beans
    295

    Re: What is a package, really?

    Quote Originally Posted by CatKiller
    The package file contains an archive of the files that will be installed, to locations fitting the Filesystem Hierarchy Standard, and a list of other packages that are required for the software to function.
    Also known as dependencies, correct?

    Also, before installing a package, do I need to run:

    Code:
    sudo apt update
    formerly known as sudo apt-get update, every time? What about running:

    Code:
    sudo apt upgrade
    formerly known as sudo apt-get upgrade? Back when I was learning the terminal using William E. Shotts' The Linux Command Line, when the book introduced the concept of package management, it suggested typing:

    Code:
    sudo apt-get update; sudo apt-get upgrade
    but I was always afraid of typing in the second part of that command, because I didn't want to upgrade my Ubuntu version to a more recent version.

    Also, does running the Ubuntu Software Updater update all the utilities/applications installed through the terminal, or do I need to run sudo apt update/upgrade every time before installing a utility/application through the terminal?

    Edit: Just noticed that two other people posted before this post.
    Last edited by John_Patrick_Mason; April 15th, 2019 at 01:02 AM.

  6. #6
    Join Date
    Mar 2009
    Beans
    1,982

    Re: What is a package, really?

    sudo apt update pulls the list of current packages from the servers registered in your configuration.

    sudo apt upgrade checks your installed packages and compares the versions installed with the latest greatest, and then installs whatever is necessary. This is an over-simplification but suitable for the discussion.

    You don't need to sudo apt update but if you don't you risk installing an older package which will then be upgraded next time you do an upgrade, so you will have installed it twice.

    You don't need to sudo apt upgrade before installing your new package, but depending on the flags you use the same situation might come up and you will wind up installing things more times than necessary.

    To combine the two above commands, you would:

    Code:
    sudo apt update && sudo apt upgrade
    The && will only execute the second command if the first one ran without errors.

    Apt will only upgrade in the same "branch." The command do-release-upgrade will upgrade you from one 'release number' of Ubuntu to the next. For example, if you're on Ubuntu 16.10 you could do do-release-upgrade to get to 18.10.

  7. #7
    Join Date
    Jun 2014
    Beans
    295

    Re: What is a package, really?

    First of all, thank you all for taking the time to answer my questions. I really appreciate it. I did end up reading The Linux Command Line cover to cover, but because I learned the command line so quickly, I still do have some gaps in my knowledge.

    Quote Originally Posted by 1clue
    When a Linux distribution is made, its maintainers usually use "upstream" project names as their package names.
    In this case, Debian, correct? Downstream would be Linux Mint.

    Quote Originally Posted by 1clue
    sudo apt update pulls the list of current packages from the servers registered in your configuration.
    And this is important because package names sometimes change, as in the case of dos2unix to tofrodos, right?

    Quote Originally Posted by 1clue
    You don't need to sudo apt update but if you don't you risk installing an older package which will then be upgraded next time you do an upgrade, so you will have installed it twice.
    If you forget to run sudo apt update before installing a package and you decide to run sudo apt upgrade after it gets installed, will sudo apt upgrade delete the path to the utility, or will your system show two versions of different utilities installed on your system, like on some servers, i.e. dos2unix/unix2dos and todos/fromdos both pointing to different locations, when using them with the which command?

  8. #8
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,430
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: What is a package, really?

    Quote Originally Posted by John_Patrick_Mason View Post
    And this is important because package names sometimes change, as in the case of dos2unix to tofrodos, right?
    No, simply to see if there's a newer version.

    If you forget to run sudo apt update before installing a package and you decide to run sudo apt upgrade after it gets installed, will sudo apt upgrade delete the path to the utility, or will your system show two versions of different utilities installed on your system, like on some servers, i.e. dos2unix/unix2dos and todos/fromdos both pointing to different locations, when using them with the which command?
    No, nothing like that.

    For each package that you have installed where the version number of the package from the repository is higher than the version that you've already got, apt upgrade will download and install the new version. apt update simply refreshes the list of which versions are available from each repository.

    There are two situations where apt update is important: where you've added or removed a repository; and where a package has been updated twice since the last time you did an upgrade, but your local list of available packages refers to the intermediate one which is no longer available. It's simply a good habit to get into to always run update before you do any package management.

    You should stop trying to think of it in the abstract. Simply install Synaptic and install and uninstall some stuff. It shows what's happening quite well.

  9. #9
    Join Date
    Mar 2009
    Beans
    1,982

    Re: What is a package, really?

    Quote Originally Posted by John_Patrick_Mason View Post
    First of all, thank you all for taking the time to answer my questions. I really appreciate it. I did end up reading The Linux Command Line cover to cover, but because I learned the command line so quickly, I still do have some gaps in my knowledge.
    No problem, but reading a book like that without taking the time to use everything in it is kind of pointless. You will certainly miss a lot of information without the practice and experimentation.

    In this case, Debian, correct? Downstream would be Linux Mint.
    No. Upstream means the place the package came from. It's true that Ubuntu is "based on" Debian, but that doesn't in any way mean that everything in Debian is newer than everything in Ubuntu.

    Creating a new distribution from scratch is a ton of work. Some distros do it anyway, and come up with something "original" so to speak. But probably most new distros start with what some other distro did. Ubuntu started with Debian. This means they used Debian's package manager and some other tools debian writes, and the same basic approach toward doing things.

    However some packages in Ubuntu are newer than the equivalent package in Debian.

    A distribution is a collection of software packages. Each package has a group of maintainers (developers) who focus on development of that one package. For example, the Linux kernel is a package. The init system is a package, there are several to choose from but in most cases the distribution will decide that for you. Likewise a logger is a package, and there are several to choose from there too.

    If you open a command line and type dpkg -l you will see a list of packages your system knows about. Each one of these represents a team of software developers who maintain a product. Each product has an official website and each project is its own upstream.

    A distribution is comprised of, among other things, this list of software packages. The maintainers will download the source, compile it, and build a binary package with all the files necessary for their default configuration. There's way more to it than that, but it's the basic idea. There is also testing, bug patches, and a lot of other things.

    Canonical, the company which maintains Ubuntu and its official variants, makes its own decisions about whether an upstream project is ready for their stable branch. They don't follow Debian's lead here. They make their own decisions about which packages to include in the distribution.

    Keep in mind that if the people who started Ubuntu thought there was nothing wrong with Debian, they would be using Debian. Also keep in mind that all these distributions are pulling from the same upstream sources. So the reason for the dissatisfaction would be in the priorities and/or the compilation or configuration options provided by the maintainers of the existing distribution.

    And this is important because package names sometimes change, as in the case of dos2unix to tofrodos, right?



    If you forget to run sudo apt update before installing a package and you decide to run sudo apt upgrade after it gets installed, will sudo apt upgrade delete the path to the utility, or will your system show two versions of different utilities installed on your system, like on some servers, i.e. dos2unix/unix2dos and todos/fromdos both pointing to different locations, when using them with the which command?
    Catkiller's answer to this is as good as I could give you.
    Last edited by 1clue; April 15th, 2019 at 03:49 PM.

  10. #10
    Join Date
    Jun 2014
    Beans
    295

    Re: What is a package, really?

    Quote Originally Posted by 1clue
    No problem, but reading a book like that without taking the time to use everything in it is kind of pointless. You will certainly miss a lot of information without the practice and experimentation.
    But I did, to the point where I was starting to develop RSI in my hands, where I had to get an ergonomic keyboard. It's just that the chapter devoted to package management doesn't really explain what a package is. All what it says is, "Here are the tools for package management, have fun." It's a good book, but there are other chapters like that, such as the one on networking.

    Upstream would be like coreutils from the GNU project, or the GNOME desktop environment, right?

    Do these people get compensated, like Bram Moolenaar et al. for the vim project, or does Ubuntu, Debian, and the other distributions, just take packages from them and contribute nothing in return? I'm asking because I've read comments from people about how Ubuntu contributes very little "upstream." I don't know if that's a fair criticism or not.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •