Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed primitive apt-get to modern apt #467

Closed
wants to merge 1 commit into from
Closed

Changed primitive apt-get to modern apt #467

wants to merge 1 commit into from

Conversation

tsimonq2
Copy link
Contributor

This will change the apt-get command to apt, which is recommended by the apt team and has more features and flexibility. I ran:

$ grep -r "apt-get"
snapcraft/tests/test_lxd.py:                  'apt-get', 'update']),
snapcraft/tests/test_lxd.py:                  'apt-get', 'install', 'snapcraft', '-y']),
snapcraft/repo.py:        subprocess.check_call(['sudo', 'apt-get', '-o',
snapcraft/lxd.py:            self._container_run(['apt-get', 'update'])
snapcraft/lxd.py:            self._container_run(['apt-get', 'install', 'snapcraft', '-y'])
docs/mir-snaps.md:apt-get install virt-manager
.travis.yml:  - sudo apt-get -qq update
.travis.yml:  - sudo apt-get install -y python3-coverage python3-distutils-extra
HACKING.md:    sudo apt-get install python3-flake8 python3-fixtures python3-testscenarios python3-mock python3-responses
HACKING.md:    sudo apt-get install python3-coverage

And it seems this is a good thing to do. So I ran:

$ find . -type f -print0 | xargs -0 sed -i 's/apt-get/apt/g'

And then I confirmed it worked well by grepping again.

From man apt:

SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS
       The apt(8) commandline is designed as an end-user tool and it may change behavior between versions. While it tries not to break backward
       compatibility this is not guaranteed either if a change seems beneficial for interactive use.

       All features of apt(8) are available in dedicated APT tools like apt-get(8) and apt-cache(8) as well.  apt(8) just changes the default value of
       some options (see apt.conf(5) and specifically the Binary scope). So you should prefer using these commands (potentially with some additional
       options enabled) in your scripts as they keep backward compatibility as much as possible.

I believe this will be a lot better than using apt-get in snapcraft.

@snappy-m-o
Copy link

Can one of the admins verify this patch?

1 similar comment
@snappy-m-o
Copy link

Can one of the admins verify this patch?

@sergiusens
Copy link
Collaborator

I am closing this one as we discussed on irc that using apt would not be the right thing for scripting yet

@sergiusens sergiusens closed this Jun 15, 2016
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.

None yet

3 participants