How do you create an apt-get package - apt

I have a .out file for a project I am working on and I would like it available to download with an apt-get command. I wanted the apt-get command to be like sudo apt-get install packageName. I am using elementary OS, which is built off of Ubuntu. I also have the project posted on github.

I think equivs is the easiest. You can install with:
sudo apt-get install equivs
With equivs-control command you can create a blank spec file and build your deb package with equivs-build command.

Related

Question about laravel installation to laravel team members [duplicate]

When I run a composer update I get this error message:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Failed to download psr/log from dist: The zip extension and unzip command are both missing, skipping.
The php.ini used by your command-line PHP is: /etc/php/7.0/cli/php.ini
Now trying to download from source
What do I need to do to enable the zip and unzip commands so that composer can download dependencies?
Depending on your flavour of Linux and PHP version these may vary.
(sudo) yum install zip unzip php-zip
(sudo) apt install zip unzip php-zip
This is a very commonly asked question, you'll be able to find more useful info in the aether by searching <distro> php <version> zip extension.
For servers with PHP 5.6
sudo apt-get install zip unzip php5.6-zip
Not to belabor the point, but if you are working in a Dockerfile, you would solve this particular issue with Composer by installing the unzip utility. Below is an example using the official PHP image to install unzip and the zip PHP extension for good measure.
FROM php:7.4-apache
# Install Composer
COPY --from=composer /usr/bin/composer /usr/bin/composer
# Install unzip utility and libs needed by zip PHP extension
RUN apt-get update && apt-get install -y \
zlib1g-dev \
libzip-dev \
unzip
RUN docker-php-ext-install zip
This is a helpful GitHub issue where the above is lovingly lifted from.
For Debian Jessie (which is the current default for the PHP image on Docker Hub):
apt-get install --yes zip unzip php-pclzip
You can omit the --yes, but it's useful when you're RUN-ing it in a Dockerfile.
For older Ubuntu distros i.e 16.04, 14.04, 12.04 etc
sudo apt-get install zip unzip php7.0-zip
I had PHP7.2 on a Ubuntu 16.04 server and it solved my problem:
sudo apt-get install zip unzip php-zip
Update
Tried this for Ubuntu 18.04 and worked as well.
I'm Using Ubuntu and with the following command worked
apt-get install --yes zip unzip
In case you're using a locale development environment like XAMPP, just locate the php.ini file (C:\xampp\php in my case), open it and remove the semicolon from the following line.
;extension=zip
Restart your Apache webserver and it will work fine.
On docker with image php:7.2-apache I just needed zip and unzip. No need for php-zip :
apt-get install zip unzip
or Dockerfile
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "zip"]
RUN ["apt-get", "install", "-y", "unzip"]
If you are using Ubuntu and PHP 7.2, use this...
sudo apt-get update
sudo apt-get install zip unzip php7.2-zip
I got this error when I installed Laravel 5.5 on my digitalocean cloud server (Ubuntu 18.04 and PHP 7.2) and the following command fixed it.
sudo apt install zip unzip php7.2-zip
For PHP8.2 (Windows)
As stated here: https://www.php.net/manual/en/zip.installation.php#zip.installation.new.windows
As of PHP 8.2.0, php_zip.dll DLL must be enabled in php.ini. Previously, this extension was built-in.
You will need to manually enable this extension within your php.ini by adding extension=php_zip.dll
For a list of installed extensions you can run:
php -m
or if you have grep installed even easier would be:
php -m | grep "zip"
Actually composer nowadays seems to work without the zip command line command, so installing php-zip should be enough --- BUT it would display a warning:
As there is no 'unzip' command installed zip files are being unpacked using the
PHP zip extension.
This may cause invalid reports of corrupted archives. Installing 'unzip' may
remediate them.
See also Is there a problem with using php-zip (composer warns about it)
PHP-ZIP needs some dependancies or library missing, depends on the image from Dockerfile you need to install them first
RUN set -eux \
&& apt-get update \
&& apt-get install -y libzip-dev zlib1g-dev \
&& docker-php-ext-install zip
PHP 8.1
apt-get install --yes zip
The shortest command to fix it on Debian and Ubuntu (dependencies will be installed automatically):
sudo apt install php-zip
Try this for PHP 7.4:
sudo apt-get install zip unzip php7.4-zip
And for PHP 8.0:
sudo apt-get install zip unzip php8.0-zip
After run
apt install php-zip
and run again
composer require ...
I get the next warning and suggestion
As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
Installing 'unzip' or '7z' (21.01+) may remediate them.
As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
Installing 'unzip' or '7z' (21.01+) may remediate them.
So I suggest install unzip first.
apt install unzip
Please check your composer status first
composer diagnose
If the status showing
zip: extension not found, unzip not available, 7-Zip not available
then
Open your XAMPP Server
Apache -> config button ->Click "PHP(php.ini)"
Find "zip"
";extension = zip will shown
Remove the semicolon and save the file
Restart your XAMPP Apache
Now
composer create-project laravel/laravel <<project_name>>
or
laravel new <<project_name>>
apt-get install zip
I'm running a docker container and this helped me
docker-compose exec app apt-get install zip
install 7 zip from this site https://www.7-zip.org/download.html this software unzips the files for you and solvesd the errors

How install python hunspell on aws-lambda

How to run
sudo apt install libhunspell-dev
command on aws-lambda?
I tried many ways like serverless.yml requirements.
And I am able to install pip packages.
But I would like to run apt commands.

Docker Install Wine Dockerfile EULA

I have a little problem to install Wine on my alpine image.
Here is my Dockerfile :
RUN dpkg --add-architecture i386 && sudo apt-get update
RUN sudo apt-get install software-properties-common python-software-properties
RUN sudo add-apt-repository ppa:ubuntu-wine/ppa
RUN sudo apt-get update
RUN sudo apt-get install wine1.8 winetricks
RUN sudo apt-get purge software-properties-common python-software-properties
RUN rm -rf /tmp/* /var/lib/apt/lists/* /root/.cache/*
CMD /bin/bash;
All seems to work well, but during the sudo apt-get install wine1.8 winetricks I have this EULA screen :
Of course I don't have the right to write "YES". I tried :
RUN echo "yes" | sudo apt-get install wine1.8 winetricks
RUN sudo apt-get -y install wine1.8 winetricks
What can I do ?
Note: In the interest of edification, I would love it if a more learned linux/docker user could explain the mechanics behind why my solution worked for me.
Possible Solution:
I encountered this exact problem. I must have tried every conceivable way to pass an argument via my Dockerfile that would accept the EULA; to include piping an echo of "yes" to the wine installation command, as you've tried, setting environment variables and so-on. So, you're not alone here. I did, however, find a very simple solution through experimentation.
It turns out that if you install the TrueType core fonts (the package the EULA is for) before installing wine, you can pass it the "yes" input like so and wine will never prompt for the EULA:
RUN echo "yes" | apt install ttf-mscorefonts-installer -y
I'm not sure why this is. I suspect that it's because installing wine installs several other packages/dependencies in the process, and the echo/pipe approach does not extend to all packages that wine attempts to install. Perhaps by installing the fonts separately, the wine installation script either disregards the package because it's already present, or some file within the font installation logs the EULA acceptance response.
Here's the contents of my Dockerfile. I'm on Ubuntu 16.04 LTS, using Docker version 18.02.0-ce, build fc4de44:
FROM ubuntu:16.04
RUN dpkg --add-architecture i386
RUN apt-get update -y
RUN echo "yes" | apt install ttf-mscorefonts-installer -y
RUN apt-get install wine -y
I see it's four months since this post was made, but if you haven't found a solution, I hope this helps!

How to install ruby on linux in a specific folder

I try to install ruby and rails to start to learn ruby on rails.
I work on Windows. After many search and tries, I gave up and installed a fresh ubuntu 14 x64 in a VirtualBox.
I installed ruby with apt-get, but its files get spread all over the file system (/bin, /var...). So, I have to use always sudo and search all over the place when installing gems.
I would like, just like in windows, find a ruby tar.gz which I can decompress in a folder of mine, with all files at the same place, where I have the "control" over the files, and I can watch easily what it's hapenning while installing gems, rails, etc...
The problem : I cannot find any tar.gz (or similar archive) of ruby for linux which I simply can uncompress in a folder and work with it (I can manage the $path). The only one I can find is for Windows !
Thanks !
It sounds like what you want is Ruby's source code. Go to https://www.ruby-lang.org/en/downloads/ and look under "Compiling Ruby - Source Code". That's where you'll find the .tar.gz files you want. You'll need to compile and install it before you can actually use it. Installing normally copies files "all over the file system", but you can force it to install to a specific folder by passing the --prefix option to the ./configure script.
$ tar -xf ruby-2.2.1.tar.gz
$ cd ruby-2.2.1
$ ./configure --prefix=/my/ruby/dir
$ make && make install
You may need to install some dev packages in order to get it to compile, but any compilation errors should make it clear what you need.
These instructions are also described here.
Thank you Max for your response.
In case someone else tries to compile ruby on a fresh new ubuntu, this is what I had to do to build and use it with success :
Install missing dependencies :
get the latest "Stable Snapshot" from https://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz and not the "Current stable"
sudo apt-get install libffi-dev
sudo apt-get install zlibc zlib1g zlib1g-dev
sudo apt-get install openssl
sudo apt-get install libssl0.9.8 [[[ first, find the latest version with : apt-cache search libssl | grep SSL ]]]
sudo apt-get install ca-certificates
sudo apt-get install libssl-dev
sudo apt-get install libreadline-dev
Then :
Edit downloaded file tools/rbinstall.rb, goto line 714 and correct the typo :
change "rescue LoadErroe" to "rescue LoadError" (not corrected in date of 20 March 2015).
Run Max's instructions above
Don't move the ruby destination folder declared with "--prefix" (even if you try to correct the shells in ruby/bin)
Finally, for using rails :
sudo apt-get install libsqlite3-dev
sudo apt-get install nodejs ==> inorder to have a js runtime

Installing Opencpu via apt-get install, not working

I just ran an apt-get install, and this is the output I get.
$ sudo apt-get install opencpu
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package opencpu
Anybody else run into problems installing opencpu in Ubuntu 14.04 (LTS)?
You need to add the opencpu-1.5 ppa repository first:
sudo add-apt-repository ppa:opencpu/opencpu-1.5
sudo apt-get update
sudo apt-get install opencpu
Have a look at the server manual for more detailed instructions.

Resources